mirror of
https://github.com/BBaoVanC/bobatheme.git
synced 2025-06-12 09:47:29 -05:00
Add better series taxonomy list and clean up post metadata
This commit is contained in:
19
layouts/partials/authors-meta-item.html
Normal file
19
layouts/partials/authors-meta-item.html
Normal file
@ -0,0 +1,19 @@
|
||||
{{ with .Params.authors }}
|
||||
<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>
|
||||
{{ end }}
|
18
layouts/partials/post-metadata-short.html
Normal file
18
layouts/partials/post-metadata-short.html
Normal file
@ -0,0 +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 }}
|
||||
|
||||
{{ partial "authors-meta-item.html" . }}
|
||||
{{ partial "translations-meta-item.html" . }}
|
||||
{{ partial "readingtime-meta-item.html" . }}
|
||||
{{ partial "series-meta-item.html" . }}
|
||||
{{ partial "tags-meta-item.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
@ -1,4 +1,4 @@
|
||||
{{ if or .Date .IsTranslated .Site.Params.readingtime .Site.Params.repoURL }}
|
||||
{{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime .Site.Params.gitFileURL }}
|
||||
<div class="post-metadata">
|
||||
{{ if .Date }}
|
||||
<span class="post-meta-item">
|
||||
@ -19,74 +19,11 @@
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.authors }}
|
||||
<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>
|
||||
{{ end }}
|
||||
|
||||
{{ if .IsTranslated }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "world" }}
|
||||
{{ range .Translations }}
|
||||
<a href="{{ .Permalink }}">{{ .Language }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ if ne .Site.Params.readingtime false }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "clock" }}
|
||||
{{ i18n "readingtime" .ReadingTime }}
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.gitFileURL }}
|
||||
<span class="post-meta-item">
|
||||
{{ with $.Site.Params.gitFileIcon }}
|
||||
{{ partial "icon.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "icon.html" "file" }}
|
||||
{{ end }}
|
||||
|
||||
<a href="{{ printf "%s/content/%s" . $.File.Path }}" target="_blank" rel="noopener">
|
||||
View source
|
||||
</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Params.series }}
|
||||
<div class="series">
|
||||
{{ range ($.GetTerms "series") }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "files" }}
|
||||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="tags">
|
||||
{{ range (.GetTerms "tags") }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "tag" }}
|
||||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ partial "authors-meta-item.html" . }}
|
||||
{{ partial "translations-meta-item.html" . }}
|
||||
{{ partial "readingtime-meta-item.html" . }}
|
||||
{{ partial "viewsource-meta-item.html" . }}
|
||||
{{ partial "series-meta-item.html" . }}
|
||||
{{ partial "tags-meta-item.html" . }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
6
layouts/partials/readingtime-meta-item.html
Normal file
6
layouts/partials/readingtime-meta-item.html
Normal file
@ -0,0 +1,6 @@
|
||||
{{ if ne .Site.Params.readingtime false }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "clock" }}
|
||||
{{ i18n "readingtime" .ReadingTime }}
|
||||
</span>
|
||||
{{ end }}
|
10
layouts/partials/series-meta-item.html
Normal file
10
layouts/partials/series-meta-item.html
Normal file
@ -0,0 +1,10 @@
|
||||
{{ with .Params.series }}
|
||||
<div class="series">
|
||||
{{ range ($.GetTerms "series") }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "files" }}
|
||||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
8
layouts/partials/tags-meta-item.html
Normal file
8
layouts/partials/tags-meta-item.html
Normal file
@ -0,0 +1,8 @@
|
||||
<div class="tags">
|
||||
{{ range (.GetTerms "tags") }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "tag" }}
|
||||
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</div>
|
8
layouts/partials/translations-meta-item.html
Normal file
8
layouts/partials/translations-meta-item.html
Normal file
@ -0,0 +1,8 @@
|
||||
{{ if .IsTranslated }}
|
||||
<span class="post-meta-item">
|
||||
{{ partial "icon.html" "world" }}
|
||||
{{ range .Translations }}
|
||||
<a href="{{ .Permalink }}">{{ .Language }}</a>
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
13
layouts/partials/viewsource-meta-item.html
Normal file
13
layouts/partials/viewsource-meta-item.html
Normal file
@ -0,0 +1,13 @@
|
||||
{{ with .Site.Params.gitFileURL }}
|
||||
<span class="post-meta-item">
|
||||
{{ with $.Site.Params.gitFileIcon }}
|
||||
{{ partial "icon.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "icon.html" "file" }}
|
||||
{{ end }}
|
||||
|
||||
<a href="{{ printf "%s/content/%s" . $.File.Path }}" target="_blank" rel="noopener">
|
||||
View source
|
||||
</a>
|
||||
</span>
|
||||
{{ end }}
|
Reference in New Issue
Block a user