]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/Add_space_before_slash_in_parent_links.mdwn
link to timonator's patch
[ikiwiki.git] / doc / todo / Add_space_before_slash_in_parent_links.mdwn
1 This [[patch]] adds a space before the forward-slash in the the parent links. There is already a space after the slash.
2
3 > I intentionally put the space after the slash and not before, because I
4 > like how it looks that way. So I don't plan to apply this patch unless a
5 > lot of people disagree with me or whatever. --[[Joey]]
6
7 >> Couldn't we export what's put between the links to a variable? For instance, I might actually want to set it to ' : ' or '→'. --[[madduck]]
8
9 >>> Yes, please.  This seems to be something a lot of people want to customize.  (I certainly do -- a forward slash only looks natural to Unix users)  --[[sabr]]
10
11 >> Joey, would I be right to summarize your position on this as "people who
12 >> want to change the text of the templates should maintain their own version
13 >> of the `.tmpl` files"? It's not clear to me how this todo item could be
14 >> closed in a way acceptable to you, except perhaps as WONTFIX. --[[smcv]]
15
16 Before:
17
18     ikiwiki/ todo/ Add space before slash in parent links
19
20 After:
21
22     ikiwiki / todo / Add space before slash in parent links
23
24 Patch:
25
26     diff --git a/templates/misc.tmpl b/templates/misc.tmpl
27     index 184920e..80e6d0b 100644
28     --- a/templates/misc.tmpl
29     +++ b/templates/misc.tmpl
30     @@ -15,7 +15,7 @@
31
32      <div class="header">
33      <span>
34     -<TMPL_VAR INDEXLINK>/ <TMPL_VAR TITLE>
35     +<TMPL_VAR INDEXLINK> / <TMPL_VAR TITLE>
36      </span>
37      </div>
38
39     diff --git a/templates/page.tmpl b/templates/page.tmpl
40     index 3a1ac9e..1978e93 100644
41     --- a/templates/page.tmpl
42     +++ b/templates/page.tmpl
43     @@ -17,7 +17,7 @@
44      <div class="header">
45      <span>
46      <TMPL_LOOP NAME="PARENTLINKS">
47     -<a href="<TMPL_VAR NAME=URL>"><TMPL_VAR NAME=PAGE></a>/
48     +<a href="<TMPL_VAR NAME=URL>"><TMPL_VAR NAME=PAGE></a> /
49      </TMPL_LOOP>
50      <TMPL_VAR TITLE>
51      </span>
52     diff --git a/templates/recentchanges.tmpl b/templates/recentchanges.tmpl
53     index e03482f..4877395 100644
54     --- a/templates/recentchanges.tmpl
55     +++ b/templates/recentchanges.tmpl
56     @@ -15,7 +15,7 @@
57
58      <div class="header">
59      <span>
60     -<TMPL_VAR INDEXLINK>/ <TMPL_VAR TITLE>
61     +<TMPL_VAR INDEXLINK> / <TMPL_VAR TITLE>
62      </span>
63      </div>
64
65 ----
66
67 It's almost implicit in some of the discussion above but this can be achieved locally if you fork your templates directory from ikiwiki's, with an ammendment such as
68
69     <h1><TMPL_LOOP NAME="PARENTLINKS"><a
70         href="<TMPL_VAR NAME=URL>"><TMPL_VAR NAME=PAGE></a>
71         &rarr;
72         </TMPL_LOOP><TMPL_VAR TITLE></h1>
73
74 This is what I do on my site for example. -- [[Jon]]
75
76 > You don't actually need to fork the whole directory, "only" `page.tmpl` -
77 > put `templatedir => "/foo/templates"` in your setup file, copy `page.tmpl`
78 > to that directory, and modify it there. IkiWiki will look in `templatedir`
79 > first, then fall back to its default templates if any are missing from
80 > `templatedir`.
81 >
82 > (Admittedly, `page.tmpl` is the hardest to maintain a fork of, because it
83 > tends to change whenever a new plugin is added...) --[[smcv]]