mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 10:21:46 +01:00
refactor: change default article layout
Post layout become exclusive for `post` section (with toolbar) Page layout become the default layout (without toolbar)
This commit is contained in:
parent
294f445e0a
commit
45e7e07a86
3 changed files with 24 additions and 24 deletions
|
@ -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 }}
|
|
@ -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 }}
|
21
layouts/post/single.html
Normal file
21
layouts/post/single.html
Normal file
|
@ -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 }}
|
Loading…
Reference in a new issue