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

@ -9,22 +9,22 @@
</div> </div>
{{ if not .IsHome }} {{ if not .IsHome }}
{{ partial "breadcrumb.html" . }} {{ partial "breadcrumb.html" . }}
{{ end }} {{ end }}
<div class="content"> <div class="content">
{{ block "main" . }} {{ block "main" . }}
{{ .Content }} {{ .Content }}
{{ end }} {{ end }}
</div> </div>
{{ with .Site.Copyright }} {{ with .Site.Copyright }}
<footer> <footer>
<hr> <hr>
<small> <small>
{{ . | safeHTML }} {{ . | safeHTML }}
</small> </small>
</footer> </footer>
{{ end }} {{ end }}
</body> </body>

View File

@ -1,37 +1,35 @@
{{ define "main" }} {{ define "main" }}
<h1>
<h1> {{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }} {{ .Title | markdownify }}
{{ .Title | markdownify }} <span class="rss-link">
<span class="rss-link"> {{ with .OutputFormats.Get "rss" }}
{{ with .OutputFormats.Get "rss" }} <a href="{{ .Permalink }}" target="_blank" rel="noopener">{{ partial "icon.html" "rss-feed" }}</a>
<a href="{{ .Permalink }}" target="_blank" rel="noopener">{{ partial "icon.html" "rss-feed" }}</a>
{{ end }}
</span>
</h1>
<div class="list-page-content">
{{ with .Sections }}
<div class="sections">
{{ range . }}
{{ .Render "summary/section" }}
{{ end }}
</div>
{{ end }}
<div class="page-list">
<ul>
{{ range .Paginator.Pages }}
<li>{{ .Render "summary/post" }}</li>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }} {{ end }}
</ul> </span>
</h1>
<div class="list-page-content">
{{ with .Sections }}
<div class="sections">
{{ range . }}
{{ .Render "summary/section" }}
{{ end }}
</div>
{{ end }}
<div class="page-list">
<ul>
{{ range .Paginator.Pages }}
<li>{{ .Render "summary/post" }}</li>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</ul>
</div>
</div> </div>
</div>
{{ partial "pagination.html" . }}
{{ partial "pagination.html" . }}
{{ end }} {{ end }}

View File

@ -1,106 +1,102 @@
{{ define "main" }} {{ define "main" }}
<div class="post-title"> <div class="post-title">
<h1> <h1>
{{ .Title | markdownify }} {{ .Title | markdownify }}
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h1> </h1>
</div> </div>
{{ partial "post-metadata/full.html" . }} {{ partial "post-metadata/full.html" . }}
{{ with (.GetTerms "series") }}
{{ with (.GetTerms "series") }} {{ $series := slice }}
{{ $series := slice }}
{{ range . }}
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
<div class="series-box">
{{ partial "icon.html" "info" }}
{{ if gt (len $series) 1 }}
This post is part of multiple series:
{{ else }}
This post is part of a series:
{{ end }}
{{ delimit $series ", " }}
</div>
{{ end }}
{{ if .Params.Toc }}
<div class="table-of-contents">
<details>
<summary>{{ i18n "table_of_contents" }}</summary>
{{ .TableOfContents }}
</details>
</div>
<div class="table-of-contents print">
{{ i18n "table_of_contents" }}
{{ .TableOfContents }}
</div>
{{ end }}
{{ with .Resources.GetMatch "feature" }}
<div class="post-media">
{{ partial "figure.html" (dict "src" . "border" true) }}
</div>
{{ end }}
{{ .Content }}
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<div class="see-also">
<h2>{{ i18n "see_also" }}</h2>
<ul>
{{ range . }} {{ range . }}
<li> {{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }} {{ end }}
</ul>
</div>
{{ end }}
{{ if or .NextInSection .PrevInSection }} <div class="series-box">
<div class="prevnext"> {{ partial "icon.html" "info" }}
{{ with .NextInSection }} {{ if gt (len $series) 1 }}
<a class="prev" href="{{ .Permalink }}"> This post is part of multiple series:
<div class="prev-caption"> {{ else }}
&larr; {{ i18n "newer_post" }} This post is part of a series:
{{ end }}
{{ delimit $series ", " }}
</div> </div>
<div class="prev-post">
{{ .Title | markdownify }}
</div>
</a>
{{ else }}
<div class="prev"></div>
{{ end }} {{ end }}
{{ with .PrevInSection }}
<a class="next" href="{{ .Permalink }}"> {{ if .Params.Toc }}
<div class="next-caption"> <div class="table-of-contents">
{{ i18n "older_post" }} &rarr; <details>
<summary>{{ i18n "table_of_contents" }}</summary>
{{ .TableOfContents }}
</details>
</div> </div>
<div class="next-post"> <div class="table-of-contents print">
{{ .Title | markdownify }} {{ i18n "table_of_contents" }}
{{ .TableOfContents }}
</div> </div>
</a>
{{ else }}
<div class="next"></div>
{{ end }} {{ end }}
</div>
{{ end }}
{{ if .Params.comments }} {{ with .Resources.GetMatch "feature" }}
<div class="comments"> <div class="post-media">
{{ partial "comments.html" . }} {{ partial "figure.html" (dict "src" . "border" true) }}
</div> </div>
{{ end }} {{ end }}
{{ .Content }}
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<div class="see-also">
<h2>{{ i18n "see_also" }}</h2>
<ul>
{{ range . }}
<li>
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if or .NextInSection .PrevInSection }}
<div class="prevnext">
{{ with .NextInSection }}
<a class="prev" href="{{ .Permalink }}">
<div class="prev-caption">
&larr; {{ i18n "newer_post" }}
</div>
<div class="prev-post">
{{ .Title | markdownify }}
</div>
</a>
{{ else }}
<div class="prev"></div>
{{ end }}
{{ with .PrevInSection }}
<a class="next" href="{{ .Permalink }}">
<div class="next-caption">
{{ i18n "older_post" }} &rarr;
</div>
<div class="next-post">
{{ .Title | markdownify }}
</div>
</a>
{{ else }}
<div class="next"></div>
{{ end }}
</div>
{{ end }}
{{ if .Params.comments }}
<div class="comments">
{{ partial "comments.html" . }}
</div>
{{ end }}
{{ end }} {{ end }}

View File

@ -8,9 +8,9 @@
{{ partial "post-metadata/short.html" . }} {{ partial "post-metadata/short.html" . }}
{{ with .Resources.GetMatch "feature" }} {{ with .Resources.GetMatch "feature" }}
<div class="post-media"> <div class="post-media">
{{ partial "figure.html" (dict "src" . "border" true) }} {{ partial "figure.html" (dict "src" . "border" true) }}
</div> </div>
{{ end }} {{ end }}
<div class="post-description"> <div class="post-description">

View File

@ -9,14 +9,14 @@
{{ partial "post-meta-item/translations.html" . }} {{ partial "post-meta-item/translations.html" . }}
{{ if ne .Site.Params.readingtime false }} {{ if ne .Site.Params.readingtime false }}
<span class="post-meta-item"> <span class="post-meta-item">
{{ partial "icon.html" "clock" }} {{ partial "icon.html" "clock" }}
{{ $readingtime := 0 }} {{ $readingtime := 0 }}
{{ range .Data.Pages }} {{ range .Data.Pages }}
{{ $readingtime = (add $readingtime .ReadingTime) }} {{ $readingtime = (add $readingtime .ReadingTime) }}
{{ end }} {{ end }}
{{ i18n "readingtime" $readingtime }} {{ i18n "readingtime" $readingtime }}
</span> </span>
{{ end }} {{ end }}
{{ partial "post-meta-item/viewsource.html" . }} {{ partial "post-meta-item/viewsource.html" . }}
@ -29,7 +29,7 @@
<div class="series-pages"> <div class="series-pages">
<ul> <ul>
{{ range .Data.Pages.Reverse }} {{ range .Data.Pages.Reverse }}
<li>{{ .Render "summary/post" }}</li> <li>{{ .Render "summary/post" }}</li>
{{ end }} {{ end }}
</ul> </ul>
</div> </div>

View File

@ -1,29 +1,28 @@
{{ $hidecaption := index . "hidecaption" }} {{ $hidecaption := index . "hidecaption" }}
{{ if index . "noborder" }} {{ if index . "noborder" }}
<figure> <figure>
{{ else }} {{ else }}
<figure class="border"> <figure class="border">
{{ end }} {{ end }}
{{ with index . "src" }} {{ with index . "src" }}
{{ $media := . }}
{{ if eq .MediaType.MainType "image" }}
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" />
{{ else if eq .MediaType.MainType "video" }}
<video controls>
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}">
{{ i18n "browser_no_video_support" }}
</video>
{{ end }}
{{ $media := . }} {{ if not $hidecaption }}
{{ if eq .MediaType.MainType "image" }} {{ with $media.Title }}
<img src="{{ $media.Permalink }}" alt="{{ $media.Title }}" /> <figcaption>
{{ else if eq .MediaType.MainType "video" }} {{ . | markdownify }}
<video controls> </figcaption>
<source src="{{ $media.Permalink }}" alt="{{ $media.Title }}"> {{ end }}
{{ i18n "browser_no_video_support" }} {{ end }}
</video>
{{ end }}
{{ if not $hidecaption }}
{{ with $media.Title }}
<figcaption>
{{ . | markdownify }}
</figcaption>
{{ end }}
{{ end }}
{{ end }} {{ end }}
</figure> </figure>

View File

@ -4,26 +4,26 @@
{{ hugo.Generator }} {{ hugo.Generator }}
{{ with resources.Get "css/bobastyle.css" | fingerprint "sha512" }} {{ with resources.Get "css/bobastyle.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }} {{ end }}
{{ with resources.Get "css/syntax.css" | fingerprint "sha512" }} {{ with resources.Get "css/syntax.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }} {{ end }}
{{ with resources.Get "css/syntax-light.css" | fingerprint "sha512" }} {{ with resources.Get "css/syntax-light.css" | fingerprint "sha512" }}
<link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="{{ .Permalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
{{ end }} {{ end }}
{{ with .Site.Params.faviconICO }} {{ with .Site.Params.faviconICO }}
<link rel="icon" type="image/x-icon" href="{{ . | absURL }}" /> <link rel="icon" type="image/x-icon" href="{{ . | absURL }}" />
{{ end }} {{ end }}
{{ with .Site.Params.faviconPNG }} {{ with .Site.Params.faviconPNG }}
<link rel="icon" type="image/png" href="{{ . | absURL }}" /> <link rel="icon" type="image/png" href="{{ . | absURL }}" />
{{ end }} {{ end }}
{{ if .IsHome }} {{ if .IsHome }}
<title>{{ .Site.Title | plainify }}</title> <title>{{ .Site.Title | plainify }}</title>
{{ else }} {{ else }}
<title>{{ (print .Title " | " .Site.Title) | plainify }}</title> <title>{{ (print .Title " | " .Site.Title) | plainify }}</title>
{{ end }} {{ end }}
{{ partial "seo-tags/opengraph.html" . }} {{ partial "seo-tags/opengraph.html" . }}

View File

@ -1,19 +1,16 @@
{{ with .Params.authors }} {{ with .Params.authors }}
<span class="post-meta-item"> <span class="post-meta-item">
{{ partial "icon.html" "user-circle" }} {{ partial "icon.html" "user-circle" }}
{{ if index $.Site.Taxonomies "authors" }} {{ if index $.Site.Taxonomies "authors" }}
{{ $authors := slice }}
{{ $authors := slice }} {{ range . }}
{{ range . }} {{ $url := (printf "authors/%s" (. | anchorize)) | absLangURL }}
{{ $url := (printf "authors/%s" (. | anchorize)) | absLangURL }} {{ $authors = $authors | append (printf `<a href="%s">%s</a>` $url . | safeHTML) }}
{{ $authors = $authors | append (printf `<a href="%s">%s</a>` $url . | safeHTML) }} {{ end }}
{{ end }} {{ delimit $authors ", " }}
{{ delimit $authors ", " }} {{ else }}
{{ delimit . ", " }}
{{ else }} {{ end }}
{{ delimit . ", " }} </span>
{{ end }}
</span>
{{ end }} {{ end }}

View File

@ -1,6 +1,6 @@
{{ if ne .Site.Params.readingtime false }} {{ if ne .Site.Params.readingtime false }}
<span class="post-meta-item"> <span class="post-meta-item">
{{ partial "icon.html" "clock" }} {{ partial "icon.html" "clock" }}
{{ i18n "readingtime" .ReadingTime }} {{ i18n "readingtime" .ReadingTime }}
</span> </span>
{{ end }} {{ end }}

View File

@ -1,12 +1,11 @@
{{ with (.GetTerms "series") }} {{ with (.GetTerms "series") }}
{{ $series := slice }}
{{ range . }}
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
{{ $series := slice }} <div class="series">
{{ range . }} {{ partial "icon.html" "files" }}
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }} {{ delimit $series ", " }}
{{ end }} </div>
<div class="series">
{{ partial "icon.html" "files" }}
{{ delimit $series ", " }}
</div>
{{ end }} {{ end }}

View File

@ -1,12 +1,11 @@
{{ with (.GetTerms "tags") }} {{ with (.GetTerms "tags") }}
{{ $tags := slice }}
{{ range . }}
{{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
{{ end }}
{{ $tags := slice }} <div class="tags">
{{ range . }} {{ partial "icon.html" "tag" }}
{{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }} {{ delimit $tags ", " }}
{{ end }} </div>
<div class="tags">
{{ partial "icon.html" "tag" }}
{{ delimit $tags ", " }}
</div>
{{ end }} {{ end }}

View File

@ -1,8 +1,8 @@
{{ if .IsTranslated }} {{ if .IsTranslated }}
<span class="post-meta-item"> <span class="post-meta-item">
{{ partial "icon.html" "world" }} {{ partial "icon.html" "world" }}
{{ range .Translations }} {{ range .Translations }}
<a href="{{ .Permalink }}">{{ .Language }}</a> <a href="{{ .Permalink }}">{{ .Language }}</a>
{{ end }} {{ end }}
</span> </span>
{{ end }} {{ end }}

View File

@ -1,13 +1,13 @@
{{ if and .Site.Params.gitFileURL .File.Path }} {{ if and .Site.Params.gitFileURL .File.Path }}
<span class="post-meta-item"> <span class="post-meta-item">
{{ with .Site.Params.gitFileIcon }} {{ with .Site.Params.gitFileIcon }}
{{ partial "icon.html" . }} {{ partial "icon.html" . }}
{{ else }} {{ else }}
{{ partial "icon.html" "file" }} {{ partial "icon.html" "file" }}
{{ end }} {{ end }}
<a href="{{ printf "%s/content/%s" .Site.Params.gitFileURL .File.Path }}" target="_blank" rel="noopener"> <a href="{{ printf "%s/content/%s" .Site.Params.gitFileURL .File.Path }}" target="_blank" rel="noopener">
View source View source
</a> </a>
</span> </span>
{{ end }} {{ end }}

View File

@ -1,28 +1,28 @@
{{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime .Site.Params.gitFileURL }} {{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime .Site.Params.gitFileURL }}
<div class="post-metadata"> <div class="post-metadata">
{{ if .Date }} {{ if .Date }}
<span class="post-meta-item"> <span class="post-meta-item">
{{ partial "icon.html" "calendar" }} {{ partial "icon.html" "calendar" }}
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate> <time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }} {{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
</time> </time>
</span> </span>
{{/* TODO: make this be a tooltip */}} {{/* TODO: make this be a tooltip */}}
{{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }} {{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }}
<span class="post-meta-item"> <span class="post-meta-item">
{{ partial "icon.html" "pencil" }} {{ partial "icon.html" "pencil" }}
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate> <time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Lastmod "Data" .Site.Data) }} {{ i18n "long_date" (dict "Date" .Lastmod "Data" .Site.Data) }}
</time> </time>
{{ end }}
</span>
{{ end }} {{ end }}
</span>
{{ end }}
{{ partial "post-meta-item/authors.html" . }} {{ partial "post-meta-item/authors.html" . }}
{{ partial "post-meta-item/translations.html" . }} {{ partial "post-meta-item/translations.html" . }}
{{ partial "post-meta-item/readingtime.html" . }} {{ partial "post-meta-item/readingtime.html" . }}
{{ partial "post-meta-item/viewsource.html" . }} {{ partial "post-meta-item/viewsource.html" . }}
{{ partial "post-meta-item/tags.html" . }} {{ partial "post-meta-item/tags.html" . }}
</div> </div>
{{ end }} {{ end }}

View File

@ -1,18 +1,18 @@
{{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime }} {{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime }}
<div class="post-metadata"> <div class="post-metadata">
{{ if .Date }} {{ if .Date }}
<span class="post-meta-item"> <span class="post-meta-item">
{{ partial "icon.html" "calendar" }} {{ partial "icon.html" "calendar" }}
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate> <time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }} {{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
</time> </time>
</span> </span>
{{ end }} {{ end }}
{{ partial "post-meta-item/authors.html" . }} {{ partial "post-meta-item/authors.html" . }}
{{ partial "post-meta-item/translations.html" . }} {{ partial "post-meta-item/translations.html" . }}
{{ partial "post-meta-item/readingtime.html" . }} {{ partial "post-meta-item/readingtime.html" . }}
{{ partial "post-meta-item/series.html" . }} {{ partial "post-meta-item/series.html" . }}
{{ partial "post-meta-item/tags.html" . }} {{ partial "post-meta-item/tags.html" . }}
</div> </div>
{{ end }} {{ end }}

View File

@ -4,24 +4,25 @@
{{ $alt := index . "alt" }} {{ $alt := index . "alt" }}
{{ if index . "border" }} {{ if index . "border" }}
<figure class="border"> <figure class="border">
{{ else }} {{ else }}
<figure> <figure>
{{ end }} {{ end }}
{{ if eq $type "image" }} {{ if eq $type "image" }}
<img src="{{ $src }}" alt="{{ $alt }}" /> <img src="{{ $src }}" alt="{{ $alt }}" />
{{ else if eq $type "video" }} {{ else if eq $type "video" }}
<video controls> <video controls>
<source src="{{ $src }}" alt="{{ $alt }}"> <source src="{{ $src }}" alt="{{ $alt }}">
{{ i18n "browser_no_video_support" }} {{ i18n "browser_no_video_support" }}
</video> </video>
{{ end }} {{ end }}
{{ if not $hidecaption }} {{ if not $hidecaption }}
{{ with $alt }} {{ with $alt }}
<figcaption> <figcaption>
{{ . | markdownify }} {{ . | markdownify }}
</figcaption> </figcaption>
{{ end }} {{ end }}
{{ end }} {{ end }}
</figure> </figure>

View File

@ -1,5 +1,5 @@
<span class="rss-link"> <span class="rss-link">
{{ with .OutputFormats.Get "rss" }} {{ with .OutputFormats.Get "rss" }}
<a href="{{ .Permalink }}" target="_blank" rel="noopener">{{ partial "icon.html" "rss-feed" }}</a> <a href="{{ .Permalink }}" target="_blank" rel="noopener">{{ partial "icon.html" "rss-feed" }}</a>
{{ end }} {{ end }}
</span> </span>

View File

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

View File

@ -5,49 +5,46 @@
<div class="topbar"> <div class="topbar">
<nav class="navbar"> <nav class="navbar">
{{ with .Site.Home }} {{ with .Site.Home }}
<a class="navbar-item{{ if $.IsHome }} active{{ end }}" href="{{ .Permalink | absLangURL }}">{{ .Title | markdownify }}</a> <a class="navbar-item{{ if $.IsHome }} active{{ end }}" href="{{ .Permalink | absLangURL }}">{{ .Title | markdownify }}</a>
{{ end }} {{ end }}
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
{{ $isActive := false }}
{{ $isActive := false }} {{ if or ($.HasMenuCurrent .Menu .) ($.IsMenuCurrent .Menu .) }}
{{ if or ($.HasMenuCurrent .Menu .) ($.IsMenuCurrent .Menu .) }} {{ $isActive = true }}
{{ $isActive = true }} {{ end }}
{{ end }} <a class="navbar-item{{ if $isActive }} active{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
<a class="navbar-item{{ if $isActive }} active{{ end }}" href="{{ .URL }}">{{ .Name }}</a>
{{ end }} {{ end }}
</nav> </nav>
{{ if .Site.IsMultiLingual }} {{ if .Site.IsMultiLingual }}
<details class="langpicker"> <details class="langpicker">
<summary> <summary>
{{- partial "icon.html" "world" -}} {{- partial "icon.html" "world" -}}
</summary> </summary>
<ul class="languages"> <ul class="languages">
{{ range .AllTranslations }} {{ range .AllTranslations }}
<li> <li>
<a class="langpicker-item{{ if eq .Language $.Site.Language }} active{{ end }}" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> <a class="langpicker-item{{ if eq .Language $.Site.Language }} active{{ end }}" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
</li> </li>
{{ end }} {{ end }}
{{ $site_translations := slice }} {{ $site_translations := slice }}
{{ range .Site.Languages }} {{ range .Site.Languages }}
{{ $site_translations = $site_translations | append .LanguageName }} {{ $site_translations = $site_translations | append .LanguageName }}
{{ end }} {{ end }}
{{ $translation_codes := slice }} {{ $translation_codes := slice }}
{{ range .AllTranslations }} {{ range .AllTranslations }}
{{ $translation_codes = $translation_codes | append .Language }} {{ $translation_codes = $translation_codes | append .Language }}
{{ end }} {{ end }}
{{ range (.Site.Languages | complement $translation_codes) }} {{ range (.Site.Languages | complement $translation_codes) }}
<li> <li>
<a class="langpicker-item unavailable">{{ .LanguageName }}</a> <a class="langpicker-item unavailable">{{ .LanguageName }}</a>
</li> </li>
{{ end }} {{ end }}
</ul> </ul>
</details> </details>
{{ end }} {{ end }}
</div> </div>

View File

@ -1,7 +1,7 @@
<aside> <aside>
{{ with .Inner }} {{ with .Inner }}
{{ . | markdownify }} {{ . | markdownify }}
{{ else }} {{ else }}
{{ errorf "The aside shortcode needs to be a closing one (similar to the highlight shortcode, see https://gohugo.io/templates/shortcode-templates/#inner" }} {{ errorf "The aside shortcode needs to be a closing one (similar to the highlight shortcode, see https://gohugo.io/templates/shortcode-templates/#inner" }}
{{ end }} {{ end }}
</aside> </aside>

View File

@ -2,12 +2,12 @@
{{ $noborder := false }} {{ $noborder := false }}
{{ if .Get "noborder" }} {{ if .Get "noborder" }}
{{ $noborder = true }} {{ $noborder = true }}
{{ end }} {{ end }}
{{ $hidecaption := false }} {{ $hidecaption := false }}
{{ if .Get "hidecaption" }} {{ if .Get "hidecaption" }}
{{ $hidecaption = true }} {{ $hidecaption = true }}
{{ end }} {{ end }}
<p> <p>

View File

@ -1,11 +1,11 @@
{{ $border := false }} {{ $border := false }}
{{ if .Get "border" }} {{ if .Get "border" }}
{{ $border = true }} {{ $border = true }}
{{ end }} {{ end }}
{{ $hidecaption := false }} {{ $hidecaption := false }}
{{ if .Get "hidecaption" }} {{ if .Get "hidecaption" }}
{{ $hidecaption = true }} {{ $hidecaption = true }}
{{ end }} {{ end }}
<p> <p>

View File

@ -1,11 +1,11 @@
{{ $border := false }} {{ $border := false }}
{{ if .Get "border" }} {{ if .Get "border" }}
{{ $border = true }} {{ $border = true }}
{{ end }} {{ end }}
{{ $hidecaption := false }} {{ $hidecaption := false }}
{{ if .Get "hidecaption" }} {{ if .Get "hidecaption" }}
{{ $hidecaption = true }} {{ $hidecaption = true }}
{{ end }} {{ end }}
<p> <p>

View File

@ -12,9 +12,9 @@
<div class="taxonomy"> <div class="taxonomy">
<ul> <ul>
{{ range .Pages }} {{ range .Pages }}
<li> <li>
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</li> </li>
{{ end }} {{ end }}
</ul> </ul>
</div> </div>