From b26b41933237bc40259b6e4751a9ffb26a3551c0 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Sun, 23 Aug 2020 16:59:23 +0100 Subject: [PATCH] Added tag page --- default.hbs | 13 ++-------- page-tag.hbs | 56 +++++++++++++++++++++++++++++++++++++++++++ partials/header.hbs | 11 +++++++++ partials/sidebar.hbs | 2 +- partials/tag-card.hbs | 18 ++++++++++++++ post.hbs | 27 +++++++++++++++++---- 6 files changed, 111 insertions(+), 16 deletions(-) create mode 100644 page-tag.hbs create mode 100644 partials/header.hbs create mode 100644 partials/tag-card.hbs diff --git a/default.hbs b/default.hbs index 7bd9528..1330823 100644 --- a/default.hbs +++ b/default.hbs @@ -50,17 +50,8 @@
{{!-- Header --}} - + {{> "header"}} + {{!-- All the main content gets inserted here, index.hbs, post.hbs, etc --}} {{{body}}} diff --git a/page-tag.hbs b/page-tag.hbs new file mode 100644 index 0000000..fcd415e --- /dev/null +++ b/page-tag.hbs @@ -0,0 +1,56 @@ +{{!< default}} +{{!-- The tag above means - insert everything in this file into the {body} of the default.hbs template --}} + +{{!-- The big featured header, it uses blog cover image as a BG if available --}} +{{#post}} + +
+ + +
+

{{title}}

+
+ + {{#if feature_image}} +
{{title}}
+ {{/if}} + +
+ {{#get 'tags' limit='all' include='count.posts' order='count.posts desc'}} + {{#foreach tags}} + {{!-- The tag below includes the markup for each tag - partials/tag-card.hbs --}} + {{> "tag-card"}} + {{/foreach}} + {{/get}} +
+ +
+ + + +{{!-- The main content area --}} +{{!-- +
+ +
+
+ {{#get 'tags' limit='all' include='count.posts' order='count.posts desc'}} + {{#foreach tags}} + {{> "tag-card"}} + {{/foreach}} + {{/get}} +
+
+
+--}} +{{/post}} diff --git a/partials/header.hbs b/partials/header.hbs new file mode 100644 index 0000000..42b950e --- /dev/null +++ b/partials/header.hbs @@ -0,0 +1,11 @@ + diff --git a/partials/sidebar.hbs b/partials/sidebar.hbs index b975148..11ad208 100644 --- a/partials/sidebar.hbs +++ b/partials/sidebar.hbs @@ -3,7 +3,7 @@ {{!-- Nav - partials/navigation.hbs --}} {{#if @site.navigation}} - {{navigation}} + {{navigation type="primary"}} {{/if}} {{!-- Recent posts --}} diff --git a/partials/tag-card.hbs b/partials/tag-card.hbs new file mode 100644 index 0000000..5ccfca8 --- /dev/null +++ b/partials/tag-card.hbs @@ -0,0 +1,18 @@ + diff --git a/post.hbs b/post.hbs index a045271..7ab3c18 100644 --- a/post.hbs +++ b/post.hbs @@ -7,8 +7,9 @@ into the {body} of the default.hbs template --}}
- {{date format="MMMM D, YYYY"}} + {{date format="D MMMM YYYY"}} {{tags separator=" , " prefix=" ; tagged in: "}}

{{title}}

+ {{#if custom_excerpt}}

{{custom_excerpt}}

{{/if}} @@ -54,11 +55,29 @@ into the {body} of the default.hbs template --}} - {{!--
- If you want to embed comments, this is a good place to do it! + {{!-- If you want to embed comments, this is a good place to do it! --}} +
+ +
- --}}
{{/post}} -- 2.34.1