Browse Source

simplify layouts

Alexander Avery 5 months ago
parent
commit
8e8a0284b5
  1. 2
      layouts/_default/meta-extra.html
  2. 7
      layouts/games/meta-extra.html
  3. 21
      layouts/partials/article-meta.html

2
layouts/_default/meta-extra.html

@ -1,2 +0,0 @@
<h2 class="small-text">{{ .Date.Format "Mon | Jan 2, 2006" }}</h2>

7
layouts/games/meta-extra.html

@ -1,6 +1,7 @@
{{ if .Params.releaseDate }} {{ with .Params.releaseDate }}
<h2 class="small-text center-text">Released {{ dateFormat "Mon | Jan 2, 2006" .Params.releaseDate }}</h2> <h2 class="small-text">Released: {{ dateFormat "Mon | Jan 2, 2006" . }}</h2>
{{ end }} {{ end }}
<h2 class="small-text">Platforms:</h2> <h2 class="small-text">Platforms:
<span class="margin small-text">{{ delimit .Params.platforms " · " }}</span> <span class="margin small-text">{{ delimit .Params.platforms " · " }}</span>
</h2>

21
layouts/partials/article-meta.html

@ -1,22 +1,25 @@
<section class="article-header"> <section>
<h1>{{ .Title | markdownify }}</h1> <h1 class="large-text">{{ .Title | markdownify }}</h1>
{{- $authors := .Params.authors | default (slice .Site.Params.defaultAuthor) }} {{ with .Params.authors }}
{{- $primaryAuthor := index $authors 0 }} {{ $author := (index . 0) }}
<h2>
Author: <a href={{ printf "/%s/%s" "authors" (urlize $author) }}>{{ $author }}</a>
</h2>
{{ end }}
{{ with $primaryAuthor }} {{ with .Date }}
<a class="center-text" href={{ printf "/%s/%s" "authors" (urlize .) }}> <h2 class="small-text">Posted: {{ .Format "Mon | Jan 2, 2006" }}</h2>
<h2>{{ . }}</h2>
</a>
{{ end }} {{ end }}
{{ .Render "meta-extra" }} {{ .Render "meta-extra" }}
{{ range (.GetTerms "tags") }} {{ range (.GetTerms "tags") }}
<span>
<a class="small-text" href="{{ .Permalink }}">{{ .LinkTitle }}</a> <a class="small-text" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</span>
{{ end }} {{ end }}
{{ $image := (.Resources.GetMatch "featured") }} {{ $image := (.Resources.GetMatch "featured") }}
{{ partial "image.html" (dict "image" $image "alt" .Params.featured.alt "class" "shadow featured") }} {{ partial "image.html" (dict "image" $image "alt" .Params.featured.alt "class" "shadow featured") }}
</section> </section>

Loading…
Cancel
Save