1
Fork 0

format titles better

This commit is contained in:
Jake Howard 2016-07-01 09:18:55 +01:00
parent 2d1f480b21
commit 16bc830b19
Signed by: jake
GPG key ID: 57AFB45680EDD477
3 changed files with 8 additions and 2 deletions

View file

@ -79,5 +79,6 @@ import filters
JINJA_FILTERS = { JINJA_FILTERS = {
"datetime": filters.format_datetime, "datetime": filters.format_datetime,
"category_find": filters.category_find, "category_find": filters.category_find,
"limit": filters.limit "limit": filters.limit,
"format_title": filters.format_title
} }

View file

@ -16,3 +16,8 @@ def limit(line, length):
if len(line) <= length: if len(line) <= length:
return line return line
return " ".join(line.split(" ")[:length]) + '...' return " ".join(line.split(" ")[:length]) + '...'
def format_title(value):
space_split = " ".join(value.split("-"))
return space_split.title()

View file

@ -15,7 +15,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-lg-8 col-lg-offset-2 text-center"> <div class="col-lg-8 col-lg-offset-2 text-center">
<h1 class="section-heading">{{ category.name|title }}</h1> <h1 class="section-heading">{{ category.name|format_title }}</h1>
<hr class="light"> <hr class="light">
</div> </div>
</div> </div>