1.2.1 • Published 5 years ago

github-pages-tags v1.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

https://nodei.co/npm/github-pages-tags.png?downloads=true&downloadRank=true&stars=true

HitCount contributions welcome

Introduction

You are display tags list on each post in your github pages website and this is good. But, usually, you want that those tags will be links to a tag page which will display all the posts which contains the tag, right? The problem is that jekyll is a static "language" so you have to generate each page as static file. Will you do this manually? I don't think so.

How it works?

After the package have been installed, this package modify the package.json and add to it a postcommit script. This script is reading all the tags in the site and generate a .md file for each of them under /tags folder.

Installation

Step 1

npm install github-pages-tags --save

Step 2

create a tag.html in layout folder which will be the tag template. This file should looks like:

---
layout: default
---

<h1>`{{ page.title }}` posts</h1>

<div class="view">
  {% for post in site.posts %}
    {% if post.tags contains page.title %}
      {% include post-item.html post=post last=forloop.last %}
    {% endif %}
  {% endfor %}
</div>

Step 3 (optinal)

You can custom the plugin behavior by creating github-pages-tags.config.js github-pages-tags.config.json.

Here are the options:

{
  // tag page title
  "title": "{{tag}}}",
  // tag page meta description
  "description": "Here are all the posts that related to {{tag}}",
  // generate only tag who have more than `minPostCount` posts. See link below:
  "minPostCount": 0
}

Notes

  • {{tag}} will be replaced by the actuall tag name.
  • minPostCount - (Why is good?)
1.2.1

5 years ago

1.2.0

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago