Use indentation inside templating blocks for better readability

This commit is contained in:
BBaoVanC 2021-11-22 02:21:15 -06:00
parent e1e211a42a
commit ead88d5e16
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
24 changed files with 310 additions and 326 deletions

View File

@ -1,5 +1,4 @@
{{ define "main" }}
<h1>
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ .Title | markdownify }}
@ -33,5 +32,4 @@
</div>
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -8,9 +8,7 @@
{{ partial "post-metadata/full.html" . }}
{{ with (.GetTerms "series") }}
{{ $series := slice }}
{{ range . }}
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
@ -26,7 +24,6 @@
{{ delimit $series ", " }}
</div>
{{ end }}
@ -102,5 +99,4 @@
{{ partial "comments.html" . }}
</div>
{{ end }}
{{ end }}

View File

@ -5,8 +5,8 @@
{{ else }}
<figure class="border">
{{ end }}
{{ with index . "src" }}
{{ with index . "src" }}
{{ $media := . }}
{{ if eq .MediaType.MainType "image" }}
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
@ -24,6 +24,5 @@
</figcaption>
{{ end }}
{{ end }}
{{ end }}
</figure>

View File

@ -3,17 +3,14 @@
{{ partial "icon.html" "user-circle" }}
{{ if index $.Site.Taxonomies "authors" }}
{{ $authors := slice }}
{{ range . }}
{{ $url := (printf "authors/%s" (. | anchorize)) | absLangURL }}
{{ $authors = $authors | append (printf `<a href="%s">%s</a>` $url . | safeHTML) }}
{{ end }}
{{ delimit $authors ", " }}
{{ else }}
{{ delimit . ", " }}
{{ end }}
</span>
{{ end }}

View File

@ -1,5 +1,4 @@
{{ with (.GetTerms "series") }}
{{ $series := slice }}
{{ range . }}
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}

View File

@ -1,5 +1,4 @@
{{ with (.GetTerms "tags") }}
{{ $tags := slice }}
{{ range . }}
{{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}

View File

@ -8,6 +8,7 @@
{{ else }}
<figure>
{{ end }}
{{ if eq $type "image" }}
<img src="{{ $src }}" alt="{{ $alt }}" />
{{ else if eq $type "video" }}

View File

@ -1,9 +1,7 @@
{{ with .Params.authors }}
<meta name="author" content="{{ delimit . ", " }}">
{{ range . }}
<meta property="article:author" content="{{ . }}">
{{ end }}
{{ end }}

View File

@ -9,14 +9,11 @@
{{ end }}
{{ range .Site.Menus.main }}
{{ $isActive := false }}
{{ if or ($.HasMenuCurrent .Menu .) ($.IsMenuCurrent .Menu .) }}
{{ $isActive = true }}
{{ end }}
<a class="navbar-item{{ if $isActive }} active{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</nav>