From fecc9b268410c8fefcd1ca32bc4228bba9002178 Mon Sep 17 00:00:00 2001 From: GNUxeava Date: Fri, 11 Mar 2022 10:32:10 +0530 Subject: use theme --- layouts/partials/comments.html | 138 +++++++++++++++++++++++ layouts/partials/footer.html | 53 +++++++++ layouts/partials/head.html | 91 +++++++++++++++ layouts/partials/header.html | 21 ++++ layouts/partials/header/language-selector.html | 25 ++++ layouts/partials/icons.html | 6 + layouts/partials/post/copyright.html | 35 ++++++ layouts/partials/post/outdated-info-warning.html | 28 +++++ layouts/partials/post/reward.html | 21 ++++ layouts/partials/post/toc.html | 9 ++ layouts/partials/scripts.html | 135 ++++++++++++++++++++++ layouts/partials/slideout.html | 27 +++++ 12 files changed, 589 insertions(+) create mode 100644 layouts/partials/comments.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/header/language-selector.html create mode 100644 layouts/partials/icons.html create mode 100644 layouts/partials/post/copyright.html create mode 100644 layouts/partials/post/outdated-info-warning.html create mode 100644 layouts/partials/post/reward.html create mode 100644 layouts/partials/post/toc.html create mode 100644 layouts/partials/scripts.html create mode 100644 layouts/partials/slideout.html (limited to 'layouts/partials') diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html new file mode 100644 index 0000000..7fd6676 --- /dev/null +++ b/layouts/partials/comments.html @@ -0,0 +1,138 @@ +{{ if and .IsPage (ne .Params.comment false) -}} + + {{- if .Site.DisqusShortname -}} +
+ + + {{- end -}} + + + {{- if and .Site.Params.changyanAppid .Site.Params.changyanAppkey -}} +
+ + {{- end -}} + + + {{- if .Site.Params.livereUID -}} +
+ + +
+ {{- end -}} + + + {{- if .Site.Params.gitment.owner -}} +
+ + + + + {{- end -}} + + + {{- if .Site.Params.gitalk.owner -}} +
+ + + + + {{- end }} + + + {{- if .Site.Params.valine.enable -}} + + {{- if .Site.Params.valine.visitor -}} + + + 0 +

+
+ {{- end }} +
+ + + + {{- end }} + + + {{- if .Site.Params.utterances.owner}} + + + {{- end }} + +{{- end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..9dea06d --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,53 @@ + + + diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..483339d --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + +{{- if .Description -}} + +{{- else if .IsPage -}} + +{{- else if .Site.Params.description -}} + +{{- end -}} + +{{- if .Keywords -}} + {{ $length := len .Keywords | add -1 -}} + +{{- else if .Site.Params.keywords -}} + {{ $length := len .Site.Params.keywords | add -1 -}} + +{{- end }} + + +{{ with .Site.Params.baiduVerification }}{{ end }} +{{ with .Site.Params.googleVerification }}{{ end }} + + + + + + +{{- with .OutputFormats.Get "RSS" }} + + +{{- end -}} + + + + + + + + + +{{- if .Site.Params.debug -}} + + +{{- end -}} + + +{{- if .Site.Params.busuanzi.enable -}} + +{{- end -}} + + +{{ $style := resources.Get "sass/main.scss" | toCSS | minify | fingerprint }} + +{{ if .Site.Params.publicCDN.enable -}} + {{ if .Site.Params.fancybox }}{{ .Site.Params.publicCDN.fancyboxCSS | safeHTML }}{{ end }} +{{- else -}} + {{ if .Site.Params.fancybox }}{{ end }} +{{- end -}} + + +{{ range .Site.Params.customCSS -}} + +{{ end }} + +{{/* NOTE: These Hugo Internal Templates can be found starting at https://github.com/spf13/hugo/blob/master/tpl/tplimpl/template_embedded.go#L158 */}} +{{- template "_internal/opengraph.html" . -}} +{{- template "_internal/google_news.html" . -}} +{{- template "_internal/schema.html" . -}} +{{- template "_internal/twitter_cards.html" . -}} + + +{{ `` | safeHTML }} + +{{ `` | safeHTML }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..24d5b37 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,21 @@ +
+ +
+ +{{ partial "header/language-selector.html" . }} + + diff --git a/layouts/partials/header/language-selector.html b/layouts/partials/header/language-selector.html new file mode 100644 index 0000000..e28650e --- /dev/null +++ b/layouts/partials/header/language-selector.html @@ -0,0 +1,25 @@ + +{{ if (and (.Site.IsMultiLingual) ($.Site.Params.showLanguageSelector)) }} +
+ +
+{{ end }} diff --git a/layouts/partials/icons.html b/layouts/partials/icons.html new file mode 100644 index 0000000..9c1f5df --- /dev/null +++ b/layouts/partials/icons.html @@ -0,0 +1,6 @@ + + {{- $fname:=print "icons/" . ".svg" -}} + {{- $path:=" \ No newline at end of file diff --git a/layouts/partials/post/copyright.html b/layouts/partials/post/copyright.html new file mode 100644 index 0000000..35a7609 --- /dev/null +++ b/layouts/partials/post/copyright.html @@ -0,0 +1,35 @@ +{{ if or .Params.postMetaInFooter (and .Site.Params.postMetaInFooter (ne .Params.postMetaInFooter false)) -}} +
+ + + {{ if $.Site.Params.linkToMarkDown -}} + {{ with $.OutputFormats.Get "markdown" -}} + + {{- end }} + {{- end }} + {{ if or .Params.contentCopyright (and .Site.Params.contentCopyright (ne .Params.contentCopyright false)) -}} + + {{- end }} +
+{{- end }} diff --git a/layouts/partials/post/outdated-info-warning.html b/layouts/partials/post/outdated-info-warning.html new file mode 100644 index 0000000..3736c13 --- /dev/null +++ b/layouts/partials/post/outdated-info-warning.html @@ -0,0 +1,28 @@ +{{- if or .Params.enableOutdatedInfoWarning (and .Site.Params.outdatedInfoWarning.enable (ne .Params.enableOutdatedInfoWarning false)) }} + {{- $daysAgo := div (sub now.Unix .Lastmod.Unix) 86400 }} + {{- $hintThreshold := .Site.Params.outdatedInfoWarning.hint | default 30 }} + {{- $warnThreshold := .Site.Params.outdatedInfoWarning.warn | default 180 }} + + {{- $updateTime := .Lastmod }} + {{- if .GitInfo }} + {{- if lt .GitInfo.AuthorDate.Unix .Lastmod.Unix }} + {{- $updateTime := .GitInfo.AuthorDate }} + {{- end }} + {{- end -}} + + {{- if gt $daysAgo $hintThreshold }} +
+ {{- if gt $daysAgo $warnThreshold }} +
+ {{- else }} +
+ {{- end }} +

{{ T "outdatedInfoWarningBefore" -}} + + {{- dateFormat "January 2, 2006" $updateTime -}} + {{ T "outdatedInfoWarningAfter" -}} +

+
+
+ {{- end -}} +{{- end -}} diff --git a/layouts/partials/post/reward.html b/layouts/partials/post/reward.html new file mode 100644 index 0000000..baceac7 --- /dev/null +++ b/layouts/partials/post/reward.html @@ -0,0 +1,21 @@ +{{ if or .Params.reward (and .Site.Params.reward.enable (ne .Params.reward false)) -}} +
+ + +
+ {{ $qrCode := .Site.Params.reward }} + {{ with $qrCode.wechat -}} + + {{- end }} + {{ with $qrCode.alipay -}} + + {{- end }} +
+
+{{- end }} \ No newline at end of file diff --git a/layouts/partials/post/toc.html b/layouts/partials/post/toc.html new file mode 100644 index 0000000..759ad43 --- /dev/null +++ b/layouts/partials/post/toc.html @@ -0,0 +1,9 @@ +{{ if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) -}} +
+

{{ T "toc" }}

+ {{- $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default false }} +
+ {{.TableOfContents}} +
+
+{{- end }} \ No newline at end of file diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html new file mode 100644 index 0000000..71fe659 --- /dev/null +++ b/layouts/partials/scripts.html @@ -0,0 +1,135 @@ + +{{- if .Site.Params.highlightInClient -}} + +{{- end -}} + + +{{- if .Site.Params.publicCDN.enable }} + {{ .Site.Params.publicCDN.jquery | safeHTML }} + {{ .Site.Params.publicCDN.slideout | safeHTML }} + {{ if .Site.Params.fancybox }}{{ .Site.Params.publicCDN.fancyboxJS | safeHTML }}{{ end }} +{{- else -}} + + + {{ if .Site.Params.fancybox }}{{ end }} +{{- end -}} + + +{{- if and (or .Params.enableOutdatedInfoWarning (and .Site.Params.outdatedInfoWarning.enable (ne .Params.enableOutdatedInfoWarning false))) (or .IsPage .IsHome) }} + {{- if .Site.Params.publicCDN.enable }} + {{ .Site.Params.publicCDN.timeagoJS | safeHTML }} + {{ .Site.Params.publicCDN.timeagoLocalesJS | safeHTML }} + {{- else }} + + + {{- end }} + +{{- end -}} + + +{{- if and (or .Params.flowchartDiagrams.enable (and .Site.Params.flowchartDiagrams.enable (ne .Params.flowchartDiagrams.enable false))) (or .IsPage .IsHome) -}} + + {{- if .Site.Params.publicCDN.enable -}} + {{ .Site.Params.publicCDN.flowchartDiagramsJS | safeHTML }} + {{- else -}} + + + {{- end -}} +{{- end -}} + + +{{- if and (or .Params.sequenceDiagrams.enable (and .Site.Params.sequenceDiagrams.enable (ne .Params.sequenceDiagrams.enable false))) (or .IsPage .IsHome) -}} + + {{- if .Site.Params.publicCDN.enable -}} + {{ .Site.Params.publicCDN.sequenceDiagramsJS | safeHTML }} + {{ .Site.Params.publicCDN.sequenceDiagramsCSS | safeHTML }} + {{- else -}} + + + + + + {{- end -}} +{{- end }} +{{ $even := resources.Get "js/even.js" }} +{{ $main := resources.Get "js/main.js" }} +{{ $js := slice $even $main | resources.Concat "js/main.js" | minify | fingerprint }} + + +{{- if and (or .Params.mathjax (and .Site.Params.mathjax (ne .Params.mathjax false))) (or .IsPage .IsHome) }} + + {{ if .Site.Params.mathjaxUseLocalFiles -}} + + {{- else -}} + + {{- end }} +{{- end }} + + +{{- if (in (slice (getenv "HUGO_ENV") hugo.Environment) "production") | and .Site.GoogleAnalytics -}} + {{ template "_internal/google_analytics_async.html" . }} +{{- end -}} + +{{- with .Site.Params.baiduAnalytics -}} + +{{- end }} + + +{{- if .Site.Params.baiduPush -}} + +{{- end }} + + +{{ range .Site.Params.customJS -}} + +{{ end }} diff --git a/layouts/partials/slideout.html b/layouts/partials/slideout.html new file mode 100644 index 0000000..da0885c --- /dev/null +++ b/layouts/partials/slideout.html @@ -0,0 +1,27 @@ + + -- cgit v1.2.3