Skip to content

Feature/automate tags#182

Open
jmarca wants to merge 6 commits intonielsenramon:masterfrom
jmarca:feature/automate_tags
Open

Feature/automate tags#182
jmarca wants to merge 6 commits intonielsenramon:masterfrom
jmarca:feature/automate_tags

Conversation

@jmarca
Copy link

@jmarca jmarca commented Sep 27, 2018

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.

added a new bash script to inspect posts and generate appropriate
entries in _my_tags/<tag>.md

should respect the settings for "_my_tags" in config.yml, but it
doesn't at this time...just hard coded to _my_tags

tag_scraper will not modify existing files...what if the user decides
to change the "slug"...I don't want to clobber that.

tag_scraper will not delete files that are no longer
needed...deletion needs to be a manual thing.

integrated tag_scraper into the package.json so that it runs on `npm
run local` and `npm run publish`
Looking at the Jekyll Ruby, would be nice to just use the Ruby libs,
but instead, keeping only files that start with "YYYY-MM-DD-" pattern,
and that *do not* end with ~.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant