diff options
author | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2024-04-23 01:19:27 +0700 |
---|---|---|
committer | Ngô Ngọc Đức Huy <huyngo@disroot.org> | 2024-04-23 01:19:27 +0700 |
commit | 40f57ed72a601d8489a180f3bd9acd5e6c20d323 (patch) | |
tree | 6dd84fffd42e809f5123333deb8bb1a366a97cfc /layouts/_default | |
parent | 2cff39c15ffb512f87ed5f8a2f71603e9ff2d4c7 (diff) | |
download | blog-40f57ed72a601d8489a180f3bd9acd5e6c20d323.tar.gz |
Update theme
Diffstat (limited to 'layouts/_default')
-rw-r--r-- | layouts/_default/_markup/render-heading.html | 7 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 24 | ||||
-rw-r--r-- | layouts/_default/books.html | 7 | ||||
-rw-r--r-- | layouts/_default/comic.html | 45 | ||||
-rw-r--r-- | layouts/_default/list.html | 22 | ||||
-rw-r--r-- | layouts/_default/list.old.html | 20 | ||||
-rw-r--r-- | layouts/_default/project.html | 68 | ||||
-rw-r--r-- | layouts/_default/rss.xml | 34 | ||||
-rw-r--r-- | layouts/_default/single.html | 22 | ||||
-rw-r--r-- | layouts/_default/taxonomy.html | 12 | ||||
-rw-r--r-- | layouts/_default/terms.html | 19 | ||||
-rw-r--r-- | layouts/_default/wiki.html | 32 |
12 files changed, 140 insertions, 172 deletions
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 }} +<h{{ .Level }} id="{{ $id }}"> + <span class="decorative" aria-hidden="true"></span> + <a class="heading-anchor" href="#{{ $id }}"> + {{ .Text | safeHTML }} + </a> +</h{{ .Level }}> 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 @@ +<!DOCTYPE html> +<html lang="{{ .Page.Language.Lang }}"> +<head> + {{ partial "head.html" . }} +</head> +<body> + <a class="skip-main" href="#main">{{ i18n "skipToContent" | humanize }}</a> + <header class="common-header"> + {{ partial "header.html" . }} + </header> + <div class="container"> + <aside id="left"> + {{ partial "left-sidebar.html" . }} + </aside> + <main id="main" tabindex="-1"> + {{ block "main" . }}{{ end }} + </main> + <aside id="right"> + {{ partial "right-sidebar.html" . }} + </aside> + </div> + {{ partial "footer.html" . }} +</body> +</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 }} -<nav class="post-navigation"> - {{ range .Menus }} - <a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a> - {{ end }} -</nav> -{{ end }} <article class="post h-entry"> <header class="post-header"> 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 }} -<nav class="post-navigation"> - {{ range .Menus }} - <a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a> - {{ end }} -</nav> -{{ end }} - -<article class="post h-entry"> - <header class="post-header"> - <center> - <h1 class="p-name post-title{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " }}</h1> - {{ if in .Params.categories "comics" }} - </center> - {{ end}} - </header> - <section class="content e-content"> - <center> - {{ partial "comicNav.html" . }} - <img title="{{ .Params.TitleText }}" - alt="Comic panels. See transcription below." - src="/comics/{{ .Params.ComicId }}/{{ .Params.ComicTitle }}.png" - srcset="/comics/{{ .Params.ComicId }}/{{ .Params.ComicTitle }}_full.png 2x" - > - {{ partial "comicNav.html" . }} - </center> - <details> - <summary> - Transcription and extras - </summary> - {{ .Content }} - </details> - </section> - {{ partial "post-info.html" . }} -</article> - -{{ 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" }} + <div class="index-content"> + {{ .Content }} + </div> + + {{ if .Params.reversed }} + <ol class="articles h-feed" reversed> + {{ else }} + <ul> + {{ end }} + {{ range .Pages }} + <li> + {{ partial "post-summary.html" . }} + </li> + {{ end }} + {{ if .Params.reversed }} + </ol> + {{ else }} + </ul> + {{ 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" }} - <div class="index-content"> - {{ .Content }} - </div> - - <div class="articles h-feed"> - <h1 class="post-title">{{ i18n .Title }}</h1> - {{ if not .Params.no_feed }} - {{ range .Page.CurrentSection.Pages }} - <div class="post-short-list h-entry"> - <header class="post-header"> - <h2 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}"><a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a></h2> - </header> - {{ partial "post-info.html" . }} - </div> - {{ end }} - {{ end}} - </div> - -{{ 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 }} -<nav class="post-navigation"> - {{ range .Menus }} - <a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a> - {{ end }} -</nav> -{{ end }} - -<article class="post h-entry"> - <header class="post-header"> - <h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " }}</h1> - </header> - <div class="content e-content"> - <h2>Project info</h2> - <dl class="data"> - <dt>Project site</dt> - <dd> - <a href="{{ .Params.projectUrl }}"> - {{ .Params.name }} - </a> - </dd> - {{ if isSet .Params "author" }} - <dt>Creator</dt> - {{ if isSet .Params "authorurl" }} - <dd><a href={{.Params.authorURL}}>{{ .Params.author }}</a></dd> - {{ else }} - <dd>{{ .Params.author }}</dd> - {{ end }} - {{ end }} - {{ if isSet .Params "maintainers" }} - <dt>Maintainers</dt> - {{ range $maintainer := .Params.maintainers }} - {{ if isSet $maintainer "URL" }} - <dd><a href={{$maintainer.URL}}>{{ $maintainer.name }}</a></dd> - {{ else }} - <dd>{{ $maintainer.name }}</dd> - {{ end }} - {{ end }} - {{ end }} - <dt>Status</dt> - <dd>{{ .Params.projectStatus }}</dd> - </dl> - {{ .Content }} - <hr> - {{ if eq .Params.projectStatus "dead" }} - <p> - The project is currently dead. You can fork it if you find it helpful. - </p> - {{ else }} - <p> - The development of project is {{.Params.projectStatus}}. - You can help this project by contributing code, finding new issues, - suggesting new features, or donation. - </p> - {{ end }} - </div> - {{ partial "post-info.html" . }} -</article> - -{{ 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 "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>{{ .Site.Title }}{{ if ne .Title .Site.Title }}{{ with .Title }} ({{.}}){{ end }}{{ end }}</description> + <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }} + <language>{{.}}</language>{{end}}{{ with .Site.Author.email }} + <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }} + <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }} + <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }} + <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} + {{ with .OutputFormats.Get "RSS" }} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{ end }} + {{ range $pages }} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}} + <guid>{{ .Permalink }}</guid> + <description>{{ .Content | html }}</description> + </item> + {{ end }} + </channel> +</rss> 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" }} + <article class="post h-entry"> + {{ .Content }} + {{ partial "post-info.html" . }} + </article> + <hr> + <nav> + {{with .Prev}} + <a class="prev-link" href="{{.Permalink}}" title="{{ .Title }}"> + Previous post + </a> + {{end}} + {{with .Next}} + <a class="next-link float" href="{{.Permalink}}" title="{{ .Title }}"> + Next post + </a> + {{end}} + </nav> + <hr> + Would you like to discuss this post? + <a href="mailto:huyngo@disroot.org?subject=Re: {{ trim .Title " "}}">Email me!</a> +{{ 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" }} + <h1>{{ i18n .Data.Singular | humanize }}: {{ .Title }}</h1> + <div class="post-info"> + <a href="{{ (printf "%s/%s" .Site.LanguagePrefix .Data.Plural) | absLangURL }}">{{ i18n (printf "toAll%s" (.Data.Plural | humanize )) | humanize }}</a> + </div> + <ol reversed> + {{ range .Paginator.Pages }} + <li>{{ partial "post-summary.html" . }}</li> + {{ end }} + </ol> + +{{ 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" }} + <div class="index-content"> + {{ .Content }} + </div> + + <h1>{{ i18n .Title }}</h1> + + <ul class="terms"> + {{ range $key, $value := .Data.Terms }} + <li> + <a href="{{ (print $.Data.Plural "/" (lower $key)) | absLangURL }}"> + {{ $key }} + </a> + ({{ len $value }}) + </li> + {{ end }} + </ul> + +{{ 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 }} -<nav class="post-navigation"> - {{ range .Menus }} - <a href="{{ .URL | absLangURL }}" title="{{ .Title }}">{{ .Name }}</a> - {{ end }} -</nav> -{{ end }} - -<article class="post h-entry"> - <header class="post-header"> - <h1 class="p-name post-title{{ if .Params.favorite }} favorite{{end}}{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " }}</h1> - </header> - <div class="content e-content"> - {{ .Content }} - <hr> - {{ i18n "WikiContribute" }} - <a href="mailto:huyngo+{{ .Params.wiki }}@disroot.org"> - huyngo+{{ .Params.wiki }}@disroot.org - </a> - </div> - {{ partial "post-info.html" . }} -</article> - -{{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }} - {{ partial "paginationPost.html" . }} -{{ end }} - - -{{ partial "custom-webring.html" }} - -{{ end }} |