diff options
-rw-r--r-- | archetypes/default.md | 11 | ||||
-rw-r--r-- | layouts/404.html | 0 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 30 | ||||
-rw-r--r-- | layouts/_default/list.html | 26 | ||||
-rw-r--r-- | layouts/_default/single.html | 25 | ||||
-rw-r--r-- | layouts/index.html | 0 | ||||
-rw-r--r-- | layouts/partials/copyright.html | 0 | ||||
-rw-r--r-- | layouts/partials/footer-extra.html | 0 | ||||
-rw-r--r-- | layouts/partials/footer.html | 24 | ||||
-rw-r--r-- | layouts/partials/head.html | 0 | ||||
-rw-r--r-- | layouts/partials/header.html | 0 | ||||
-rw-r--r-- | theme.toml | 19 |
12 files changed, 135 insertions, 0 deletions
diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..d6c9481 --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,11 @@ +<!-- +SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org> + +SPDX-License-Identifier: MIT +--> + ++++ +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true ++++ diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/404.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..d7bff57 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,30 @@ +{{/* +SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org> + +SPDX-License-Identifier: MIT +*/}} + +<!DOCTYPE html> +<html lang="{{ .Page.Language.Lang }}"> +<head> + {{ block "head" . }} + {{ partial "head.html" . }} + {{ end }} +</head> +<body> + <a class="skip-main" href="#main">{{ i18n "skipToContent" | humanize }}</a> + <div class="container"> + <header class="common-header"> + {{ block "header" . }} + {{ partial "header.html" . }} + {{ end }} + </header> + <main id="main" tabindex="-1"> + {{ block "main" . }}{{ end }} + </main> + {{ block "footer" . }} + {{ partial "footer.html" . }} + {{ end }} + </div> +</body> +</html> diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..8a60cb4 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,26 @@ +{{/* +SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org> + +SPDX-License-Identifier: MIT +*/}} + +{{ define "main" }} + <section class="index-content"> + {{ .Content }} + </section> + <section class="toc"> + <h1 class="post-title">{{ i18n .Title }}</h1> + {{ $pages := where .Pages "Type" "in" site.Params.mainSections }} + <ol> + {{ range $pages }} + <li class="post-short-list h-entry"> + <h2 class="p-name post-title{{ if .Params.draft }} draft{{end}}"> + <a class="u-url" href="{{ .RelPermalink }}">{{ trim .Title " " }}</a> + </h2> + {{ partial "post-language-switcher.html" . }} + {{ partial "post-info.html" . }} + </li> + {{ end }} + <li> + </section> +{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..bd91a76 --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,25 @@ +{{/* +SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org> + +SPDX-License-Identifier: MIT +*/}} + +{{ define "main" }} + <article class="post h-entry"> + <header class="post-header"> + <h1 class="p-name post-title{{ if .Params.draft }} draft{{end}}">{{ trim .Title " " }}</h1> + {{ partial "post-language-switcher.html" . }} + </header> + <div class="content e-content"> + {{ .Content }} + </div> + {{ partial "post-info.html" . }} + </article> + + {{ partial "single-extra.html" }} + + {{ if and (.Site.Params.paginationSinglePost) (ne .Type "page") }} + {{ partial "post-pagination.html" . }} + {{ end }} + +{{ end }} diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/index.html diff --git a/layouts/partials/copyright.html b/layouts/partials/copyright.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/partials/copyright.html diff --git a/layouts/partials/footer-extra.html b/layouts/partials/footer-extra.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/partials/footer-extra.html diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..8707172 --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,24 @@ +{{/* +SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org> + +SPDX-License-Identifier: MIT +*/}} + +<footer class="common-footer" id="footer"> + {{ $languagesCount := $.Site.Home.AllTranslations }} + {{ if gt $languagesCount 1 }} + {{ partial "language-switcher.html" . }} + {{ end }} + + <div class="common-footer-bottom"> + <div class="copyright"> + <p>© {{ if isset .Site.Params "author"}}{{ .Site.Params.author }}, {{end}}{{ now.Year }}</p> + <p>{{ partial "copyright.html" . }}</p> + </div> + <div> + {{ partial "footer-extra.html" . }} + </div> + </div> + + {{ partial "h-card.html" . }} +</footer> diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/partials/head.html diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/layouts/partials/header.html diff --git a/theme.toml b/theme.toml new file mode 100644 index 0000000..78ff169 --- /dev/null +++ b/theme.toml @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2022 Ngô Ngọc Đức Huy <huyngo@disroot.org> +# +# SPDX-License-Identifier: MIT + +# theme.toml template for a Hugo theme +# See https://github.com/gohugoio/hugoThemes#themetoml for an example + +name = "Victor" +license = "MIT" +licenselink = "https://git.sr.ht/~huyngo/victor/tree/main/item/LICENSES/MIT.txt" +description = "A simple book theme for hugo" +homepage = "https://git.sr.ht/~huyngo/victor" +tags = ["book", "minimal"] +features = [] +min_version = "0.41.0" + +[author] + name = "Ngô Ngọc Đức Huy" + homepage = "https://xrvs.net" |