colinta / StrangeCase

It's yet another static site generator. Have you seen jekyll? hyde? Yup. Like those.
http://colinta.com/projects/StrangeCase.html
Other
49 stars 7 forks source link

Allow extensions that extract data from the filename to cleanup the filename #13

Closed wichert closed 12 years ago

wichert commented 12 years ago

Several components in strangecase use the filename to provide data: initial digits to define an order, a date to set created_at. Essentially this is a mechanism to configure metadata in the filename. There is one downside to this approach: it exposes what are essentially internal details to the outside world via URLs. To fix that I propose to add an option to remove metadata from filenames as it is parsed. I can not image a situation where this flag should be different for piece of metadata than for others, so this should be a single flag.

I would suggest to manage this via a configuration option called strip-metadata-from-filename.

colinta commented 12 years ago

other than changing the name to strip_metadata_from_target_name, it's a go!

colinta commented 12 years ago

strip_metadata_from_target_name (default: False) and strip_metadata_from_name (default: True) are done.

It would be worth looking at configurator_created_at_from_name.py to see how this works. The new configurator stuff is cool, I think, but just a hint of voodoo.