summaryrefslogtreecommitdiff
path: root/doc/todo/capitalize_title.mdwn
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-09-18 12:58:41 -0400
committerJoey Hess <joey@kitenet.net>2010-09-18 12:58:41 -0400
commit4843ec6dd09f4d88fa05ce178abe9cc1fb52b3e7 (patch)
treee1ce67c690d8ae2e7fcdfe160906d9f716bab216 /doc/todo/capitalize_title.mdwn
parent96a8ea0ebbd93a8cc56222234d4a5815b30a3934 (diff)
parent65c5e24d364f491ace462beb06e2e3adb721b1e0 (diff)
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
Diffstat (limited to 'doc/todo/capitalize_title.mdwn')
-rw-r--r--doc/todo/capitalize_title.mdwn31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/todo/capitalize_title.mdwn b/doc/todo/capitalize_title.mdwn
new file mode 100644
index 000000000..3e8366dd3
--- /dev/null
+++ b/doc/todo/capitalize_title.mdwn
@@ -0,0 +1,31 @@
+Here I propose an option (with a [[patch]]) to capitalize the first letter (ucfirst) of default titles : filenames and urls can be lowercase but title are displayed with a capital first character (filename = "foo.mdwn", pagetitle = "Foo"). Note that \[[!meta title]] are unaffected (no automatic capitalization). Comments please :) --[[JeanPrivat]]
+<pre><code>
+diff --git a/IkiWiki.pm b/IkiWiki.pm
+index 6da2819..fd36ec4 100644
+--- a/IkiWiki.pm
++++ b/IkiWiki.pm
+@@ -281,6 +281,13 @@ sub getsetup () {
+ safe => 0,
+ rebuild => 1,
+ },
++ capitalize => {
++ type => "boolean",
++ default => undef,
++ description => "capitalize the first letter of page titles",
++ safe => 1,
++ rebuild => 1,
++ },
+ userdir => {
+ type => "string",
+ default => "",
+@@ -989,6 +996,10 @@ sub pagetitle ($;$) {
+ $page=~s/(__(\d+)__|_)/$1 eq '_' ? ' ' : "&#$2;"/eg;
+ }
+
++ if ($config{capitalize}) {
++ $page = ucfirst $page;
++ }
++
+ return $page;
+ }
+</code></pre>