Makes titlecase of page/post titles configurable

This commit is contained in:
Frederic Hemberger 2011-10-16 11:57:29 +02:00
parent 4b87a2fb7d
commit d98a4de07e
3 changed files with 5 additions and 3 deletions

View File

@ -1,9 +1,9 @@
{% unless page.no_header %} {% unless page.no_header %}
<header> <header>
{% if index %} {% if index %}
<h1 class="entry-title"><a href="{{ root_url }}{{ post.url }}">{{ post.title | titlecase }}</a></h1> <h1 class="entry-title"><a href="{{ root_url }}{{ post.url }}">{% if site.titlecase %}{{ post.title | titlecase }}{% else %}{{ post.title }}{% endif %}</a></h1>
{% else %} {% else %}
<h1 class="entry-title">{{ page.title | titlecase }}</h1> <h1 class="entry-title">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</h1>
{% endif %} {% endif %}
{% unless page.meta == false %} {% unless page.meta == false %}
<p class="meta"> <p class="meta">

View File

@ -6,7 +6,7 @@ layout: default
<article role="article"> <article role="article">
{% if page.title %} {% if page.title %}
<header> <header>
<h1 class="entry-title">{{ page.title | titlecase }}</h1> <h1 class="entry-title">{% if site.titlecase %}{{ page.title | titlecase }}{% else %}{{ page.title }}{% endif %}</h1>
{% if page.date %}<p class="meta">{% include post/date.html %}{{ time }}</p>{% endif %} {% if page.date %}<p class="meta">{% include post/date.html %}{{ time }}</p>{% endif %}
</header> </header>
{% endif %} {% endif %}

View File

@ -34,6 +34,8 @@ pagination_dir: blog # Directory base for pagination URLs eg. /blog/page/2/
recent_posts: 5 # Posts in the sidebar Recent Posts section recent_posts: 5 # Posts in the sidebar Recent Posts section
excerpt_link: "Read on &rarr;" # "Continue reading" link text at the bottom of excerpted articles excerpt_link: "Read on &rarr;" # "Continue reading" link text at the bottom of excerpted articles
titlecase: true # Converts page and post titles to tilecase
# list each of the sidebar modules you want to include, in the order you want them to appear. # list each of the sidebar modules you want to include, in the order you want them to appear.
# To add custom asides, create files in /source/_includes/custom/asides/ and add them to the list like 'custom/asides/custom_aside_name.html' # To add custom asides, create files in /source/_includes/custom/asides/ and add them to the list like 'custom/asides/custom_aside_name.html'
default_asides: [asides/recent_posts.html, asides/github.html, asides/twitter.html, asides/delicious.html, asides/pinboard.html] default_asides: [asides/recent_posts.html, asides/github.html, asides/twitter.html, asides/delicious.html, asides/pinboard.html]