]> sipb.mit.edu Git - ikiwiki.git/blob - doc/forum/Render_more_than_one_dest_page_from_same_source_page.mdwn
Merge branch 'master' of ssh://git.ikiwiki.info
[ikiwiki.git] / doc / forum / Render_more_than_one_dest_page_from_same_source_page.mdwn
1 Is it possible to render more than one destination page from the same source page?
2 That is, same source, slightly different presentation at the other end, needing a different output file.
3
4 > It's possible to render more than one output _file_ from a given source
5 > page. See, for example, the inline plugin's generation of rss files.
6 > This is done by calling `will_render()` and using `writefile()` to
7 > generate the additional files. Probably in a format hook if you want
8 > to generate html files.
9
10 >> Thanks for the tip, I'll take a look at that. -- [[KathrynAndersen]]
11  
12 > It's not possible for one source file to represent multiple wiki pages.
13 > There is a 1:1 mapping between source filenames and page names. The
14 > difference between wiki pages and output files is that you can use
15 > wikilinks to link to wiki pages, etc. --[[Joey]] 
16
17 I have two problems that would be solved by being able to do this.
18
19 [[!toc startlevel=2]]
20
21 ##"full" and "print" versions of a page.
22
23 One has a page "foo", which is rendered into foo.html.
24 One also wants a foo-print.html page, which uses "page-print.tmpl" rather than "page.tmpl" as its template.
25
26 I want to do this for every page on the site, automatically, so it isn't feasible to do it by hand.
27
28 > Did you know that ikiwiki's `style.css` arranges for pages to display
29 > differently when printed out? Things like the Action bar are hidden in
30 > printouts (search for `@media print`). So I don't see a reason to need
31 > whole files for printing when you can use these style sheet tricks.
32 > --[[Joey]] 
33
34 >>Fair enough. --[[KathrynAndersen]]
35
36 ##"en" and "en-us" versions of a page.
37
38 My site is in non-US English.  However, I want US-English people to find my site when they search for it when they use US spelling on certain search terms (such as "optimise" versus "optimize").  This requires a (crude) US-English version of the site where the spellings are changed automatically, and the LANG is "en-us" rather than "en".  (No, don't tell me to use keywords; Google ignores keywords and has for a number of years).
39
40 So I want the page "foo" to render to "foo.en.html" and "foo.en-us.html" where the content is the same, just some automated word-substitution applied before foo.en-us.html is written.  And do this for every page on the site.
41
42 I can't do this with the "po" plugin, as it considers "en-us" not to be a valid language.  And the "po" plugin is probably overkill for what I want anyway.
43
44 But I'm not sure how to achieve the result I need.
45
46 -- [[KathrynAndersen]]
47
48 > Sounds like this could be considered a single page that generates two
49 > html files, so could be handled per above. --[[Joey]] 
50
51 >>Thanks! --[[KathrynAndersen]]