Implemention of Python titlecase for the Pelican static blogging system.
Titlecase.pl was originally created by John Gruber from Daring Fireball
This plugin / jinja filter will convert any text into "Title Case" format. It doesn't simply uppercase each letter of a word, but instead contains logic for proper formatting, when to uppercase, articles, URL's. For more information, refer to the Daring Fireball article on Title Case.
An example (an article title)
Pre-Title Case:
Apple profit falls 22% but beats gloomy expectations
Post-Title Case:
Apple Profit Falls 22% but Beats Gloomy Expectations
-
Clone this repository into where you normally keep your pelican plugins
-
Install the required pip module (titlecase):
pip install -r requirements.txt
-
Modify your
pelicanconf.py
file, and update thePLUGINS
setting to includepelican-titlecase
:PLUGINS = ["pelican-titlecase"]
Anywhere in your theme's templates, invoke the filter as follows:
`{{ article.title | titlecase }}`
This will titlecase all your article titles