From 40f57ed72a601d8489a180f3bd9acd5e6c20d323 Mon Sep 17 00:00:00 2001 From: Ngô Ngọc Đức Huy Date: Tue, 23 Apr 2024 01:19:27 +0700 Subject: Update theme --- layouts/_default/_markup/render-heading.html | 7 +++ layouts/_default/baseof.html | 24 ++++++++++ layouts/_default/books.html | 7 --- layouts/_default/comic.html | 45 ------------------ layouts/_default/list.html | 22 +++++++++ layouts/_default/list.old.html | 20 -------- layouts/_default/project.html | 68 ---------------------------- layouts/_default/rss.xml | 34 ++++++++++++++ layouts/_default/single.html | 22 +++++++++ layouts/_default/taxonomy.html | 12 +++++ layouts/_default/terms.html | 19 ++++++++ layouts/_default/wiki.html | 32 ------------- layouts/index.html | 14 ++++++ layouts/index.old.html | 19 -------- layouts/partials/custom-webring.html | 21 ++++----- layouts/partials/fa-icons/email.svg | 1 + layouts/partials/fa-icons/github.svg | 1 + layouts/partials/fa-icons/liberapay.svg | 3 ++ layouts/partials/fa-icons/mastodon.svg | 1 + layouts/partials/fa-icons/matrix.svg | 12 +++++ layouts/partials/fa-icons/patreon.svg | 1 + layouts/partials/fa-icons/pleroma.svg | 3 ++ layouts/partials/fa-icons/sourcehut.svg | 1 + layouts/partials/font-awesome.html | 9 ++++ layouts/partials/footer.html | 17 +++++++ layouts/partials/head-extra.html | 8 ---- layouts/partials/head.html | 31 +++++++++++++ layouts/partials/header.html | 13 ++++++ layouts/partials/language-switcher.html | 5 ++ layouts/partials/left-sidebar.html | 14 ++++++ layouts/partials/pagination.html | 16 +++++++ layouts/partials/post-info.html | 28 ++++++++++++ layouts/partials/post-language-switcher.html | 16 +++++++ layouts/partials/post-pagination.html | 16 +++++++ layouts/partials/post-summary.html | 6 +++ layouts/partials/right-sidebar.html | 1 + layouts/partials/single-extra.html | 1 - layouts/partials/social.html | 17 +++++++ 38 files changed, 376 insertions(+), 211 deletions(-) create mode 100644 layouts/_default/_markup/render-heading.html create mode 100644 layouts/_default/baseof.html delete mode 100644 layouts/_default/comic.html create mode 100644 layouts/_default/list.html delete mode 100644 layouts/_default/list.old.html delete mode 100644 layouts/_default/project.html create mode 100644 layouts/_default/rss.xml create mode 100644 layouts/_default/single.html create mode 100644 layouts/_default/taxonomy.html create mode 100644 layouts/_default/terms.html delete mode 100644 layouts/_default/wiki.html create mode 100644 layouts/index.html delete mode 100644 layouts/index.old.html create mode 100644 layouts/partials/fa-icons/email.svg create mode 100644 layouts/partials/fa-icons/github.svg create mode 100644 layouts/partials/fa-icons/liberapay.svg create mode 100644 layouts/partials/fa-icons/mastodon.svg create mode 100644 layouts/partials/fa-icons/matrix.svg create mode 100644 layouts/partials/fa-icons/patreon.svg create mode 100644 layouts/partials/fa-icons/pleroma.svg create mode 100644 layouts/partials/fa-icons/sourcehut.svg create mode 100644 layouts/partials/font-awesome.html create mode 100644 layouts/partials/footer.html delete mode 100644 layouts/partials/head-extra.html create mode 100644 layouts/partials/head.html create mode 100644 layouts/partials/header.html create mode 100644 layouts/partials/language-switcher.html create mode 100644 layouts/partials/left-sidebar.html create mode 100644 layouts/partials/pagination.html create mode 100644 layouts/partials/post-info.html create mode 100644 layouts/partials/post-language-switcher.html create mode 100644 layouts/partials/post-pagination.html create mode 100644 layouts/partials/post-summary.html create mode 100644 layouts/partials/right-sidebar.html delete mode 100644 layouts/partials/single-extra.html create mode 100644 layouts/partials/social.html (limited to 'layouts') diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..73f5c26 --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1,7 @@ +{{ $id := .Anchor | safeURL }} + + + + {{ .Text | safeHTML }} + + diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..f13b730 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,24 @@ + + + + {{ partial "head.html" . }} + + + {{ i18n "skipToContent" | humanize }} +
+ {{ partial "header.html" . }} +
+
+ +
+ {{ block "main" . }}{{ end }} +
+ +
+ {{ partial "footer.html" . }} + + diff --git a/layouts/_default/books.html b/layouts/_default/books.html index c0a74d0..449b5e0 100644 --- a/layouts/_default/books.html +++ b/layouts/_default/books.html @@ -1,11 +1,4 @@ {{ define "main" }} -{{ if .Menus }} - -{{ end }}
diff --git a/layouts/_default/comic.html b/layouts/_default/comic.html deleted file mode 100644 index 508df3c..0000000 --- a/layouts/_default/comic.html +++ /dev/null @@ -1,45 +0,0 @@ -{{ define "main" }} -{{ if .Menus }} - -{{ end }} - -
-
-
-

{{ trim .Title " " }}

- {{ if in .Params.categories "comics" }} -
- {{ end}} -
-
-
- {{ partial "comicNav.html" . }} - Comic panels. See transcription below. - {{ partial "comicNav.html" . }} -
-
- - Transcription and extras - - {{ .Content }} -
-
- {{ partial "post-info.html" . }} -
- -{{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }} - {{ partial "paginationPost.html" . }} -{{ end }} - - -{{ partial "custom-webring.html" }} - -{{ end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..3079687 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,22 @@ +{{ define "main" }} +
+ {{ .Content }} +
+ + {{ if .Params.reversed }} +
    + {{ else }} +
      + {{ end }} + {{ range .Pages }} +
    • + {{ partial "post-summary.html" . }} +
    • + {{ end }} + {{ if .Params.reversed }} +
+ {{ else }} + + {{ end }} + +{{ end }} diff --git a/layouts/_default/list.old.html b/layouts/_default/list.old.html deleted file mode 100644 index 33bd8b5..0000000 --- a/layouts/_default/list.old.html +++ /dev/null @@ -1,20 +0,0 @@ -{{ define "main" }} -
- {{ .Content }} -
- -
-

{{ i18n .Title }}

- {{ if not .Params.no_feed }} - {{ range .Page.CurrentSection.Pages }} -
-
-

{{ trim .Title " " }}

-
- {{ partial "post-info.html" . }} -
- {{ end }} - {{ end}} -
- -{{ end }} diff --git a/layouts/_default/project.html b/layouts/_default/project.html deleted file mode 100644 index 5bd36e0..0000000 --- a/layouts/_default/project.html +++ /dev/null @@ -1,68 +0,0 @@ -{{ define "main" }} -{{ if .Menus }} - -{{ end }} - -
-
-

{{ trim .Title " " }}

-
-
-

Project info

-
-
Project site
-
- - {{ .Params.name }} - -
- {{ if isSet .Params "author" }} -
Creator
- {{ if isSet .Params "authorurl" }} -
{{ .Params.author }}
- {{ else }} -
{{ .Params.author }}
- {{ end }} - {{ end }} - {{ if isSet .Params "maintainers" }} -
Maintainers
- {{ range $maintainer := .Params.maintainers }} - {{ if isSet $maintainer "URL" }} -
{{ $maintainer.name }}
- {{ else }} -
{{ $maintainer.name }}
- {{ end }} - {{ end }} - {{ end }} -
Status
-
{{ .Params.projectStatus }}
-
- {{ .Content }} -
- {{ if eq .Params.projectStatus "dead" }} -

- The project is currently dead. You can fork it if you find it helpful. -

- {{ else }} -

- The development of project is {{.Params.projectStatus}}. - You can help this project by contributing code, finding new issues, - suggesting new features, or donation. -

- {{ end }} -
- {{ partial "post-info.html" . }} -
- -{{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }} - {{ partial "paginationPost.html" . }} -{{ end }} - - -{{ partial "custom-webring.html" }} - -{{ end }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 0000000..cb728d9 --- /dev/null +++ b/layouts/_default/rss.xml @@ -0,0 +1,34 @@ +{{- $pctx := . -}} +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} +{{- $pages := where $pctx.RegularPages ".Params.disable_feed" "!=" true -}} +{{- $limit := .Site.Config.Services.RSS.Limit -}} +{{- if ge $limit 1 -}} +{{- $pages = $pages | first $limit -}} +{{- end -}} +{{- printf "" | safeHTML }} + + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ .Permalink }} + {{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }} ({{.}}){{ end }}{{ end }} + Hugo -- gohugo.io{{ with .Site.LanguageCode }} + {{.}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Author.email }} + {{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}}{{ with .Site.Copyright }} + {{.}}{{end}}{{ if not .Date.IsZero }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} + {{ with .OutputFormats.Get "RSS" }} + {{ printf "" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range $pages }} + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + {{ .Content | html }} + + {{ end }} + + diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..c94d359 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,22 @@ +{{ define "main" }} +
+ {{ .Content }} + {{ partial "post-info.html" . }} +
+
+ +
+ Would you like to discuss this post? + Email me! +{{ end }} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 0000000..7b3adb9 --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,12 @@ +{{ define "main" }} +

{{ i18n .Data.Singular | humanize }}: {{ .Title }}

+ +
    + {{ range .Paginator.Pages }} +
  1. {{ partial "post-summary.html" . }}
  2. + {{ end }} +
+ +{{ end }} diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html new file mode 100644 index 0000000..d4e745e --- /dev/null +++ b/layouts/_default/terms.html @@ -0,0 +1,19 @@ +{{ define "main" }} +
+ {{ .Content }} +
+ +

{{ i18n .Title }}

+ +
    + {{ range $key, $value := .Data.Terms }} +
  • + + {{ $key }} + + ({{ len $value }}) +
  • + {{ end }} +
+ +{{ end }} \ No newline at end of file diff --git a/layouts/_default/wiki.html b/layouts/_default/wiki.html deleted file mode 100644 index 0e933b5..0000000 --- a/layouts/_default/wiki.html +++ /dev/null @@ -1,32 +0,0 @@ -{{ define "main" }} -{{ if .Menus }} - -{{ end }} - - - -{{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }} - {{ partial "paginationPost.html" . }} -{{ end }} - - -{{ partial "custom-webring.html" }} - -{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..c1da783 --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,14 @@ +{{ define "main" }} +
+ {{ .Content }} +
+ {{ with .Site.GetPage "section" "posts" }} + {{ range first 1 .Pages }} + + {{ end }} + {{ end }} + +{{ end }} diff --git a/layouts/index.old.html b/layouts/index.old.html deleted file mode 100644 index 8367de4..0000000 --- a/layouts/index.old.html +++ /dev/null @@ -1,19 +0,0 @@ -{{ define "main" }} -
- {{ .Content }} - -
- -
- {{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }} - {{ range (.Paginate $pages).Pages }} - {{ partial "post-summary.html" . }} - {{ end }} - {{ partial "pagination.html" . }} -
- -{{ end }} diff --git a/layouts/partials/custom-webring.html b/layouts/partials/custom-webring.html index 604afc4..3dd9977 100644 --- a/layouts/partials/custom-webring.html +++ b/layouts/partials/custom-webring.html @@ -1,17 +1,16 @@

Fediring

- Look at my fedi fellows' sites: -
    -
  1. Previous site
  2. -
  3. What is Fediring?
  4. -
  5. Next site
  6. -
-

Articles from blogs I read

-
+ +

{{ i18n "otherSites" }}

+
{{ partial "webring-articles.html" }} -
+ - Generated by - fead + {{ i18n "feadAttribution" | safeHTML }}
diff --git a/layouts/partials/fa-icons/email.svg b/layouts/partials/fa-icons/email.svg new file mode 100644 index 0000000..e3d84fe --- /dev/null +++ b/layouts/partials/fa-icons/email.svg @@ -0,0 +1 @@ + diff --git a/layouts/partials/fa-icons/github.svg b/layouts/partials/fa-icons/github.svg new file mode 100644 index 0000000..c80fea7 --- /dev/null +++ b/layouts/partials/fa-icons/github.svg @@ -0,0 +1 @@ + diff --git a/layouts/partials/fa-icons/liberapay.svg b/layouts/partials/fa-icons/liberapay.svg new file mode 100644 index 0000000..19d90a4 --- /dev/null +++ b/layouts/partials/fa-icons/liberapay.svg @@ -0,0 +1,3 @@ + + + diff --git a/layouts/partials/fa-icons/mastodon.svg b/layouts/partials/fa-icons/mastodon.svg new file mode 100644 index 0000000..d9baf27 --- /dev/null +++ b/layouts/partials/fa-icons/mastodon.svg @@ -0,0 +1 @@ + diff --git a/layouts/partials/fa-icons/matrix.svg b/layouts/partials/fa-icons/matrix.svg new file mode 100644 index 0000000..4aefc50 --- /dev/null +++ b/layouts/partials/fa-icons/matrix.svg @@ -0,0 +1,12 @@ + + + + + diff --git a/layouts/partials/fa-icons/patreon.svg b/layouts/partials/fa-icons/patreon.svg new file mode 100644 index 0000000..13df44e --- /dev/null +++ b/layouts/partials/fa-icons/patreon.svg @@ -0,0 +1 @@ + diff --git a/layouts/partials/fa-icons/pleroma.svg b/layouts/partials/fa-icons/pleroma.svg new file mode 100644 index 0000000..ba4bc25 --- /dev/null +++ b/layouts/partials/fa-icons/pleroma.svg @@ -0,0 +1,3 @@ + + + diff --git a/layouts/partials/fa-icons/sourcehut.svg b/layouts/partials/fa-icons/sourcehut.svg new file mode 100644 index 0000000..81621fe --- /dev/null +++ b/layouts/partials/fa-icons/sourcehut.svg @@ -0,0 +1 @@ + diff --git a/layouts/partials/font-awesome.html b/layouts/partials/font-awesome.html new file mode 100644 index 0000000..55bf1b1 --- /dev/null +++ b/layouts/partials/font-awesome.html @@ -0,0 +1,9 @@ + + +{{ $dict := newScratch }} + +{{ $dict.Set "svg" (partial (print "fa-icons/" .iconName ".svg")) }} + +{{ $dict.Get "svg" | safeHTML }} + + diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..a93d3a3 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,17 @@ +
+ {{ $languagesCount := $.Site.Home.AllTranslations }} + {{ if gt $languagesCount 1 }} + {{ partial "language-switcher.html" . }} + {{ end }} + + +
diff --git a/layouts/partials/head-extra.html b/layouts/partials/head-extra.html deleted file mode 100644 index e3f256f..0000000 --- a/layouts/partials/head-extra.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - -{{ $light := resources.Get "css/highlight.css" }} -{{ $dark := resources.Get "css/highdark.css" }} -{{ $code := slice $light $dark | resources.Concat "css/code.css" | minify | fingerprint }} - diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..be5ae30 --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,31 @@ + + + + + + + + +{{ .Title }} - {{ .Site.Title }} + + +{{ with .OutputFormats.Get "rss" -}} + +{{ end -}} + + + + + + + +{{ $main := resources.Get "css/main.css"}} +{{ $dark := resources.Get "css/dark.css" }} +{{ $light := resources.Get "css/light.css" }} +{{ $syntax_dark := resources.Get "css/syntax-dark.css" }} +{{ $syntax_light := resources.Get "css/syntax-light.css" }} +{{ $style := slice $main $dark $light $syntax_dark $syntax_light | resources.Concat "css/style.css" | minify | fingerprint }} + + +{{ template "_internal/opengraph.html" . }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..f9a00a9 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,13 @@ + +

{{ trim .Title " " }}

+{{ partial "post-language-switcher.html" . }} diff --git a/layouts/partials/language-switcher.html b/layouts/partials/language-switcher.html new file mode 100644 index 0000000..7e2e848 --- /dev/null +++ b/layouts/partials/language-switcher.html @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/layouts/partials/left-sidebar.html b/layouts/partials/left-sidebar.html new file mode 100644 index 0000000..403afc7 --- /dev/null +++ b/layouts/partials/left-sidebar.html @@ -0,0 +1,14 @@ +
+ {{ i18n "sections" }} + +
+{{ if gt (len .TableOfContents) 32 }} +
+ {{ i18n "TOC" }} + {{ .TableOfContents }} +
+{{ end }} diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html new file mode 100644 index 0000000..c561c09 --- /dev/null +++ b/layouts/partials/pagination.html @@ -0,0 +1,16 @@ +{{ if or ( .Paginator.HasPrev ) ( .Paginator.HasNext ) }} + {{ $toNewPostsMessage := i18n "toNewPosts" }} + {{ $toOldPostsMessage := i18n "toOldPosts" }} + +{{ end }} diff --git a/layouts/partials/post-info.html b/layouts/partials/post-info.html new file mode 100644 index 0000000..bb6e3c0 --- /dev/null +++ b/layouts/partials/post-info.html @@ -0,0 +1,28 @@ + diff --git a/layouts/partials/post-language-switcher.html b/layouts/partials/post-language-switcher.html new file mode 100644 index 0000000..162cdf3 --- /dev/null +++ b/layouts/partials/post-language-switcher.html @@ -0,0 +1,16 @@ +{{ if .IsTranslated }} + {{ $pageLang := .Page.Lang}} +
    + {{ range .AllTranslations }} + {{ if eq .Lang $pageLang }} +
  • + {{ upper .Lang }} +
  • + {{ else }} +
  • + {{ upper .Lang }} +
  • + {{ end }} + {{ end }} +
+{{ end }} \ No newline at end of file diff --git a/layouts/partials/post-pagination.html b/layouts/partials/post-pagination.html new file mode 100644 index 0000000..2130181 --- /dev/null +++ b/layouts/partials/post-pagination.html @@ -0,0 +1,16 @@ +{{ if or ( .PrevInSection ) ( .NextInSection ) }} + +{{ end }} + +{{ partial "pagination-extra.html" . }} diff --git a/layouts/partials/post-summary.html b/layouts/partials/post-summary.html new file mode 100644 index 0000000..1396d64 --- /dev/null +++ b/layouts/partials/post-summary.html @@ -0,0 +1,6 @@ +{{ with .Params.date }} +: +{{ end }} +{{ trim .Title " " }} +{{ if .Params.draft }}(draft){{end}} +{{ partial "post-language-switcher.html" . }} diff --git a/layouts/partials/right-sidebar.html b/layouts/partials/right-sidebar.html new file mode 100644 index 0000000..0d3b101 --- /dev/null +++ b/layouts/partials/right-sidebar.html @@ -0,0 +1 @@ +{{ partial "custom-webring.html" }} diff --git a/layouts/partials/single-extra.html b/layouts/partials/single-extra.html deleted file mode 100644 index 0d3b101..0000000 --- a/layouts/partials/single-extra.html +++ /dev/null @@ -1 +0,0 @@ -{{ partial "custom-webring.html" }} diff --git a/layouts/partials/social.html b/layouts/partials/social.html new file mode 100644 index 0000000..2a10cb5 --- /dev/null +++ b/layouts/partials/social.html @@ -0,0 +1,17 @@ + + + {{ range $.Site.Params.Social }} + + + + + {{ end }} + -- cgit 1.4.1