Socket
Socket
Sign inDemoInstall

github-pages-tags

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-pages-tags

A package to generate tags pages to github pages website


Version published
Weekly downloads
4
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

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 define the tag page title and the description by creating a file github-pages-tags.config.js and set its content

module.exports = {
  title: '{{tag}}}',
  description: 'Here are all the posts that related to {{tag}}'
}

{{tag}} will be replaced by the actuall tag. These are the default values of these properties, if you will skip this step.

Keywords

FAQs

Package last updated on 22 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc