nielsenramon / chalk

Chalk is a high quality, completely customizable, performant and 100% free Jekyll blog theme.
http://chalk.nielsenramon.com
MIT License
1.23k stars 442 forks source link

Feature/automate tags #182

Open jmarca opened 6 years ago

jmarca commented 6 years ago

This patch set automates populating the _my_tags/.md files.

The work is done by a shell script. Basically, it looks at the _posts/YYYY-MM-DD-..., greps for tags, then makes a unique list of them, and creates new entries as needed in the directory _my_tags/

I also added it to the npm run scripts. On my end, I also have a javascript "watch" program that watches for changes to _posts and re-runs the script, but that seems overkill for this theme...typical usage will be write a new post, then build the site, which will automatically run my shell script before running the bundle exec jekyll serve --drafts and bin/deploy scripts.

Also, I hacked up a test using another shell script, in tests/test_automatic_tags.sh. Which I'm glad I did as I had forgotten to filter for YYYY-MM-DD-post type files in _posts.

I also added the test to the .travis.yml file. The build results pass on travis: https://travis-ci.org/jmarca/chalk/builds/434295568

I have not modified the readme or the default post to change language about adding entries to the _my_tags directory.

Hope this is useful.