Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/hendrixjoseph/jekyll-tag-page-generator-action
- Owner: hendrixjoseph
- Created: 2020-08-21T01:52:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-21T17:05:05.000Z (over 4 years ago)
- Last Synced: 2024-03-15T03:33:51.734Z (11 months ago)
- Topics: activity, blog, blogging, github-pages, jekyll, jekyll-blog, jekyll-blogs, tag-page, tag-page-generator, tag-pages
- Language: JavaScript
- Homepage: https://www.joehxblog.com/github-actions-tag-page-generator-for-jekyll-blogs/
- Size: 71.3 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 %}
```