article: Add a way to suppress the date
This is handly if an article is just an overview page or a list of subpages.
This commit is contained in:
@@ -99,6 +99,14 @@ katex = true
|
|||||||
+++
|
+++
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Suppress date in an article
|
||||||
|
Hide the date from an article, e.g. because it's just an index:
|
||||||
|
```
|
||||||
|
+++
|
||||||
|
omitDate = true
|
||||||
|
+++
|
||||||
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
1. Fork it!
|
1. Fork it!
|
||||||
|
|||||||
@@ -6,9 +6,11 @@
|
|||||||
</header>
|
</header>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<div class="article-meta">
|
<div class="article-meta">
|
||||||
|
{{- if not .Params.omitDate }}
|
||||||
<a href="{{ .RelPermalink }}" class="article-date">
|
<a href="{{ .RelPermalink }}" class="article-date">
|
||||||
<time datetime='{{ .Date.Format "2006-01-02T15:04:05.000-07:00" }}' itemprop="datePublished">{{ .Date.Format "2006-01-02" }}</time>
|
<time datetime='{{ .Date.Format "2006-01-02T15:04:05.000-07:00" }}' itemprop="datePublished">{{ .Date.Format "2006-01-02" }}</time>
|
||||||
</a>
|
</a>
|
||||||
|
{{ end -}}
|
||||||
{{ $Site := .Site }}
|
{{ $Site := .Site }}
|
||||||
{{ if .Params.categories }}
|
{{ if .Params.categories }}
|
||||||
<div class="post-categories">
|
<div class="post-categories">
|
||||||
|
|||||||
Reference in New Issue
Block a user