mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2024-12-22 04:13:17 -06:00
Use indentation inside templating blocks for better readability
This commit is contained in:
parent
e1e211a42a
commit
ead88d5e16
@ -9,22 +9,22 @@
|
||||
</div>
|
||||
|
||||
{{ if not .IsHome }}
|
||||
{{ partial "breadcrumb.html" . }}
|
||||
{{ partial "breadcrumb.html" . }}
|
||||
{{ end }}
|
||||
|
||||
<div class="content">
|
||||
{{ block "main" . }}
|
||||
{{ .Content }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ with .Site.Copyright }}
|
||||
<footer>
|
||||
<hr>
|
||||
<small>
|
||||
{{ . | safeHTML }}
|
||||
</small>
|
||||
</footer>
|
||||
<footer>
|
||||
<hr>
|
||||
<small>
|
||||
{{ . | safeHTML }}
|
||||
</small>
|
||||
</footer>
|
||||
{{ end }}
|
||||
</body>
|
||||
|
||||
|
@ -1,37 +1,35 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<h1>
|
||||
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
|
||||
{{ .Title | markdownify }}
|
||||
<span class="rss-link">
|
||||
{{ with .OutputFormats.Get "rss" }}
|
||||
<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>
|
||||
<h1>
|
||||
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
|
||||
{{ .Title | markdownify }}
|
||||
<span class="rss-link">
|
||||
{{ with .OutputFormats.Get "rss" }}
|
||||
<a href="{{ .Permalink }}" target="_blank" rel="noopener">{{ partial "icon.html" "rss-feed" }}</a>
|
||||
{{ 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>
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
{{ end }}
|
||||
|
@ -1,106 +1,102 @@
|
||||
{{ define "main" }}
|
||||
<div class="post-title">
|
||||
<h1>
|
||||
{{ .Title | markdownify }}
|
||||
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="post-title">
|
||||
<h1>
|
||||
{{ .Title | markdownify }}
|
||||
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
{{ partial "post-metadata/full.html" . }}
|
||||
{{ partial "post-metadata/full.html" . }}
|
||||
|
||||
|
||||
{{ with (.GetTerms "series") }}
|
||||
|
||||
{{ $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>
|
||||
{{ with (.GetTerms "series") }}
|
||||
{{ $series := slice }}
|
||||
{{ range . }}
|
||||
<li>
|
||||
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</li>
|
||||
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if or .NextInSection .PrevInSection }}
|
||||
<div class="prevnext">
|
||||
{{ with .NextInSection }}
|
||||
<a class="prev" href="{{ .Permalink }}">
|
||||
<div class="prev-caption">
|
||||
← {{ i18n "newer_post" }}
|
||||
<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>
|
||||
<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" }} →
|
||||
|
||||
{{ if .Params.Toc }}
|
||||
<div class="table-of-contents">
|
||||
<details>
|
||||
<summary>{{ i18n "table_of_contents" }}</summary>
|
||||
{{ .TableOfContents }}
|
||||
</details>
|
||||
</div>
|
||||
<div class="next-post">
|
||||
{{ .Title | markdownify }}
|
||||
<div class="table-of-contents print">
|
||||
{{ i18n "table_of_contents" }}
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
</a>
|
||||
{{ else }}
|
||||
<div class="next"></div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Params.comments }}
|
||||
<div class="comments">
|
||||
{{ partial "comments.html" . }}
|
||||
</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 . }}
|
||||
<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">
|
||||
← {{ 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" }} →
|
||||
</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 }}
|
||||
|
@ -8,9 +8,9 @@
|
||||
{{ partial "post-metadata/short.html" . }}
|
||||
|
||||
{{ with .Resources.GetMatch "feature" }}
|
||||
<div class="post-media">
|
||||
{{ partial "figure.html" (dict "src" . "border" true) }}
|
||||
</div>
|
||||
<div class="post-media">
|
||||
{{ partial "figure.html" (dict "src" . "border" true) }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="post-description">
|
||||
|
@ -9,14 +9,14 @@
|
||||
{{ partial "post-meta-item/translations.html" . }}
|
||||
|
||||
{{ if ne .Site.Params.readingtime false }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "clock" }}
|
||||
{{ $readingtime := 0 }}
|
||||
{{ range .Data.Pages }}
|
||||
{{ $readingtime = (add $readingtime .ReadingTime) }}
|
||||
{{ end }}
|
||||
{{ i18n "readingtime" $readingtime }}
|
||||
</span>
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "clock" }}
|
||||
{{ $readingtime := 0 }}
|
||||
{{ range .Data.Pages }}
|
||||
{{ $readingtime = (add $readingtime .ReadingTime) }}
|
||||
{{ end }}
|
||||
{{ i18n "readingtime" $readingtime }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "post-meta-item/viewsource.html" . }}
|
||||
@ -29,7 +29,7 @@
|
||||
<div class="series-pages">
|
||||
<ul>
|
||||
{{ range .Data.Pages.Reverse }}
|
||||
<li>{{ .Render "summary/post" }}</li>
|
||||
<li>{{ .Render "summary/post" }}</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -1,29 +1,28 @@
|
||||
{{ $hidecaption := index . "hidecaption" }}
|
||||
|
||||
{{ if index . "noborder" }}
|
||||
<figure>
|
||||
<figure>
|
||||
{{ else }}
|
||||
<figure class="border">
|
||||
<figure class="border">
|
||||
{{ end }}
|
||||
|
||||
{{ 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 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 }}
|
||||
|
||||
{{ if not $hidecaption }}
|
||||
{{ with $media.Title }}
|
||||
<figcaption>
|
||||
{{ . | markdownify }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if not $hidecaption }}
|
||||
{{ with $media.Title }}
|
||||
<figcaption>
|
||||
{{ . | markdownify }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</figure>
|
||||
|
@ -4,26 +4,26 @@
|
||||
{{ hugo.Generator }}
|
||||
|
||||
{{ 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 }}
|
||||
{{ 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 }}
|
||||
{{ 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 }}
|
||||
|
||||
{{ with .Site.Params.faviconICO }}
|
||||
<link rel="icon" type="image/x-icon" href="{{ . | absURL }}" />
|
||||
<link rel="icon" type="image/x-icon" href="{{ . | absURL }}" />
|
||||
{{ end }}
|
||||
{{ with .Site.Params.faviconPNG }}
|
||||
<link rel="icon" type="image/png" href="{{ . | absURL }}" />
|
||||
<link rel="icon" type="image/png" href="{{ . | absURL }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ if .IsHome }}
|
||||
<title>{{ .Site.Title | plainify }}</title>
|
||||
<title>{{ .Site.Title | plainify }}</title>
|
||||
{{ else }}
|
||||
<title>{{ (print .Title " | " .Site.Title) | plainify }}</title>
|
||||
<title>{{ (print .Title " | " .Site.Title) | plainify }}</title>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "seo-tags/opengraph.html" . }}
|
||||
|
@ -1,19 +1,16 @@
|
||||
{{ with .Params.authors }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "user-circle" }}
|
||||
<span class="post-meta-item">
|
||||
{{ 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>
|
||||
{{ 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 }}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{{ if ne .Site.Params.readingtime false }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "clock" }}
|
||||
{{ i18n "readingtime" .ReadingTime }}
|
||||
</span>
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "clock" }}
|
||||
{{ i18n "readingtime" .ReadingTime }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
@ -1,12 +1,11 @@
|
||||
{{ with (.GetTerms "series") }}
|
||||
{{ $series := slice }}
|
||||
{{ range . }}
|
||||
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
||||
{{ end }}
|
||||
|
||||
{{ $series := slice }}
|
||||
{{ range . }}
|
||||
{{ $series = $series | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
||||
{{ end }}
|
||||
|
||||
<div class="series">
|
||||
{{ partial "icon.html" "files" }}
|
||||
{{ delimit $series ", " }}
|
||||
</div>
|
||||
<div class="series">
|
||||
{{ partial "icon.html" "files" }}
|
||||
{{ delimit $series ", " }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@ -1,12 +1,11 @@
|
||||
{{ with (.GetTerms "tags") }}
|
||||
{{ $tags := slice }}
|
||||
{{ range . }}
|
||||
{{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
||||
{{ end }}
|
||||
|
||||
{{ $tags := slice }}
|
||||
{{ range . }}
|
||||
{{ $tags = $tags | append (printf `<a href="%s">%s</a>` .Permalink .LinkTitle) }}
|
||||
{{ end }}
|
||||
|
||||
<div class="tags">
|
||||
{{ partial "icon.html" "tag" }}
|
||||
{{ delimit $tags ", " }}
|
||||
</div>
|
||||
<div class="tags">
|
||||
{{ partial "icon.html" "tag" }}
|
||||
{{ delimit $tags ", " }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{{ if .IsTranslated }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "world" }}
|
||||
{{ range .Translations }}
|
||||
<a href="{{ .Permalink }}">{{ .Language }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "world" }}
|
||||
{{ range .Translations }}
|
||||
<a href="{{ .Permalink }}">{{ .Language }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
@ -1,13 +1,13 @@
|
||||
{{ if and .Site.Params.gitFileURL .File.Path }}
|
||||
<span class="post-meta-item">
|
||||
{{ with .Site.Params.gitFileIcon }}
|
||||
{{ partial "icon.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "icon.html" "file" }}
|
||||
{{ end }}
|
||||
<span class="post-meta-item">
|
||||
{{ with .Site.Params.gitFileIcon }}
|
||||
{{ partial "icon.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "icon.html" "file" }}
|
||||
{{ end }}
|
||||
|
||||
<a href="{{ printf "%s/content/%s" .Site.Params.gitFileURL .File.Path }}" target="_blank" rel="noopener">
|
||||
View source
|
||||
</a>
|
||||
</span>
|
||||
<a href="{{ printf "%s/content/%s" .Site.Params.gitFileURL .File.Path }}" target="_blank" rel="noopener">
|
||||
View source
|
||||
</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
|
@ -1,28 +1,28 @@
|
||||
{{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime .Site.Params.gitFileURL }}
|
||||
<div class="post-metadata">
|
||||
{{ if .Date }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "calendar" }}
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
|
||||
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
|
||||
</time>
|
||||
</span>
|
||||
<div class="post-metadata">
|
||||
{{ if .Date }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "calendar" }}
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
|
||||
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
|
||||
</time>
|
||||
</span>
|
||||
|
||||
{{/* TODO: make this be a tooltip */}}
|
||||
{{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "pencil" }}
|
||||
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
|
||||
{{ i18n "long_date" (dict "Date" .Lastmod "Data" .Site.Data) }}
|
||||
</time>
|
||||
{{/* TODO: make this be a tooltip */}}
|
||||
{{ if ne (time.Format "2006-01-02" .Lastmod) (time.Format "2006-01-02" .Date) }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "pencil" }}
|
||||
<time datetime="{{ .Lastmod.Format "2006-01-02" }}" pubdate>
|
||||
{{ i18n "long_date" (dict "Date" .Lastmod "Data" .Site.Data) }}
|
||||
</time>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "post-meta-item/authors.html" . }}
|
||||
{{ partial "post-meta-item/translations.html" . }}
|
||||
{{ partial "post-meta-item/readingtime.html" . }}
|
||||
{{ partial "post-meta-item/viewsource.html" . }}
|
||||
{{ partial "post-meta-item/tags.html" . }}
|
||||
</div>
|
||||
{{ partial "post-meta-item/authors.html" . }}
|
||||
{{ partial "post-meta-item/translations.html" . }}
|
||||
{{ partial "post-meta-item/readingtime.html" . }}
|
||||
{{ partial "post-meta-item/viewsource.html" . }}
|
||||
{{ partial "post-meta-item/tags.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@ -1,18 +1,18 @@
|
||||
{{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime }}
|
||||
<div class="post-metadata">
|
||||
{{ if .Date }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "calendar" }}
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
|
||||
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
|
||||
</time>
|
||||
</span>
|
||||
{{ end }}
|
||||
<div class="post-metadata">
|
||||
{{ if .Date }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "calendar" }}
|
||||
<time datetime="{{ .Date.Format "2006-01-02" }}" pubdate>
|
||||
{{ i18n "long_date" (dict "Date" .Date "Data" .Site.Data) }}
|
||||
</time>
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "post-meta-item/authors.html" . }}
|
||||
{{ partial "post-meta-item/translations.html" . }}
|
||||
{{ partial "post-meta-item/readingtime.html" . }}
|
||||
{{ partial "post-meta-item/series.html" . }}
|
||||
{{ partial "post-meta-item/tags.html" . }}
|
||||
</div>
|
||||
{{ partial "post-meta-item/authors.html" . }}
|
||||
{{ partial "post-meta-item/translations.html" . }}
|
||||
{{ partial "post-meta-item/readingtime.html" . }}
|
||||
{{ partial "post-meta-item/series.html" . }}
|
||||
{{ partial "post-meta-item/tags.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
@ -4,24 +4,25 @@
|
||||
{{ $alt := index . "alt" }}
|
||||
|
||||
{{ if index . "border" }}
|
||||
<figure class="border">
|
||||
<figure class="border">
|
||||
{{ else }}
|
||||
<figure>
|
||||
<figure>
|
||||
{{ end }}
|
||||
|
||||
{{ if eq $type "image" }}
|
||||
<img src="{{ $src }}" alt="{{ $alt }}" />
|
||||
<img src="{{ $src }}" alt="{{ $alt }}" />
|
||||
{{ else if eq $type "video" }}
|
||||
<video controls>
|
||||
<source src="{{ $src }}" alt="{{ $alt }}">
|
||||
{{ i18n "browser_no_video_support" }}
|
||||
</video>
|
||||
<video controls>
|
||||
<source src="{{ $src }}" alt="{{ $alt }}">
|
||||
{{ i18n "browser_no_video_support" }}
|
||||
</video>
|
||||
{{ end }}
|
||||
|
||||
{{ if not $hidecaption }}
|
||||
{{ with $alt }}
|
||||
<figcaption>
|
||||
{{ . | markdownify }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
{{ with $alt }}
|
||||
<figcaption>
|
||||
{{ . | markdownify }}
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</figure>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<span class="rss-link">
|
||||
{{ 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>
|
||||
|
@ -1,9 +1,7 @@
|
||||
{{ with .Params.authors }}
|
||||
<meta name="author" content="{{ delimit . ", " }}">
|
||||
|
||||
<meta name="author" content="{{ delimit . ", " }}">
|
||||
|
||||
{{ range . }}
|
||||
<meta property="article:author" content="{{ . }}">
|
||||
{{ end }}
|
||||
|
||||
{{ range . }}
|
||||
<meta property="article:author" content="{{ . }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
@ -5,49 +5,46 @@
|
||||
<div class="topbar">
|
||||
<nav class="navbar">
|
||||
{{ 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 }}
|
||||
|
||||
{{ 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>
|
||||
|
||||
{{ $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>
|
||||
|
||||
{{ if .Site.IsMultiLingual }}
|
||||
<details class="langpicker">
|
||||
<summary>
|
||||
{{- partial "icon.html" "world" -}}
|
||||
</summary>
|
||||
<ul class="languages">
|
||||
{{ range .AllTranslations }}
|
||||
<li>
|
||||
<a class="langpicker-item{{ if eq .Language $.Site.Language }} active{{ end }}" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
<details class="langpicker">
|
||||
<summary>
|
||||
{{- partial "icon.html" "world" -}}
|
||||
</summary>
|
||||
<ul class="languages">
|
||||
{{ range .AllTranslations }}
|
||||
<li>
|
||||
<a class="langpicker-item{{ if eq .Language $.Site.Language }} active{{ end }}" href="{{ .Permalink }}">{{ .Language.LanguageName }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ $site_translations := slice }}
|
||||
{{ range .Site.Languages }}
|
||||
{{ $site_translations = $site_translations | append .LanguageName }}
|
||||
{{ end }}
|
||||
{{ $site_translations := slice }}
|
||||
{{ range .Site.Languages }}
|
||||
{{ $site_translations = $site_translations | append .LanguageName }}
|
||||
{{ end }}
|
||||
|
||||
{{ $translation_codes := slice }}
|
||||
{{ range .AllTranslations }}
|
||||
{{ $translation_codes = $translation_codes | append .Language }}
|
||||
{{ end }}
|
||||
{{ $translation_codes := slice }}
|
||||
{{ range .AllTranslations }}
|
||||
{{ $translation_codes = $translation_codes | append .Language }}
|
||||
{{ end }}
|
||||
|
||||
{{ range (.Site.Languages | complement $translation_codes) }}
|
||||
<li>
|
||||
<a class="langpicker-item unavailable">{{ .LanguageName }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</details>
|
||||
{{ range (.Site.Languages | complement $translation_codes) }}
|
||||
<li>
|
||||
<a class="langpicker-item unavailable">{{ .LanguageName }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</details>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<aside>
|
||||
{{ with .Inner }}
|
||||
{{ . | markdownify }}
|
||||
{{ . | markdownify }}
|
||||
{{ 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 }}
|
||||
</aside>
|
||||
|
@ -2,12 +2,12 @@
|
||||
|
||||
{{ $noborder := false }}
|
||||
{{ if .Get "noborder" }}
|
||||
{{ $noborder = true }}
|
||||
{{ $noborder = true }}
|
||||
{{ end }}
|
||||
|
||||
{{ $hidecaption := false }}
|
||||
{{ if .Get "hidecaption" }}
|
||||
{{ $hidecaption = true }}
|
||||
{{ $hidecaption = true }}
|
||||
{{ end }}
|
||||
|
||||
<p>
|
||||
|
@ -1,11 +1,11 @@
|
||||
{{ $border := false }}
|
||||
{{ if .Get "border" }}
|
||||
{{ $border = true }}
|
||||
{{ $border = true }}
|
||||
{{ end }}
|
||||
|
||||
{{ $hidecaption := false }}
|
||||
{{ if .Get "hidecaption" }}
|
||||
{{ $hidecaption = true }}
|
||||
{{ $hidecaption = true }}
|
||||
{{ end }}
|
||||
|
||||
<p>
|
||||
|
@ -1,11 +1,11 @@
|
||||
{{ $border := false }}
|
||||
{{ if .Get "border" }}
|
||||
{{ $border = true }}
|
||||
{{ $border = true }}
|
||||
{{ end }}
|
||||
|
||||
{{ $hidecaption := false }}
|
||||
{{ if .Get "hidecaption" }}
|
||||
{{ $hidecaption = true }}
|
||||
{{ $hidecaption = true }}
|
||||
{{ end }}
|
||||
|
||||
<p>
|
||||
|
@ -12,9 +12,9 @@
|
||||
<div class="taxonomy">
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user