diff --git a/pelicanconf.py b/pelicanconf.py index e4d834b..64a0ad1 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -79,5 +79,6 @@ import filters JINJA_FILTERS = { "datetime": filters.format_datetime, "category_find": filters.category_find, - "limit": filters.limit + "limit": filters.limit, + "format_title": filters.format_title } diff --git a/plugins/filters.py b/plugins/filters.py index a778c89..3abfac0 100644 --- a/plugins/filters.py +++ b/plugins/filters.py @@ -16,3 +16,8 @@ def limit(line, length): if len(line) <= length: return line return " ".join(line.split(" ")[:length]) + '...' + + +def format_title(value): + space_split = " ".join(value.split("-")) + return space_split.title() diff --git a/theme/templates/category.html b/theme/templates/category.html index 0846d74..3acc878 100644 --- a/theme/templates/category.html +++ b/theme/templates/category.html @@ -15,7 +15,7 @@
-

{{ category.name|title }}

+

{{ category.name|format_title }}