yamt

YAMT: Yet Another Minimal Theme for Hugo
git clone https://git.ckiri.com/yamt.git
Log | Files | Refs | LICENSE

page.html (1142B)


      1 {{- define "main" -}}
      2 {{- $wc := .WordCount -}}
      3 {{- $microPostLen := .Site.Params.microPostLen -}}
      4 {{- if le $wc $microPostLen }}
      5 <article class="micro-post">
      6 {{ else }}
      7 <article class="regular-post">
      8 {{ end -}}
      9 <h1 class="title">{{ .Title }}</h1>
     10 {{- if .Date }}
     11 <div class="metadata">
     12 {{ with .Date -}}
     13 {{- $dateTime := . | time.Format "2006-01-02T15:04:05-07:00" }}
     14 {{- $dateF := . | time.Format ":date_full" }}
     15 {{- $timeF := . | time.Format ":time_short" -}}
     16 <div>
     17 <time id="publication-date-time" datetime="{{ $dateTime }}">{{ $dateF }} {{ $timeF }}</time>
     18 </div>
     19 {{ end -}}
     20 {{ with .Params.edited -}}
     21 {{- $dateTime := . | time.Format "2006-01-02T15:04:05-07:00" }}
     22 {{- $dateF := . | time.Format ":date_full" }}
     23 {{- $timeF := . | time.Format ":time_short" -}}
     24 <div class="metadata-edited">{{ T "edited" }}:
     25 <time id="metadata-edited-date-time" datetime="{{ $dateTime }}">{{ $dateF }} {{ $timeF }}</time>
     26 </div>
     27 {{ end -}}
     28 </div>
     29 {{- end }}
     30 {{ .Content -}}
     31 {{- with .GetTerms "tags" -}}
     32 <div class="tag-section">
     33 <hr>
     34 <div class="tags">
     35 {{ range . }}
     36 {{- partial "tag.html" . -}}
     37 {{ end -}}
     38 </div>
     39 </div>
     40 {{ end -}}
     41 </article>
     42 {{ end -}}