Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/carsonip/hugo-theme-minos.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorv1ne <v1ne2go@gmail.com>2019-11-20 00:15:49 +0300
committerCarson Ip <carsonip@users.noreply.github.com>2019-11-29 18:04:51 +0300
commit32e4690938851684558768be6b3b68911f327536 (patch)
treef67ddaf53cc7b3ae0f3c2a802a7c17801b25441e
parent95686c0326844bcd333cf0c209059e7360308ec9 (diff)
article: Add a way to suppress the date
This is handly if an article is just an overview page or a list of subpages.
-rw-r--r--README.md8
-rw-r--r--layouts/partials/article.html2
2 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index f19f6af..90e53d1 100644
--- a/README.md
+++ b/README.md
@@ -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
1. Fork it!
diff --git a/layouts/partials/article.html b/layouts/partials/article.html
index 57ca6a0..d69fd3a 100644
--- a/layouts/partials/article.html
+++ b/layouts/partials/article.html
@@ -6,9 +6,11 @@
</header>
{{ end }}
<div class="article-meta">
+ {{- if not .Params.omitDate }}
<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>
</a>
+ {{ end -}}
{{ $Site := .Site }}
{{ if .Params.categories }}
<div class="post-categories">