From 890252ec5e659b439165e0d18ca991ef1bfad9ee Mon Sep 17 00:00:00 2001 From: Ngô Ngọc Đức Huy Date: Sat, 3 Dec 2022 19:36:58 +0700 Subject: Add basic layout --- archetypes/default.md | 11 +++++++++++ layouts/404.html | 0 layouts/_default/baseof.html | 30 ++++++++++++++++++++++++++++++ layouts/_default/list.html | 26 ++++++++++++++++++++++++++ layouts/_default/single.html | 25 +++++++++++++++++++++++++ layouts/index.html | 0 layouts/partials/copyright.html | 0 layouts/partials/footer-extra.html | 0 layouts/partials/footer.html | 24 ++++++++++++++++++++++++ layouts/partials/head.html | 0 layouts/partials/header.html | 0 theme.toml | 19 +++++++++++++++++++ 12 files changed, 135 insertions(+) create mode 100644 archetypes/default.md create mode 100644 layouts/404.html create mode 100644 layouts/_default/baseof.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/single.html create mode 100644 layouts/index.html create mode 100644 layouts/partials/copyright.html create mode 100644 layouts/partials/footer-extra.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 theme.toml 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 @@ + + ++++ +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 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 + +SPDX-License-Identifier: MIT +*/}} + + + + + {{ block "head" . }} + {{ partial "head.html" . }} + {{ end }} + + + {{ i18n "skipToContent" | humanize }} +
+
+ {{ block "header" . }} + {{ partial "header.html" . }} + {{ end }} +
+
+ {{ block "main" . }}{{ end }} +
+ {{ block "footer" . }} + {{ partial "footer.html" . }} + {{ end }} +
+ + 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 + +SPDX-License-Identifier: MIT +*/}} + +{{ define "main" }} +
+ {{ .Content }} +
+
+

{{ i18n .Title }}

+ {{ $pages := where .Pages "Type" "in" site.Params.mainSections }} +
    + {{ range $pages }} +
  1. +

    + {{ trim .Title " " }} +

    + {{ partial "post-language-switcher.html" . }} + {{ partial "post-info.html" . }} +
  2. + {{ end }} +
  3. +
+{{ 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 + +SPDX-License-Identifier: MIT +*/}} + +{{ define "main" }} +
+
+

{{ trim .Title " " }}

+ {{ partial "post-language-switcher.html" . }} +
+
+ {{ .Content }} +
+ {{ partial "post-info.html" . }} +
+ + {{ 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 diff --git a/layouts/partials/copyright.html b/layouts/partials/copyright.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/partials/footer-extra.html b/layouts/partials/footer-extra.html new file mode 100644 index 0000000..e69de29 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 + +SPDX-License-Identifier: MIT +*/}} + +
+ {{ $languagesCount := $.Site.Home.AllTranslations }} + {{ if gt $languagesCount 1 }} + {{ partial "language-switcher.html" . }} + {{ end }} + + + + {{ partial "h-card.html" . }} +
diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..e69de29 diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..e69de29 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 +# +# 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" -- cgit 1.4.1