aboutsummaryrefslogtreecommitdiff
path: root/layouts/partials
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-12-15 03:56:47 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-12-15 03:56:47 +0300
commita9168e6f04f766f7d88bc1b24aaa81336098b2fc (patch)
treea4db599140020cfb14803aa4d28b17d52e637a72 /layouts/partials
parent3b040f1503d90a309f41063d8f760a3e312ab351 (diff)
Auto-commit 2024-12-15
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/comments.html11
-rw-r--r--layouts/partials/footer.html29
-rw-r--r--layouts/partials/head.html5
-rw-r--r--layouts/partials/head/css.html11
-rw-r--r--layouts/partials/head/js.html5
-rw-r--r--layouts/partials/header.html18
-rw-r--r--layouts/partials/hmenu.html47
-rw-r--r--layouts/partials/list.html51
-rw-r--r--layouts/partials/pagination.html2
-rw-r--r--layouts/partials/single/footer.html12
-rw-r--r--layouts/partials/single/header.html15
-rw-r--r--layouts/partials/walk.html29
12 files changed, 120 insertions, 115 deletions
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html
index 77b4410..f23437f 100644
--- a/layouts/partials/comments.html
+++ b/layouts/partials/comments.html
@@ -1,8 +1,6 @@
{{- with .Site.Params.comments -}}
-<article class="comments">
- <header>Комментарии</header>
- <div id="remark42"></div>
-</article>
+<h1 class="post-title fw-semibold">Комментарии</h1>
+<div id="remark42"></div>
<script>
var remark_config = {
host: '{{ .host }}',
@@ -10,7 +8,7 @@
components: ['embed'],
url: '{{ $.Permalink }}',
max_shown_comments: {{ default 15 .max_shown_comments }},
- theme: (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches)?'dark':'light',
+ theme: 'light',
page_title: '{{ $.Title }}',
locale: '{{ default "en" .locale }}',
show_email_subscription: {{ default true .show_email_subscription }}
@@ -25,8 +23,5 @@
}
}(remark_config.components || ['embed'], document);
- window.addEventListener('onColorSchemeChange', (e) => {
- window.REMARK42.changeTheme(e.detail);
- })
</script>
{{- end -}} \ No newline at end of file
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 226a448..1917788 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,12 +1,17 @@
-<nav>
- <ul>
- <li>
- <cite>2007—{{ now.Year }} Александр NeonXP Кирюхин. г.Казань</cite>
- </li>
- </ul>
- <ul>
- <li><a href="https://git.neonxp.ru/blog.git">Исходный код</a></li>
- <li><a href="mailto:i@neonxp.ru" rel="me">Электропочта</a></li>
- <li><a href="https://neonxp.ru/posts/index.xml">РСС</a></li>
- </ul>
-</nav>
+<footer class="bd-footer py-4 py-md-5 mt-5 bg-body-tertiary">
+ <div class="container">
+ <div class="row">
+ <div class="col">
+ <cite>2007—{{ now.Year }} Александр NeonXP Кирюхин. г.Казань</cite>
+ </div>
+ <div class="col">
+ <ul class="list-unstyled float-end">
+ <li><a href="https://git.neonxp.ru/blog.git">Исходный код</a></li>
+ <li><a href="mailto:i@neonxp.ru" rel="me">Электропочта</a></li>
+ <li><a href="https://neonxp.ru/posts/index.xml">РСС</a></li>
+ </ul>
+ </div>
+ </div>
+ </div>
+</footer>
+{{ partialCached "head/js.html" . }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 5cd3afc..c0ee0a8 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -5,9 +5,8 @@
<meta name="go-source" content="neonxp.ru/go/{{ .Params.Name }} {{ .Params.Repository }} {{ .Params.Repository }}/tree/{/dir} {{ .Params.Repository }}/tree/master{/dir}/{file}#n{line}">
{{end}}
<link rel="icon" type="image/png" href="/favicon.png">
-<link rel="authorization_endpoint" href="https://indieauth.com/auth">
+<!-- <link rel="authorization_endpoint" href="https://indieauth.com/auth">
<link rel="token_endpoint" href="https://tokens.indieauth.com/token">
-<link rel="micropub" href="https://neonxp.ru/micropub">
+<link rel="micropub" href="https://neonxp.ru/micropub"> -->
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
{{ partialCached "head/css.html" . }}
-{{ partialCached "head/js.html" . }}
diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html
index c0dc59e..a9fbbeb 100644
--- a/layouts/partials/head/css.html
+++ b/layouts/partials/head/css.html
@@ -1,13 +1,4 @@
-{{- with resources.Get "css/pico.min.css" }}
- {{- if eq hugo.Environment "development" }}
- <link rel="stylesheet" href="{{ .RelPermalink }}">
- {{- else }}
- {{- with . | minify | fingerprint }}
- <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
- {{- end }}
- {{- end }}
-{{- end }}
-{{- with resources.Get "css/flexboxgrid.min.css" }}
+{{- with resources.Get "css/bootstrap.min.css" }}
{{- if eq hugo.Environment "development" }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
{{- else }}
diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html
index 7e1c81d..f4dc60e 100644
--- a/layouts/partials/head/js.html
+++ b/layouts/partials/head/js.html
@@ -10,7 +10,4 @@
{{- end }}
{{- end }}
{{- end }}
-<script type="module">
- import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
- mermaid.initialize({ startOnLoad: true });
-</script> \ No newline at end of file
+<script src="/js/bootstrap.bundle.min.js"></script> \ No newline at end of file
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index c9b4934..e477a29 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,8 +1,12 @@
-<nav>
- <ul>
- <li>
- <a href="/"><img class="logo" src="{{ .Site.Params.Logo }}" /><strong>{{ .Site.Title }}</strong></a>
- </li>
- </ul>
- {{ partial "hmenu.html" (dict "menuID" "main" "page" .) }}
+<nav class="navbar navbar-expand-lg bg-dark" data-bs-theme="dark">
+ <div class="container">
+ <a class="navbar-brand" href="/">{{ .Site.Title }}</a>
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
+ {{ partial "hmenu.html" (dict "menuID" "main" "page" .) }}
+ </div>
+ </div>
</nav>
+</ul> \ No newline at end of file
diff --git a/layouts/partials/hmenu.html b/layouts/partials/hmenu.html
index 7183180..89e70db 100644
--- a/layouts/partials/hmenu.html
+++ b/layouts/partials/hmenu.html
@@ -1,51 +1,8 @@
-{{- /*
-Renders a menu for the given menu ID.
-
-@context {page} page The current page.
-@context {string} menuID The menu ID.
-
-@example: {{ partial "menu.html" (dict "menuID" "main" "page" .) }}
-*/}}
-
{{- $page := .page }}
{{- $menuID := .menuID }}
{{- with index site.Menus $menuID }}
- <nav>
- <ul>
- {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ <ul class="navbar-nav me-auto mb-2 mb-lg-0">
+ {{- partial "walk.html" (dict "page" $page "menuEntries" .) }}
</ul>
- </nav>
-{{- end }}
-
-{{- define "partials/inline/menu/walk.html" }}
- {{- $page := .page }}
- {{- range .menuEntries }}
- {{- $attrs := dict "href" .URL }}
- {{- if $page.IsMenuCurrent .Menu . }}
- {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
- {{- else if $page.HasMenuCurrent .Menu .}}
- {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
- {{- end }}
- {{- $name := .Name }}
- {{- with .Identifier }}
- {{- with T . }}
- {{- $name = . }}
- {{- end }}
- {{- end }}
- <li>
- <a
- {{- range $k, $v := $attrs }}
- {{- with $v }}
- {{- printf " %s=%q" $k $v | safeHTMLAttr }}
- {{- end }}
- {{- end -}}
- >{{ $name }}</a>
- {{- with .Children }}
- <ul>
- {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
- </ul>
- {{- end }}
- </li>
- {{- end }}
{{- end }}
diff --git a/layouts/partials/list.html b/layouts/partials/list.html
index cd62507..920f9c5 100644
--- a/layouts/partials/list.html
+++ b/layouts/partials/list.html
@@ -1,26 +1,27 @@
-<article>
- <header>
- <div class="row between-xs">
- <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
- {{ if .Date }}
- <span>
- {{- .Date | time.Format (or .Site.Params.dateFormat.published "02 Jan 2006") -}}
- </span>
- {{ end }}
- </div>
- </header>
- {{ if .Params.Image }}
- <img src="{{ .RelPermalink }}{{.Params.Image}}" />
+<div class="post">
+ <h1 class="post-title fw-semibold"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h1>
+ {{ if .Date }}
+ <div class="d-flex align-items-center mb-4 text-muted">
+ <span class="d-flex align-items-center ms-3" title="{{- .Date | time.Format (or .Site.Params.dateFormat.published "02 Jan 2006") -}}">
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="me-2" viewBox="0 0 16 16">
+ <path d="M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z"></path>
+ <path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z"></path>
+ </svg>
+ {{- .Date | time.Format (or .Site.Params.dateFormat.published "02 Jan 2006") -}}
+ </span>
+ </div>
+ {{ end }}
+ {{ if .Params.Image }}
+ <img class="d-block img-fluid mb-2 rounded border shadow" max-width="800" loading="lazy" src="{{ .RelPermalink }}{{.Params.Image}}" />
+ {{ end }}
+ {{ if .Description }}
+ {{ .Description }}
+ {{ else }}
+ {{ .Summary }}
+ {{ if .Truncated }}
+ <div><a href="{{ .RelPermalink }}">Далее...</a></div>
{{ end }}
- {{ if .Description }}
- {{ .Description }}
- {{ else }}
- {{ .Summary }}
- {{ if .Truncated }}
- <a href="{{ .RelPermalink }}">Далее...</a>
- {{ end }}
- {{ end }}
- <footer>
- {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
- </footer>
-</article> \ No newline at end of file
+ {{ end }}
+
+ {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
+</div> \ No newline at end of file
diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html
index ee7a171..f30e72c 100644
--- a/layouts/partials/pagination.html
+++ b/layouts/partials/pagination.html
@@ -64,7 +64,7 @@
{{- range $k := seq $start $end }}
{{- if eq $.Paginator.PageNumber $k }}
<li class="page-item active">
- [{{ $k }}]
+ <a href="{{ (index $.Paginator.Pagers (sub $k 1)).URL }}" aria-label="Page {{ $k }}" class="page-link">{{ $k }}</a>
</li>
{{- else }}
<li class="page-item">
diff --git a/layouts/partials/single/footer.html b/layouts/partials/single/footer.html
new file mode 100644
index 0000000..5c53001
--- /dev/null
+++ b/layouts/partials/single/footer.html
@@ -0,0 +1,12 @@
+<footer>
+ <div class="row between-xs">
+ <span>
+ {{ partial "terms.html" (dict "taxonomy" "tags" "page" .) }}
+ </span>
+
+ {{ if .Params.Location }}
+ <span class="p-location">@ {{.Params.Location}}</span>
+ {{ end }}
+ </div>
+</footer>
+{{ if .Params.comments }} {{ partial "comments.html" . }} {{ end }}
diff --git a/layouts/partials/single/header.html b/layouts/partials/single/header.html
new file mode 100644
index 0000000..7b40390
--- /dev/null
+++ b/layouts/partials/single/header.html
@@ -0,0 +1,15 @@
+<h1 class="post-title fw-semibold"><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h1>
+{{ if .Date }}
+ <div class="d-flex align-items-center mb-4 text-muted">
+ <span class="d-flex align-items-center ms-3" title="{{- .Date | time.Format (or .Site.Params.dateFormat.published "02 Jan 2006") -}}">
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="me-2" viewBox="0 0 16 16">
+ <path d="M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5z"></path>
+ <path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5M1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4z"></path>
+ </svg>
+ {{- .Date | time.Format (or .Site.Params.dateFormat.published "02 Jan 2006") -}}
+ </span>
+ </div>
+{{ end }}
+{{ if .Params.Image }}
+ <img class="d-block img-fluid mb-2 rounded border shadow" max-width="800" loading="lazy" src="{{ .RelPermalink }}{{.Params.Image}}" />
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/walk.html b/layouts/partials/walk.html
new file mode 100644
index 0000000..e115d6f
--- /dev/null
+++ b/layouts/partials/walk.html
@@ -0,0 +1,29 @@
+{{- $page := .page }}
+{{- range .menuEntries }}
+ {{- $attrs := dict "href" .URL }}
+ {{- if $page.IsMenuCurrent .Menu . }}
+ {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }}
+ {{- else if $page.HasMenuCurrent .Menu .}}
+ {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
+ {{- end }}
+ {{- $name := .Name }}
+ {{- with .Identifier }}
+ {{- with T . }}
+ {{- $name = . }}
+ {{- end }}
+ {{- end }}
+ <li class="nav-item {{if .Children}}dropdown{{end}}">
+ <a
+ {{if .Children}}
+ class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false"
+ {{ else }}
+ class="nav-link" href="{{.URL}}"
+ {{ end }}
+ >{{ $name }}</a>
+ {{- with .Children }}
+ <ul class="dropdown-menu">
+ {{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
+ </ul>
+ {{- end }}
+ </li>
+{{- end }} \ No newline at end of file