add spec dependency
[ikiwiki] / doc / bugs / Titles_are_lower-cased_when_creating_a_page.mdwn
1 When you click on a broken link to create a new page, Ikiwiki lower-cases the new page's filename.  I wish it wouldn't.
2
3 If I click on "Czars in Russia", I'd like Ikiwiki to create "Czars\_in\_Russia.mdwn", not "czars\_in\_russia.mdwn".  Is this possible?  --[[sabr]]
4
5 > There's a simple patch that can do this:
6
7 <pre>
8 -- a/IkiWiki.pm
9 +++ b/IkiWiki.pm
10 @@ -584,7 +584,7 @@ sub htmllink ($$$;@) {
11                         return "&lt;span class=\"createlink\">&lt;a href=\"".
12                                 cgiurl(
13                                         do => "create",
14 -                                       page => pagetitle(lc($link), 1),
15 +                                       page => pagetitle($link, 1),
16                                         from => $lpage
17                                 ).
18                                 "\">?&lt;/a>$linktext&lt;/span>"
19 </pre>
20
21 > This is fine if you don't mind mixed or randomly cased filenames getting
22 > created. Otoh, if the link happened to start a sentence and so had its
23 > first letter upper-cased, that might not be desired.
24
25 > Of course ikiwiki's case insensative, and there are other ways
26 > of creating pages that don't lower case them, including using the create
27 > a page form on a blog (as was done for this page..).
28
29 > I'm undecided about making the above change by default though, or about making
30 > it a config option. Maybe it would be better to include both capitalisations
31 > in the select list that is used to pick the name for the newly created page.
32 > Then, which one is the default wouldn't much matter. (The non-lower cased
33 > one would probably be the best choice.) --[[Joey]]
34 >> Either of your proposed solutions (make it the default or include both in the pop-up menu) sounds fine to me.  Which one is easier? :) --[[sabr]]
35
36 >>> [[Done]]; it now defaults to the mixed case title and provides
37 >>> the lower-case one as an option in the select box. --[[Joey]]