60 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{{ define "main" }}
 | 
						|
<div class="post">
 | 
						|
  <h1 class="post-title">
 | 
						|
    <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
 | 
						|
  <div class="post-meta">
 | 
						|
      {{ if .Params.Date }}
 | 
						|
    <span class="post-date">
 | 
						|
      {{ .Date.Format "2006-01-02" }}
 | 
						|
    </span>
 | 
						|
    {{ end }}
 | 
						|
    {{ with .Params.Author }}
 | 
						|
    <span class="post-author">::
 | 
						|
      {{ . }}
 | 
						|
    </span>
 | 
						|
    {{ end }}
 | 
						|
  </div>
 | 
						|
 | 
						|
  {{ if .Params.tags }}
 | 
						|
  <span class="post-tags">
 | 
						|
    {{ range .Params.tags }}
 | 
						|
    #<a href="{{ (urlize (printf "tags/%s/" .)) | absLangURL }}">{{ . }}</a> 
 | 
						|
    {{ end }}
 | 
						|
  </span>
 | 
						|
  {{ end }}
 | 
						|
 | 
						|
  {{ with .Params.Cover }}
 | 
						|
    <img src="{{ . | absURL }}" class="post-cover" />
 | 
						|
  {{ end }}
 | 
						|
 | 
						|
  {{ if .Params.Toc }}
 | 
						|
    <div class="table-of-contents">
 | 
						|
        <h2>
 | 
						|
          {{ if .Params.TocTitle }}
 | 
						|
            {{ .Params.TocTitle }}
 | 
						|
          {{ else if $.Site.Params.TocTitle }}
 | 
						|
            {{ $.Site.Params.TocTitle }}
 | 
						|
          {{ else }}
 | 
						|
            Table of Contents
 | 
						|
          {{ end }}
 | 
						|
        </h2>
 | 
						|
      {{ .TableOfContents }}
 | 
						|
    </div>
 | 
						|
  {{ end }}
 | 
						|
 | 
						|
  <div class="post-content">
 | 
						|
    {{- with .Content -}}
 | 
						|
      <div>
 | 
						|
        {{ . | replaceRE "(<h[1-9] id=\"([^\"]+)\".+)(</h[1-9]+>)" `${1}<a href="#${2}" class="hanchor" ariaLabel="Anchor">⌗</a> ${3}` | safeHTML }}
 | 
						|
      </div>
 | 
						|
    {{- end -}}
 | 
						|
  </div>
 | 
						|
 | 
						|
  {{ if eq .Type $.Site.Params.contentTypeName }}
 | 
						|
  {{ partial "posts_pagination.html" . }}
 | 
						|
  {{ end }}
 | 
						|
 | 
						|
  {{ partial "comments.html" . }}
 | 
						|
</div>
 | 
						|
{{ end }}
 |