From afd602128dfca6e02eabf83f62ba05945c4ad481 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC?= Date: Mon, 17 Jun 2024 18:41:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B5?= =?UTF-8?q?=D1=87=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 4 +- layouts/_default/index.html | 66 +++++++++++++++++++++++++++++++ layouts/_default/list.html | 56 ++++++++++++++++++++++++++ layouts/_default/term.html | 57 ++++++++++++++++++++++++++ layouts/partials/footer.html | 27 +++++++++++++ layouts/partials/mobile-menu.html | 20 ++++++++++ 6 files changed, 228 insertions(+), 2 deletions(-) create mode 100644 layouts/_default/index.html create mode 100644 layouts/_default/list.html create mode 100644 layouts/_default/term.html create mode 100644 layouts/partials/footer.html create mode 100644 layouts/partials/mobile-menu.html diff --git a/config.toml b/config.toml index 8acce04..6ea3420 100755 --- a/config.toml +++ b/config.toml @@ -1,5 +1,5 @@ baseurl = "/" -# languageCode = "ru-ru" +languageCode = "ru-ru" theme = "hugo-theme-terminal" paginate = 5 DefaultContentLanguage = "ru" @@ -48,7 +48,7 @@ DefaultContentLanguage = "ru" favicon = "/img/favicon.svg" # Provide a string as a prefix for the last update date. By default, it looks like this: 2020-xx-xx [Updated: 2020-xx-xx] :: Author - # updatedDatePrefix = "Обновлено/updated" + # updatedDatePrefix = "Обновлено" # set all headings to their default size (depending on browser settings) oneHeadingSize = false # default diff --git a/layouts/_default/index.html b/layouts/_default/index.html new file mode 100644 index 0000000..9cce932 --- /dev/null +++ b/layouts/_default/index.html @@ -0,0 +1,66 @@ +{{ define "main" }} + {{ if .Content }} +
+ {{ .Content }} +
+ {{ end }} +
+ {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }} + {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }} + + {{ $PageContext := . }} + {{ if .IsHome }} + {{ $PageContext = .Site }} + {{ end }} + {{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }} + + {{ range $paginator.Pages }} +
+

+ {{ .Title | markdownify }} +

+ + + + {{ if .Params.tags }} + + {{ end }} + + {{ partial "cover.html" . }} + +
+ {{ if .Params.showFullContent }} + {{ .Content }} + {{ else if .Description }} + {{ .Description | markdownify }} + {{ else }} + {{ .Summary }} + {{ end }} +
+ + {{ if not .Params.showFullContent }} +
+ {{ $.Site.Params.ReadMore }} → +
+ {{ end }} +
+ {{ end }} + + {{ partial "pagination.html" . }} +
+{{ end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html new file mode 100644 index 0000000..cce3295 --- /dev/null +++ b/layouts/_default/list.html @@ -0,0 +1,56 @@ +{{ define "main" }} + {{ with .Content }} +
+ {{ . }} +
+ {{ end }} +
+ {{ range .Paginator.Pages }} +
+

+ {{ .Title | markdownify }} +

+ + + {{ if .Params.tags }} + + {{ end }} + + {{ partial "cover.html" . }} + +
+ {{ if .Params.showFullContent }} + {{ .Content }} + {{ else if .Description }} + {{ .Description | markdownify }} + {{ else }} + {{ .Summary }} + {{ end }} +
+ + {{ if not .Params.showFullContent }} +
+ {{ $.Site.Params.ReadMore }} → +
+ {{ end }} +
+ {{ end }} + + {{ partial "pagination.html" . }} +
+{{ end }} diff --git a/layouts/_default/term.html b/layouts/_default/term.html new file mode 100644 index 0000000..f339207 --- /dev/null +++ b/layouts/_default/term.html @@ -0,0 +1,57 @@ +{{ define "main" }} +

Posts for: #{{ .Title }}

+ {{ with .Content }} +
+ {{ . }} +
+ {{ end }} +
+ {{ range .Paginator.Pages }} +
+

+ {{ .Title | markdownify }} +

+ + + {{ if .Params.tags }} + + {{ end }} + + {{ partial "cover.html" . }} + +
+ {{ if .Params.showFullContent }} + {{ .Content }} + {{ else if .Description }} + {{ .Description | markdownify }} + {{ else }} + {{ .Summary }} + {{ end }} +
+ + {{ if not .Params.showFullContent }} +
+ {{ $.Site.Params.ReadMore }} → +
+ {{ end }} +
+ {{ end }} + + {{ partial "pagination.html" . }} +
+{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..e6b751f --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,27 @@ + + + {{ $menu := resources.Get "js/menu.js" | js.Build }} + {{ $prism := resources.Get "js/prism.js" | js.Build }} + + {{ $bundle := slice $menu $prism | resources.Concat "bundle.js" | resources.Minify }} + + + + + {{ partial "extended_footer.html" . }} + + diff --git a/layouts/partials/mobile-menu.html b/layouts/partials/mobile-menu.html new file mode 100644 index 0000000..0ec8f33 --- /dev/null +++ b/layouts/partials/mobile-menu.html @@ -0,0 +1,20 @@ +