diff options
author | Keichi Takahashi <keichi.t@me.com> | 2017-11-26 08:30:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-26 08:30:53 +0300 |
commit | f050f5829f4f839494f4e71e1ceec20090bd97de (patch) | |
tree | 3ad4de69819ce0d3f1d99df08484eb19b3fb3475 | |
parent | 0fb20ea3f6df18a463e515d3f631bdd4e60e948e (diff) | |
parent | 0c617168d82a1883f1e274cec5b5ee631957042e (diff) |
Merge pull request #28 from jolexa/no-date
Add a feature to not show the date on posts/pages
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | layouts/_default/single.html | 3 |
2 files changed, 10 insertions, 0 deletions
@@ -66,6 +66,13 @@ copyright = "© Copyright notice" themecolor = "#hexcolor" # Defines the tab color in Chrome for Android. ``` +You may specify following options in `front matter` of your posts to make use of +this theme's features. + +```toml +noshowdate = true # This will ensure that the date is not printed +``` + ## Usage Use hugo's `-t vienna` or `--theme=vienna` option with hugo commands. diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 67f023c..bf5edd9 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,12 +4,15 @@ <header> <h1 class="text-primary">{{ .Title }}</h1> <div class="post-meta clearfix"> + {{ if (isset .Params "noshowdate") }} + {{ else }} <div class="post-date pull-left"> Posted on <time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" | safeHTML }}"> {{ .Date.Format "Jan 2, 2006" }} </time> </div> + {{ end }} <div class="pull-right"> {{ range .Params.tags }} <span class="post-tag small"><a href="{{ $baseurl }}/tags/{{ . | urlize }}">#{{ . }}</a></span> |