From 579ab59b6e32cd4f82a953f7e48335f2c851189a Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 28 Oct 2023 16:55:23 +0000 Subject: [PATCH] Theme Files Update --- hugo.toml | 3 +- layouts/_default/baseof.html | 42 +++++++++----------- layouts/partials/favicons.html | 12 +++--- layouts/partials/posts_single_info.html | 20 ++++++++++ layouts/partials/svg.html | 2 + layouts/posts/single.html | 53 +++++++++---------------- 6 files changed, 67 insertions(+), 65 deletions(-) create mode 100644 layouts/partials/posts_single_info.html diff --git a/hugo.toml b/hugo.toml index b217ff5..985356b 100644 --- a/hugo.toml +++ b/hugo.toml @@ -74,7 +74,8 @@ enableEmoji = true scrollToTop = true global_mathjax = false readTime = true - readTimeSeparator = "\u002F||\u005C Reading Time:" + readTimeSeparator = "\u2026 \u23F2 Reading Time:" + # legacyLayout = false [[params.social]] name = "twitter" diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index bd972d5..f2dc647 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -2,29 +2,25 @@ - {{- partial "analytics.html" . }} - - - - {{- with .Site.Params.themeColor }} - - - {{- end }} - {{- partial "structured-data.html" . }} - {{- partial "favicons.html" }} - {{.Title}} - {{ range .AlternativeOutputFormats -}} - {{ printf `` .Rel .MediaType.Type .Permalink $.Title | safeHTML }} - {{ end -}} - {{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}} - - {{- range .Params.custom_css }} - - {{- end }} - {{- block "head" . -}}{{- end }} - {{- if templates.Exists "partials/extra-head.html" -}} - {{ partial "extra-head.html" . }} - {{- end }} +{{- partial "analytics.html" . }} + + + +{{- with .Site.Params.themeColor }} + + +{{- end -}} +{{- partial "structured-data.html" . -}} +{{- partial "favicons.html" -}} +{{.Title}} +{{ range .AlternativeOutputFormats -}} +{{ printf `` .Rel .MediaType.Type .Permalink $.Title | safeHTML }} +{{ end -}} +{{ $style := resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "css/style.css" . | toCSS | minify | fingerprint -}} + +{{- range .Params.custom_css -}}{{- end -}} +{{- block "head" . -}}{{- end }} +{{- if templates.Exists "partials/extra-head.html" -}}{{ partial "extra-head.html" . }}{{- end }} diff --git a/layouts/partials/favicons.html b/layouts/partials/favicons.html index 27f5226..431e523 100644 --- a/layouts/partials/favicons.html +++ b/layouts/partials/favicons.html @@ -1,6 +1,6 @@ - - - - - - + + + + + + diff --git a/layouts/partials/posts_single_info.html b/layouts/partials/posts_single_info.html new file mode 100644 index 0000000..b4e5cfd --- /dev/null +++ b/layouts/partials/posts_single_info.html @@ -0,0 +1,20 @@ +{{- with .Params.description }}

{{.}}

{{- end }} +{{- if and .Params.author .Params.authorLink}}{{ $relreflink := relref . .Params.authorLink }}

{{ partial "svg.html" (dict "context" . "name" "author") }}{{ .Params.author }}

+{{- else if .Params.author }}{{ $relreflink := relref . .Site.Author.about }}

{{ partial "svg.html" (dict "context" . "name" "author") }}{{ .Params.author }}

+{{- else }}{{ $relreflink := relref . .Site.Author.about }}

{{ partial "svg.html" (dict "context" . "name" "author") }}{{ .Site.Author.name }}

+{{- end }} +{{- with .Params.tags }} +

{{- partial "svg.html" (dict "context" . "name" "posts_single_tags") -}}{{- range . -}}{{.}}{{- end }}

+{{- end }} +

{{- partial "svg.html" (dict "context" . "name" "posts_single_wordcount") }}{{ i18n "wordCount" . -}} {{- partial "readTime.html" . -}}

+

{{- partial "svg.html" (dict "context" . "name" "posts_single_date") }}{{ dateFormat .Site.Params.dateformNumTime .Date.Local -}} + {{- if and (not (eq .Page.Params.ShowLastmod nil)) (.Page.Params.ShowLastmod) -}} + {{- if and .GitInfo .Site.Params.gitUrl -}} + [{{- partial "svg.html" (dict "context" . "name" "posts_single_git_commit") -}}{{ .GitInfo.AbbreviatedHash -}} @ {{ dateFormat .Site.Params.dateformNum .GitInfo.AuthorDate.Local -}}] + {{- else if not (eq .Lastmod .Date ) -}} +  [Modified : {{ dateFormat .Site.Params.dateformNumTime .Lastmod.Local -}}] + {{- else -}} + {{ errorf "Lastmod is not found in Page Frontmatter or Lastmod is same as Date" }} + {{- end -}} + {{- end -}} +

\ No newline at end of file diff --git a/layouts/partials/svg.html b/layouts/partials/svg.html index 8b5acaa..7d30973 100644 --- a/layouts/partials/svg.html +++ b/layouts/partials/svg.html @@ -76,6 +76,8 @@ {{- else if (eq .name "posts_single_git_commit") -}} +{{- else if (eq .name "posts_single_tags") -}} + {{- else -}} {{- end -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index ffa828e..c14e1aa 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -17,47 +17,29 @@
{{- end }}
+ {{- if and (not (eq .Site.Params.legacyLayout nil)) (.Site.Params.legacyLayout) -}}

{{ .Title }}

-
+ {{- else -}} +
+
+ +

{{ .Title }}

+
+
{{ .Content | replaceRE "()" `${1}${3}` | safeHTML }} @@ -67,6 +49,7 @@ {{- end }}
+ {{- end -}} {{- if .Params.toc }}