format titles better
This commit is contained in:
parent
2d1f480b21
commit
16bc830b19
3 changed files with 8 additions and 2 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Reference in a new issue