From a3b4aaf9aeafacc8a37feb247059705df1f935d2 Mon Sep 17 00:00:00 2001 From: PratikshaJain37 Date: Thu, 18 Jun 2020 01:00:35 +0530 Subject: [PATCH] Feature: Added Tags Hyperlinked tags are added to enable easier finding of similar posts. --- _includes/tags.html | 6 +++ _layouts/post.html | 2 + assets/custom/scss/_tags.scss | 8 ++++ assets/custom/scss/custom.scss | 1 + tag/index.html | 70 ++++++++++++++++++++++++++++++++++ 5 files changed, 87 insertions(+) create mode 100644 _includes/tags.html create mode 100644 assets/custom/scss/_tags.scss create mode 100644 tag/index.html diff --git a/_includes/tags.html b/_includes/tags.html new file mode 100644 index 0000000..89529b4 --- /dev/null +++ b/_includes/tags.html @@ -0,0 +1,6 @@ +{% for tag in page.tags %} + {% if tag != 'home' %} + {% capture tag_name %}{{ tag }}{% endcapture %} + {{ tag_name }} + {% endif %} +{% endfor %} diff --git a/_layouts/post.html b/_layouts/post.html index cf83781..f558d21 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -410,6 +410,8 @@

{{ author_details.name }}

{{ content }} + {% include tags.html %} +
{% include social-share.html %} diff --git a/assets/custom/scss/_tags.scss b/assets/custom/scss/_tags.scss new file mode 100644 index 0000000..c272bfa --- /dev/null +++ b/assets/custom/scss/_tags.scss @@ -0,0 +1,8 @@ +// for tags + +.badge { + color: dimgrey; + padding: 10px; + font-family: "Courier New", Courier, monospace; + background-color: #e7e7e7; +} diff --git a/assets/custom/scss/custom.scss b/assets/custom/scss/custom.scss index 2c91276..0f8b10f 100644 --- a/assets/custom/scss/custom.scss +++ b/assets/custom/scss/custom.scss @@ -2,3 +2,4 @@ @import "social-share.scss"; @import "markdown.scss"; @import "pygments.scss"; +@import "tags.scss"; diff --git a/tag/index.html b/tag/index.html new file mode 100644 index 0000000..78c8b52 --- /dev/null +++ b/tag/index.html @@ -0,0 +1,70 @@ +--- +layout: page +title: Tags +background: '/img/bg-post.jpg' +--- +{% capture tags %} + {% for tag in site.tags %} + {{ tag[0] }} + {% endfor %} +{% endcapture %} +{% assign sortedtags = tags | split:' ' | sort %} + +{% for tag in sortedtags %} + {% if tag != 'home' %} + {{ tag }} + {% endif %} +{% endfor %} +

+ +{% for tag in sortedtags %} + {% if tag != 'home' %} +

{{ tag }}

+ + + {% endif %} +{% endfor %}