added option to set a page as home; added options to hide title or share button in post
This commit is contained in:
parent
0587cd2803
commit
2b7198b032
4 changed files with 59 additions and 40 deletions
|
|
@ -1,41 +1,3 @@
|
|||
{{ define "main" }}
|
||||
{{- partial "inject/content-before.html" . -}}
|
||||
<article class="card single">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ if (.Params.showDate | default true) }}
|
||||
<p class="date">
|
||||
<span title='{{ i18n "date" }}'> </span>
|
||||
{{- partial "date.html" .Date -}}
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ if .Params.Image }}
|
||||
<img src="{{ .Params.Image }}" alt="" />
|
||||
{{ end }}
|
||||
{{ if (.Params.toc | default false) }}
|
||||
<div class="articleToc">
|
||||
{{ .TableOfContents }}
|
||||
<hr />
|
||||
</div>
|
||||
{{ end }}
|
||||
<div>{{ .Content }}</div>
|
||||
</article>
|
||||
{{ if .Params.tags }}
|
||||
{{ if not .Site.Params.paperCards }}<hr />{{ end }}
|
||||
<p class="articleTagsContainer">
|
||||
<span> </span>
|
||||
<strong>{{ i18n "tagsColumn" }}</strong>
|
||||
{{ range sort .Params.tags }}
|
||||
<a
|
||||
{{ if site.Params.buttonTags | default false }}
|
||||
class="buttonTag"
|
||||
{{ end }}
|
||||
href="/tags/{{ . | urlize }}">#{{ . }}</a>
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
{{- partial "inject/content-after.html" . -}}
|
||||
{{- partial "share_on_fediverse.html" . -}}
|
||||
{{- partial "commento.html" . -}}
|
||||
{{- partial "cactus_chat.html" . -}}
|
||||
{{- partial "related_articles.html" . -}}
|
||||
{{- partial "single_post.html" . -}}
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,12 @@
|
|||
{{ $postsDir := .Site.Params.Posts | default (slice "posts" "post") }}
|
||||
{{ $allPostsList := where (where site.RegularPages "Section" "in" $postsDir) "Section" "!=" "" }}
|
||||
{{- partial "showcase.html" . -}}
|
||||
{{- partial "home_post_list.html" (dict "Ctx" . "AllPostsList" $allPostsList) -}}
|
||||
{{ if and .Site.Params.showSinglePageAsHome (ne .Site.Params.homeSinglePage "") }}
|
||||
{{ with .Site.GetPage .Site.Params.homeSinglePage }}
|
||||
{{- partial "single_post.html" . -}}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{- partial "home_post_list.html" (dict "Ctx" . "AllPostsList" $allPostsList) -}}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
|
|
|||
43
layouts/partials/single_post.html
Normal file
43
layouts/partials/single_post.html
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{{- partial "inject/content-before.html" . -}}
|
||||
<article class="card single">
|
||||
{{ if .Params.showTitle | default true }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ end }}
|
||||
{{ if (.Params.showDate | default true) }}
|
||||
<p class="date">
|
||||
<span title='{{ i18n "date" }}'> </span>
|
||||
{{- partial "date.html" .Date -}}
|
||||
</p>
|
||||
{{ end }}
|
||||
{{ if .Params.Image }}
|
||||
<img src="{{ .Params.Image }}" alt="" />
|
||||
{{ end }}
|
||||
{{ if (.Params.toc | default false) }}
|
||||
<div class="articleToc">
|
||||
{{ .TableOfContents }}
|
||||
<hr />
|
||||
</div>
|
||||
{{ end }}
|
||||
<div>{{ .Content }}</div>
|
||||
</article>
|
||||
{{ if .Params.tags }}
|
||||
{{ if not .Site.Params.paperCards }}<hr />{{ end }}
|
||||
<p class="articleTagsContainer">
|
||||
<span> </span>
|
||||
<strong>{{ i18n "tagsColumn" }}</strong>
|
||||
{{ range sort .Params.tags }}
|
||||
<a
|
||||
{{ if site.Params.buttonTags | default false }}
|
||||
class="buttonTag"
|
||||
{{ end }}
|
||||
href="/tags/{{ . | urlize }}">#{{ . }}</a>
|
||||
{{ end }}
|
||||
</p>
|
||||
{{ end }}
|
||||
{{- partial "inject/content-after.html" . -}}
|
||||
{{ if .Params.showShare | default true }}
|
||||
{{- partial "share_on_fediverse.html" . -}}
|
||||
{{ end }}
|
||||
{{- partial "commento.html" . -}}
|
||||
{{- partial "cactus_chat.html" . -}}
|
||||
{{- partial "related_articles.html" . -}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue