From 70a7d382996ecdfdcfc93b5a0300f6393029e3d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20G=2E=20Stan?= Date: Wed, 8 Oct 2014 12:31:00 +0300 Subject: [PATCH] Fix title capitalization The `capitalize` filter in Liquid templates does not work on arrays. It first converts arrays to string, and then capitalizes. The `map` filter wouldn't work either, because it only maps properties. Solution based on: http://stackoverflow.com/a/21829139/58808 --- _config.yml | 2 +- _includes/header.txt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/_config.yml b/_config.yml index cba1fe8e67..d8c2bb59bd 100644 --- a/_config.yml +++ b/_config.yml @@ -1,7 +1,7 @@ markdown: kramdown title: "Scala Documentation" -description: "Documentation for the Scala programming language- Tutorials, Overviews, Cheatsheets, and more." +description: "Documentation for the Scala programming language - Tutorials, Overviews, Cheatsheets, and more." keywords: - Scala - Documentation diff --git a/_includes/header.txt b/_includes/header.txt index b8f659677b..4a6a0c9f47 100644 --- a/_includes/header.txt +++ b/_includes/header.txt @@ -1,8 +1,7 @@ - - {% if page.partof %}{{ page.partof | replace: '-',' ' | capitalize }} - {% endif %}{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }} + {% if page.partof %}{% assign words = page.partof | split: '-' %}{% for word in words %}{{ word | capitalize }} {% endfor %}- {% endif %}{% if page.title %}{{ page.title }} - {% endif %}{{ site.title }} {% if page.description %} {% endif %}