Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Cai <jimmehcai@gmail.com>2020-09-13 11:59:52 +0300
committerJimmy Cai <jimmehcai@gmail.com>2020-09-13 11:59:52 +0300
commit45e7e07a867a7497fd493161311ba838b96d1917 (patch)
treea3cdb151cd3a1034000f890e562615ec11a0afce
parent294f445e0a0bac1355a4a7bd5c56977982a82f93 (diff)
refactor: change default article layout
Post layout become exclusive for `post` section (with toolbar) Page layout become the default layout (without toolbar)
-rw-r--r--layouts/_default/single.html15
-rw-r--r--layouts/page/single.html12
-rw-r--r--layouts/post/single.html21
3 files changed, 24 insertions, 24 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index aabeee7..edf53fb 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,21 +1,12 @@
-{{ define "container-class" }}article-page with-toolbar{{ end }}
+{{ define "body-class" }}article-page keep-sidebar{{ end }}
{{ define "main" }}
- <div id="article-toolbar">
- <a href="{{ .Site.BaseURL }}" class="back-home">
- {{ (resources.Get "icons/back.svg").Content | safeHTML }}
- <span>Back</span>
- </a>
- </div>
-
{{ partial "article/article.html" . }}
- {{ partial "article/components/related-contents" . }}
-
- {{ if or (not (isset .Params "comments")) (eq .Params.comments "true")}}
+ {{ if or (not (isset .Params "comments")) (eq .Params.comments "true")}}
{{ partial "comments/include" . }}
{{ end }}
{{ partialCached "footer/footer" . }}
- {{- partial "article/components/photoswipe.html" . -}}
+ {{ partial "article/components/photoswipe" . }}
{{ end }} \ No newline at end of file
diff --git a/layouts/page/single.html b/layouts/page/single.html
deleted file mode 100644
index edf53fb..0000000
--- a/layouts/page/single.html
+++ /dev/null
@@ -1,12 +0,0 @@
-{{ define "body-class" }}article-page keep-sidebar{{ end }}
-{{ define "main" }}
- {{ partial "article/article.html" . }}
-
- {{ if or (not (isset .Params "comments")) (eq .Params.comments "true")}}
- {{ partial "comments/include" . }}
- {{ end }}
-
- {{ partialCached "footer/footer" . }}
-
- {{ partial "article/components/photoswipe" . }}
-{{ end }} \ No newline at end of file
diff --git a/layouts/post/single.html b/layouts/post/single.html
new file mode 100644
index 0000000..aabeee7
--- /dev/null
+++ b/layouts/post/single.html
@@ -0,0 +1,21 @@
+{{ define "container-class" }}article-page with-toolbar{{ end }}
+{{ define "main" }}
+ <div id="article-toolbar">
+ <a href="{{ .Site.BaseURL }}" class="back-home">
+ {{ (resources.Get "icons/back.svg").Content | safeHTML }}
+ <span>Back</span>
+ </a>
+ </div>
+
+ {{ partial "article/article.html" . }}
+
+ {{ partial "article/components/related-contents" . }}
+
+ {{ if or (not (isset .Params "comments")) (eq .Params.comments "true")}}
+ {{ partial "comments/include" . }}
+ {{ end }}
+
+ {{ partialCached "footer/footer" . }}
+
+ {{- partial "article/components/photoswipe.html" . -}}
+{{ end }} \ No newline at end of file