From 432ffd8f21025ea9350983eea6ee38d0f2d64167 Mon Sep 17 00:00:00 2001 From: Eric Bouchut Date: Sat, 14 Jan 2017 19:56:05 +0100 Subject: [PATCH 1/5] Issue #106: Add showDate param Setting showDate to false in a page front matter prevents the date from being displayed --- layouts/partials/post/meta.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layouts/partials/post/meta.html b/layouts/partials/post/meta.html index 4dcd5ef5..634ebbef 100644 --- a/layouts/partials/post/meta.html +++ b/layouts/partials/post/meta.html @@ -1,6 +1,8 @@
- + {{ if not (eq .Params.showDate false) }} + + {{ end }} {{ partial "post/category.html" . }}
From 45bcfca52fa769538b45a3d0abc96bfaf0b8a52d Mon Sep 17 00:00:00 2001 From: Eric Bouchut Date: Sat, 14 Jan 2017 19:57:23 +0100 Subject: [PATCH 2/5] Issue #106: Add a page archetype The front matter is pre-populated to hide the date, tags, categories, social buttons and comments section. --- archetypes/page.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 archetypes/page.md diff --git a/archetypes/page.md b/archetypes/page.md new file mode 100644 index 00000000..9d90a0c1 --- /dev/null +++ b/archetypes/page.md @@ -0,0 +1,18 @@ +--- +title: "New Page" +categories: +- category +- subcategory +tags: +- tag1 +- tag2 +keywords: +- tech +comments: false +showDate: false +showSocial: false +showTags: false +showPagination: false +#thumbnailImage: //example.com/image.jpg +--- + From 4ebe2b0852f1463d8d0de4714ccecb89e5baccc7 Mon Sep 17 00:00:00 2001 From: Eric Bouchut Date: Sun, 15 Jan 2017 14:33:34 +0100 Subject: [PATCH 3/5] Issue #106: Add documentation for showDate --- docs/user.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/user.md b/docs/user.md index bf424201..aa7a5502 100644 --- a/docs/user.md +++ b/docs/user.md @@ -482,6 +482,7 @@ comments: false showTags: true showPagination: true showSocial: true +showDate: true ``` |Variable|Description| @@ -499,6 +500,7 @@ showSocial: true |coverMeta|`in`: display post meta (title, date and categories) on cover image, `out`: display meta (title, date and categories) under cover image as usual. Default behavior : `in`| |gallery|Images displayed in an image gallery (with fancybox) at the end of the post. If thumbnail image is not configured and cover image too, the first photo is used as thumbnail image. format: `original url [thumbnail url] [caption]`, E.g : `https://example.com/original.jpg https://example.com/thumbnail.jpg "New York"`| |comments|Disable the comment of the post. +|showDate|`true`: Show the date when `true` (default)| |showTags|`true`: show tags of this page. Default behavior: `true` |showPagination|`true`: show pagination. Default behavior: `true` |showSocial|`true`: show social button such as share on Twitter, Facebook... Default behavior: `true` From 511cd27ef994763cf885adbce48a2fde7d5409fe Mon Sep 17 00:00:00 2001 From: Eric Bouchut Date: Sun, 15 Jan 2017 21:33:36 +0100 Subject: [PATCH 4/5] Feature #106: Add documentation for page archetype --- docs/user.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/docs/user.md b/docs/user.md index aa7a5502..6975c163 100644 --- a/docs/user.md +++ b/docs/user.md @@ -47,6 +47,7 @@ If you want to report a bug or ask a question, [create an issue](https://github. * [Tabbed code block](#tabbed-code-block) * [Wide image](#wide-image) * [Fancybox](#fancybox) +- [Writing pages](#writing-pages) - [Running](#running) ## General @@ -662,6 +663,48 @@ E.g: |src|Path to the original image.| |title (optional)|Title of image displayed in a caption under image. `Alt` HTML attribute will use this title. E.g : `"A beautiful sunrise"`.| + +## Writing pages ## + +Sometimes you need to create a **page** that is **not** a **regular blog post**, +where you want to hide the date, social sharing buttons, tags, categories +and pagination. +This is the case for the blog pages _About_ or _Contact_ for instance which do +not need to be timestamped (nor tagged or categorized) nor provide +pagination and are not intended to be shared on social networks. + +In order to create such a page you can proceed like so: + +``` +hugo new page/contact.md +``` + +This creates the file `contact.md` in the directory `content/page` +pre-populated with the following front matter. + +```yaml +--- +title: "New Page" +categories: +- category +- subcategory +tags: +- tag1 +- tag2 +keywords: +- tech +comments: false +showDate: false +showSocial: false +showTags: false +showPagination: false +#thumbnailImage: //example.com/image.jpg +--- + +``` + +The rest is basically the same as for a regular _[post](#writing-post)_. + ## Running ## Run `hugo server` and start writing! :) From 2816301b08f29ca9bd3fbb9e0ad39a257024e5d1 Mon Sep 17 00:00:00 2001 From: Eric Bouchut Date: Sun, 15 Jan 2017 21:51:32 +0100 Subject: [PATCH 5/5] Fix typo in back link to "writing posts" --- docs/user.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user.md b/docs/user.md index 6975c163..11008201 100644 --- a/docs/user.md +++ b/docs/user.md @@ -703,7 +703,7 @@ showPagination: false ``` -The rest is basically the same as for a regular _[post](#writing-post)_. +The rest is basically the same as for a regular _[post](#writing-posts)_. ## Running ##