mirror of
https://github.com/hyzendust/hyzendust.github.io.git
synced 2026-02-15 00:01:11 +01:00
Fix: remove submodule
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{{- /* You can dynamically load scripts in this file */ -}}
|
||||
3
themes/hugo-theme-yue/layouts/_partials/footer.html
Normal file
3
themes/hugo-theme-yue/layouts/_partials/footer.html
Normal file
@@ -0,0 +1,3 @@
|
||||
{{ partial "footer/rss_link.html" . }}
|
||||
{{ partial "footer/copyright.html" . }}
|
||||
{{ partial "footer/theme_info.html" . }}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{- $author := site.Params.footer.copyright.author }}
|
||||
{{- $yearStart := string site.Params.footer.copyright.yearStart }}
|
||||
{{- $yearEnd := string (default (now.Format "2006") site.Params.footer.copyright.yearEnd) }}
|
||||
{{- $yearSpan := "" }}
|
||||
{{- if not $yearStart }}
|
||||
{{- /* Use $yearEnd if $yearStart doesn't exist */ -}}
|
||||
{{- $yearSpan = $yearEnd }}
|
||||
{{- else if eq $yearStart $yearEnd }}
|
||||
{{- $yearSpan = $yearEnd }}
|
||||
{{- else }}
|
||||
{{- $yearSpan = printf "%s-%s" $yearStart $yearEnd }}
|
||||
{{- end -}}
|
||||
<p class="footer__copyright-notice">© {{ $yearSpan }} {{ $author }}</p>
|
||||
@@ -0,0 +1,3 @@
|
||||
{{- with .OutputFormats.Get "rss" -}}
|
||||
<p class="footer__rss-link"><a href="{{ .RelPermalink }}">RSS</a></p>
|
||||
{{- end }}
|
||||
@@ -0,0 +1,3 @@
|
||||
{{- $hugo := "<a href='https://gohugo.io'>Hugo</a>" -}}
|
||||
{{- $yue := "<a href='https://github.com/CyrusYip/hugo-theme-yue'>Yue</a>" -}}
|
||||
<p class="footer__theme-info">{{ i18n "themeInfo" (dict "hugo" $hugo "yue" $yue) | safeHTML }}</p>
|
||||
11
themes/hugo-theme-yue/layouts/_partials/head.html
Normal file
11
themes/hugo-theme-yue/layouts/_partials/head.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
|
||||
{{ partial "head/head-start.html" . }}
|
||||
{{ partialCached "head/scss.html" . }}
|
||||
{{ partial "head/favicon.html" . }}
|
||||
{{ partial "head/description.html" . }}
|
||||
{{ partial "opengraph.html" . }} {{/* embedded template */}}
|
||||
{{ partial "schema.html" . }} {{/* embedded template */}}
|
||||
{{ partial "head/rss_link.html" . }}
|
||||
{{ partial "head/head-end.html" . }}
|
||||
@@ -0,0 +1,3 @@
|
||||
{{- with or .Description .Summary site.Params.description | plainify | htmlUnescape | chomp }}
|
||||
<meta name="description" content="{{ . }}">
|
||||
{{- end }}
|
||||
@@ -0,0 +1 @@
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
@@ -0,0 +1 @@
|
||||
{{- /* You can put scripts and styles in this file, e.g. Google Analytics */ -}}
|
||||
@@ -0,0 +1 @@
|
||||
{{- /* You can preload scripts in this file */ -}}
|
||||
@@ -0,0 +1,3 @@
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ printf `<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .RelPermalink site.Title | safeHTML }}
|
||||
{{ end }}
|
||||
10
themes/hugo-theme-yue/layouts/_partials/head/scss.html
Normal file
10
themes/hugo-theme-yue/layouts/_partials/head/scss.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }}
|
||||
{{- with resources.Get "scss/main.scss" | toCSS $opts }}
|
||||
{{- if eq hugo.Environment "development" }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}">
|
||||
{{- else }}
|
||||
{{- with . | minify | fingerprint }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
7
themes/hugo-theme-yue/layouts/_partials/header.html
Normal file
7
themes/hugo-theme-yue/layouts/_partials/header.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<h1>{{ site.Title }}</h1>
|
||||
<nav class="menu language">
|
||||
<ul class="menu__list language__list">
|
||||
{{- partial "header/menu.html" (dict "menuID" "main" "page" .) -}}
|
||||
{{- partial "header/language_selector.html" . -}}
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -0,0 +1,15 @@
|
||||
{{ if hugo.IsMultilingual }}
|
||||
{{ if .IsTranslated -}}
|
||||
{{- /* link to translated page */ -}}
|
||||
{{ range .Translations -}}
|
||||
<li class="language__item"><a class="language__link" href="{{ .RelPermalink }}">{{ .Language.LanguageName }}</a></li>
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{- /* link to home page */ -}}
|
||||
{{ range site.Languages -}}
|
||||
{{ if ne site.Language.Lang .Lang -}} {{- /* ignore current language */ -}}
|
||||
<li class="language__item"><a class="language__link" href="{{ .Lang | relURL }}">{{ .LanguageName }}</a></li>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
48
themes/hugo-theme-yue/layouts/_partials/header/menu.html
Normal file
48
themes/hugo-theme-yue/layouts/_partials/header/menu.html
Normal file
@@ -0,0 +1,48 @@
|
||||
{{- /*
|
||||
Renders a menu for the given menu ID.
|
||||
|
||||
@context {page} page The current page.
|
||||
@context {string} menuID The menu ID.
|
||||
|
||||
@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
|
||||
*/}}
|
||||
|
||||
{{- $page := .page }}
|
||||
{{- $menuID := .menuID }}
|
||||
|
||||
{{- with index site.Menus $menuID }}
|
||||
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "partials/inline/menu/walk.html" }}
|
||||
{{- $page := .page }}
|
||||
{{- range .menuEntries }}
|
||||
{{- $attrs := dict "href" .URL }}
|
||||
{{- $attrs = merge $attrs (dict "class" "menu__link") }}
|
||||
{{- if $page.IsMenuCurrent .Menu . }}
|
||||
{{- $attrs = merge $attrs (dict "class" "menu__link menu__link--active" "aria-current" "page") }}
|
||||
{{- else if $page.HasMenuCurrent .Menu .}}
|
||||
{{- $attrs = merge $attrs (dict "class" "menu__link menu__link--ancestor" "aria-current" "true") }}
|
||||
{{- end }}
|
||||
{{- $name := .Name }}
|
||||
{{- with .Identifier }}
|
||||
{{- with T . }}
|
||||
{{- $name = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<li class="menu__item">
|
||||
<a
|
||||
{{- range $k, $v := $attrs }}
|
||||
{{- with $v }}
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
>{{ $name }}</a>
|
||||
{{- with .Children }}
|
||||
<ul>
|
||||
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
</li>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
5
themes/hugo-theme-yue/layouts/_partials/main/dates.html
Normal file
5
themes/hugo-theme-yue/layouts/_partials/main/dates.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{- /* Used by home.html, single.html, list.html */ -}}
|
||||
{{- partial "main/dates/date.html" . }}
|
||||
{{- if ne .Date .Lastmod }}
|
||||
{{- partial "main/dates/lastmod_wrapper.html" . }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,3 @@
|
||||
{{- $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" -}}
|
||||
{{- $dateHuman := .Date | time.Format (or site.Params.dateFormat "2006-01-02") -}}
|
||||
<time class="published-date" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>
|
||||
@@ -0,0 +1,3 @@
|
||||
{{- $lastmodMachine := .Lastmod | time.Format "2006-01-02T15:04:05-07:00" -}}
|
||||
{{- $lastmodHuman := .Lastmod | time.Format (or site.Params.dateFormat "2006-01-02") -}}
|
||||
<time class="lastmod-date" datetime="{{ $lastmodMachine }}">{{ i18n "lastmodWrapper" (dict "lastmod" $lastmodHuman) }}</time>
|
||||
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