Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hendrixjoseph/jekyll-tag-page-generator-action

Generates tag pages for Jekyll Blogs.
https://github.com/hendrixjoseph/jekyll-tag-page-generator-action

activity blog blogging github-pages jekyll jekyll-blog jekyll-blogs tag-page tag-page-generator tag-pages

Last synced: about 2 months ago
JSON representation

Generates tag pages for Jekyll Blogs.

Awesome Lists containing this project

README

        

# Tag Page Generator for Jekyll Blogs

## How to use

1. Install the [prerequisite files](https://github.com/hendrixjoseph/jekyll-tag-page-generator-action/tree/master/prerequisites) into your Jekyll blog.
2. Add the [sample workflow](sample-workflow.yml) to your Jekyll blog directory.

## Options

| Option | Default Value | Description | Required |
|--------|--------|--------|--------|
| source | n/a | the url of the generated tags.json | true |
| destination | n/a | Relative path to write tag pages | true |

## Sample workflow

```yml
name: Generate the set of tag pages.
on:
workflow_dispatch:

jobs:
generate-tag-pages:
name: Generate the set of tag pages.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hendrixjoseph/jekyll-tag-page-generator-action@master
with:
source: "https://www.joehxblog.com/data/tags.json"
destination: "./tags/"
```

## Prerequisites

### tags.json template

```
---
---

{% assign tags = site.tags | sort %}
{"tags":[{% for tag in tags %}
{"name":"{{ tag[0] }}","slug":"{{ tag[0] | slugify }}","postcount":{{ tag[1] | size }}}{% unless forloop.last %},{% endunless %}{% endfor %}]}
```

### ./layouts/tag_posts.html

```html
---
layout: default
---


{% for post in site.tags[page.tag] %}


{{ post.title }}





{{ post.date | date: "%B %e, %Y" }}
{% assign tags = post.tags | sort %}{% for tag in tags %}{{ tag }}{% unless forloop.last %}|{% endunless %}{% endfor %}




{{ post.excerpt }}

{% endfor %}

```