mirror of
https://github.com/hyzendust/hyzendust.github.io.git
synced 2026-02-15 08:01:12 +01:00
Fix: remove submodule
This commit is contained in:
13
themes/hugo-theme-yue/layouts/_partials/page/author.html
Normal file
13
themes/hugo-theme-yue/layouts/_partials/page/author.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{{ $author := default site.Params.author .Params.author }}
|
||||
{{- with $author -}}
|
||||
{{- /* string or []string */ -}}
|
||||
{{- $authorType := printf "%T" $author -}}
|
||||
<span class="author">
|
||||
{{- if eq $authorType "string" -}}
|
||||
{{- . -}}
|
||||
{{- else if eq $authorType "[]string" -}}
|
||||
{{- delimit $author (i18n "authorDelimiter") -}}
|
||||
{{- end -}}
|
||||
</span>
|
||||
<br>
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,4 @@
|
||||
{{- /*
|
||||
You can add commenting systems (e.g. Disqus, and Giscus) in this file,
|
||||
which will be appended to the bottom of single page.
|
||||
*/ -}}
|
||||
11
themes/hugo-theme-yue/layouts/_partials/page/page_nav.html
Normal file
11
themes/hugo-theme-yue/layouts/_partials/page/page_nav.html
Normal file
@@ -0,0 +1,11 @@
|
||||
{{- $pages := where site.RegularPages "Section" "ne" "" -}} {{- /* exclude non-section pages, e.g. /content/about.md */ -}}
|
||||
{{ if or ($pages.Next .) ($pages.Prev .) }}
|
||||
<nav class="page-nav">
|
||||
{{- with $pages.Next . }}
|
||||
<a class="page-nav__previous-link" href="{{ .RelPermalink }}">{{ i18n "previousPage" }}{{.Title}}</a>
|
||||
{{- end }}
|
||||
{{- with $pages.Prev . }}
|
||||
<a class="page-nav__next-link" href="{{ .RelPermalink }}">{{ i18n "nextPage" }}{{.Title}}</a>
|
||||
{{- end }}
|
||||
</nav>
|
||||
{{ end }}
|
||||
23
themes/hugo-theme-yue/layouts/_partials/page/terms.html
Normal file
23
themes/hugo-theme-yue/layouts/_partials/page/terms.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{{- /*
|
||||
For a given taxonomy, renders a list of terms assigned to the page.
|
||||
|
||||
@context {page} page The current page.
|
||||
@context {string} taxonomy The taxonomy.
|
||||
|
||||
@example: {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
|
||||
*/}}
|
||||
|
||||
{{- $page := .page }}
|
||||
{{- $taxonomy := .taxonomy }}
|
||||
|
||||
{{- with $page.GetTerms $taxonomy }}
|
||||
{{- $label := (index . 0).Parent.LinkTitle }}
|
||||
<div>
|
||||
<div>{{ $label }}{{ i18n "colon" }}</div>
|
||||
<ul>
|
||||
{{- range . }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
</div>
|
||||
{{- end }}
|
||||
14
themes/hugo-theme-yue/layouts/_partials/page/toc.html
Normal file
14
themes/hugo-theme-yue/layouts/_partials/page/toc.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{{ $tocAvailable := gt (len .TableOfContents) 32 }} {{- /* length of empty TOC is 32 */ -}}
|
||||
{{ $tocEnabled := default site.Params.toc .Params.toc }}
|
||||
{{ $tocFolded := default site.Params.tocFolded .Params.tocFolded }}
|
||||
{{ $tocStatus := "" }} {{- /* folded by default */ -}}
|
||||
{{ if eq $tocFolded false }}
|
||||
{{ $tocStatus = " open" }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and $tocEnabled $tocAvailable }}
|
||||
<details class="toc"{{ $tocStatus | safeHTMLAttr }}>
|
||||
<summary class="toc__summary">{{ i18n "tableOfContents" }}</summary>
|
||||
{{ .TableOfContents }}
|
||||
</details>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{ $i18n := index site.Data "i18n" }} {{- /* data/i18n.yaml */ -}}
|
||||
{{ if .IsTranslated }}
|
||||
<ul class="translation-list">
|
||||
{{ range .Translations -}}
|
||||
{{- /*
|
||||
i18n function can't use translated language inside .Translations .
|
||||
This is a workaround for using translated string inside .Translations.
|
||||
Background: https://github.com/CyrusYip/hugo-theme-yue/issues/5
|
||||
*/ -}}
|
||||
{{ $lang := .Language.Lang }}
|
||||
{{ $colon := default ": " (index $i18n $lang "colonInTranslationList") }}
|
||||
<li class="translation-list__item">
|
||||
<a class="translation-list__link" href="{{ .RelPermalink }}">{{ or .Language.LanguageName .Language.Lang }}{{ $colon }}{{ .LinkTitle }}</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user