Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nvfp/ghact_auto_permalink
GitHub action for making blog-like pages' permalink based on Jekyll project structure
https://github.com/nvfp/ghact_auto_permalink
ghaction jekyll
Last synced: 7 days ago
JSON representation
GitHub action for making blog-like pages' permalink based on Jekyll project structure
- Host: GitHub
- URL: https://github.com/nvfp/ghact_auto_permalink
- Owner: nvfp
- License: other
- Created: 2024-01-22T09:33:58.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-01-22T10:33:53.000Z (11 months ago)
- Last Synced: 2024-01-22T13:15:16.461Z (11 months ago)
- Topics: ghaction, jekyll
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Make your blog-like pages' permalink automatically written during the build, which means we just need to specify the URL in the directory project structure, and the permalink will be based on that, which saves time!
The project structure should look like this:
```txt
root/
- foo/
- bar/
- 2020/
- 01-01-title_1/
- index.md
- img.jpg
- ...
- 01-01-title_2/
- index.md
- ...
- 2021/
- ...
```Let's say this is a blog project, so each post has its own folder, `root/foo/bar/2020/01-01-title_1/` for example (let's call this "container"). So each post should have `index.md`, which contains the blog content itself. Inside each container, it can also contain images or anything needed for that specific post. Also, they will be grouped by years, so things are more maintainable for a long period project.
Now let's open one of the containers:
```markdown
---
# permalink: # leave this empty because it will be written during the build process... # the rest of the file
```So, we just need to specify the commented `permalink` at line `2`, then during the build, we will be using:
```yml
- uses: nvfp/[email protected] # using the latest version OR main-branch is recommended
with:
where: ./foo/bar # "bar" is the "root" for the blog-like pages
prefix: /blog/ # to make it "/blog/title_1", "/blog/title_2", etc.
```Note: Please open the `action.yml` to learn more about the params.
And that's it!