From 45e7e07a867a7497fd493161311ba838b96d1917 Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Sun, 13 Sep 2020 10:59:52 +0200 Subject: [PATCH] refactor: change default article layout Post layout become exclusive for `post` section (with toolbar) Page layout become the default layout (without toolbar) --- layouts/_default/single.html | 15 +++------------ layouts/page/single.html | 12 ------------ layouts/post/single.html | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 layouts/page/single.html create mode 100644 layouts/post/single.html 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" }} -
- - {{ (resources.Get "icons/back.svg").Content | safeHTML }} - Back - -
- {{ 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" }} +
+ + {{ (resources.Get "icons/back.svg").Content | safeHTML }} + Back + +
+ + {{ 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