added post param to hide date from single post view
This commit is contained in:
parent
35cdd183eb
commit
f9c98de489
|
@ -272,6 +272,7 @@ Every post can have various parameters in the frontmatter, here are some that yo
|
||||||
- `tags`: a list of tags for your post
|
- `tags`: a list of tags for your post
|
||||||
- `image`: a link to a feature image for the article, shown in the preview as well
|
- `image`: a link to a feature image for the article, shown in the preview as well
|
||||||
- `comments`: boolean, if true it enables comments for the current post, if false it disables them (default is true)
|
- `comments`: boolean, if true it enables comments for the current post, if false it disables them (default is true)
|
||||||
|
- `showDate`: boolean, true by default, if false hides the date. Useful for non-article pages where the date isn't important
|
||||||
|
|
||||||
# Does *Ficurinia* mean anything?
|
# Does *Ficurinia* mean anything?
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
{{- partial "inject/content-before.html" . -}}
|
{{- partial "inject/content-before.html" . -}}
|
||||||
<article class="card {{ if .Site.Params.discreteCards }}discrete{{ end }} single">
|
<article class="card {{ if .Site.Params.discreteCards }}discrete{{ end }} single">
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
<p class="date">
|
{{ if (.Params.showDate | default true) }}
|
||||||
<span title="Date"> </span>
|
<p class="date">
|
||||||
{{ .Date.Format "2006-01-02" }}
|
<span title="Date"> </span>
|
||||||
</p>
|
{{ .Date.Format "2006-01-02" }}
|
||||||
|
</p>
|
||||||
|
{{ end }}
|
||||||
{{ if .Params.Image }}
|
{{ if .Params.Image }}
|
||||||
<img src="{{ .Params.Image }}" alt="" />
|
<img src="{{ .Params.Image }}" alt="" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -4,15 +4,15 @@
|
||||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
</h2>
|
</h2>
|
||||||
<p class="date">
|
<p class="date">
|
||||||
<span title="Date"> </span>
|
<span title="Date"> </span>
|
||||||
{{ .Date.Format "2006-01-02" }}
|
{{ .Date.Format "2006-01-02" }}
|
||||||
{{ if and (site.Params.tagsInArticlePreview | default true) .Params.tags }}
|
{{ if and (site.Params.tagsInArticlePreview | default true) .Params.tags }}
|
||||||
| <!-- Pipe character as visual separator between date and tags-->
|
| <!-- Pipe character as visual separator between date and tags-->
|
||||||
<span title="Tags"> </span>
|
<span title="Tags"> </span>
|
||||||
{{ range sort .Params.tags }}
|
{{ range sort .Params.tags }}
|
||||||
<a href="/tags/{{ . | urlize }}">#{{ . }}</a>
|
<a href="/tags/{{ . | urlize }}">#{{ . }}</a>
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
|
||||||
</p>
|
</p>
|
||||||
{{ if .Site.Params.imageInArticlePreview }}
|
{{ if .Site.Params.imageInArticlePreview }}
|
||||||
{{ if .Params.Image }}
|
{{ if .Params.Image }}
|
||||||
|
|
Loading…
Reference in New Issue