From 59ba938822ba0752e8d97e769c0d14f2eb0bbeb3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 2 Apr 2010 16:54:06 -0400 Subject: template: Search for templates in the templatedir, if they are not found as pages in the wiki. --- doc/templates.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/templates.mdwn') diff --git a/doc/templates.mdwn b/doc/templates.mdwn index eff0e15e9..07531ae98 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -43,6 +43,12 @@ page will provide a link that can be used to create the template. The template is a regular wiki page, located in the `templates/` subdirectory inside the source directory of the wiki. +(Alternatively, templates can be stored in a directory outside the wiki, +as files with the extension ".tmpl". +By default, these are searched for in `/usr/share/ikiwiki/templates`; +the `templatedir` setting can be used to make another directory be searched +first.) + The template uses the syntax used by the [[!cpan HTML::Template]] perl module, which allows for some fairly complex things to be done. Consult its documentation for the full syntax, but all you really need to know are a -- cgit v1.2.3 From 83703d2f4a8832155e3c111792489062ccc4793b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 15:32:39 -0400 Subject: move template documentation to the template directive allow new templates to be created via the inline that lists them --- doc/ikiwiki/directive/template.mdwn | 71 ++++++++++++++++++++++++++++++-- doc/templates.mdwn | 82 ++----------------------------------- 2 files changed, 71 insertions(+), 82 deletions(-) (limited to 'doc/templates.mdwn') diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index d538b69b1..ae71ba5b5 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -5,14 +5,79 @@ wiki, by using the template directive. The directive has an `id` parameter that identifies the template to use. The remaining parameters are used to fill out the template. -Example: +## Example \[[!template id=note text="""Here is the text to insert into my note."""]] This fills out the `note` template, filling in the `text` field with the specified value, and inserts the result into the page. -For a list of available templates, and details about how to create more, -see the [[templates]] page. +## Using a template + +Generally, a value can include any markup that would be allowed in the wiki +page outside the template. Triple-quoting the value even allows quotes to +be included in it. Combined with multi-line quoted values, this allows for +large chunks of marked up text to be embedded into a template: + + \[[!template id=foo name="Sally" color="green" age=8 notes=""" + * \[[Charley]]'s sister. + * "I want to be an astronaut when I grow up." + * Really 8 and a half. + """]] + +## Creating a template + +The template is a regular wiki page, located in the `templates/` +subdirectory inside the source directory of the wiki. + +(Alternatively, templates can be stored in a directory outside the wiki, +as files with the extension ".tmpl". +By default, these are searched for in `/usr/share/ikiwiki/templates`; +the `templatedir` setting can be used to make another directory be searched +first.) + +The template uses the syntax used by the [[!cpan HTML::Template]] perl +module, which allows for some fairly complex things to be done. Consult its +documentation for the full syntax, but all you really need to know are a +few things: + +* Each parameter you pass to the template directive will generate a + template variable. There are also some pre-defined variables like PAGE + and BASENAME. +* To insert the value of a variable, use ``. Wiki markup + in the value will first be converted to html. +* To insert the raw value of a variable, with wiki markup not yet converted + to html, use ``. +* To make a block of text conditional on a variable being set use + `text`. +* To use one block of text if a variable is set and a second if it's not, + use `textother text` + +Here's a sample template: + + + Name: \[[]]
+ Age:
+ + Favorite color:
+ + No favorite color.
+
+ +
+ +
+
+ +The filled out template will be formatted the same as the rest of the page +that contains it, so you can include WikiLinks and all other forms of wiki +markup in the template. Note though that such WikiLinks will not show up as +backlinks to the page that uses the template. + +Note the use of "raw_name" inside the [[ikiwiki/WikiLink]] generator in the +example above. This ensures that if the name contains something that might +be mistaken for wiki markup, it's not converted to html before being +processed as a [[ikiwiki/WikiLink]]. + [[!meta robots="noindex, follow"]] diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 07531ae98..f2b581d2f 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -9,85 +9,9 @@ wiki. [[!if test="enabled(template) and enabled(inline)" then=""" -These templates are available for inclusion onto other pages in this -wiki: +These templates are available for use with the template directive. [[!inline pages="templates/* and !*/discussion" feeds=no archive=yes -sort=title template=titlepage]] +sort=title template=titlepage +rootpage=templates postformtext="Add a new template named:"]] """]] - -## Using a template - -Using a template works like this: - - \[[!template id=note text="""Here is the text to insert into my note."""]] - -This fills out the [[note]] template, filling in the `text` field with -the specified value, and inserts the result into the page. - -Generally, a value can include any markup that would be allowed in the wiki -page outside the template. Triple-quoting the value even allows quotes to -be included in it. Combined with multi-line quoted values, this allows for -large chunks of marked up text to be embedded into a template: - - \[[!template id=foo name="Sally" color="green" age=8 notes=""" - * \[[Charley]]'s sister. - * "I want to be an astronaut when I grow up." - * Really 8 and a half. - """]] - -## Creating a template - -To create a template, simply add a template directive to a page, and the -page will provide a link that can be used to create the template. The template -is a regular wiki page, located in the `templates/` subdirectory inside -the source directory of the wiki. - -(Alternatively, templates can be stored in a directory outside the wiki, -as files with the extension ".tmpl". -By default, these are searched for in `/usr/share/ikiwiki/templates`; -the `templatedir` setting can be used to make another directory be searched -first.) - -The template uses the syntax used by the [[!cpan HTML::Template]] perl -module, which allows for some fairly complex things to be done. Consult its -documentation for the full syntax, but all you really need to know are a -few things: - -* Each parameter you pass to the template directive will generate a - template variable. There are also some pre-defined variables like PAGE - and BASENAME. -* To insert the value of a variable, use ``. Wiki markup - in the value will first be converted to html. -* To insert the raw value of a variable, with wiki markup not yet converted - to html, use ``. -* To make a block of text conditional on a variable being set use - `text`. -* To use one block of text if a variable is set and a second if it's not, - use `textother text` - -Here's a sample template: - - - Name: \[[]]
- Age:
- - Favorite color:
- - No favorite color.
-
- -
- -
-
- -The filled out template will be formatted the same as the rest of the page -that contains it, so you can include WikiLinks and all other forms of wiki -markup in the template. Note though that such WikiLinks will not show up as -backlinks to the page that uses the template. - -Note the use of "raw_name" inside the [[ikiwiki/WikiLink]] generator. This -ensures that if the name contains something that might be mistaken for wiki -markup, it's not converted to html before being processed as a -[[ikiwiki/WikiLink]]. -- cgit v1.2.3 From 7e79da76332b93214a7d9a5c91bc046db4219ee2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 16:10:46 -0400 Subject: template docu reorg Remove wikitemplates page; fold its contents into templates page. Update all backlinks. Document new ability to put templates inside srcdir. --- doc/bugs/SSI_include_stripped_from_mdwn.mdwn | 2 +- doc/bugs/login_page_non-obvious_with_openid.mdwn | 4 +- doc/features.mdwn | 2 +- doc/freesoftware.mdwn | 2 +- doc/ikiwiki-calendar.mdwn | 2 +- doc/ikiwiki/directive/edittemplate.mdwn | 2 +- doc/ikiwiki/directive/pagetemplate.mdwn | 8 +- doc/ikiwiki/directive/template.mdwn | 8 +- doc/plugins/autoindex.mdwn | 2 +- doc/plugins/map/discussion.mdwn | 2 +- doc/plugins/pagetemplate.mdwn | 6 +- doc/plugins/template.mdwn | 4 +- doc/plugins/write.mdwn | 4 +- doc/templates.mdwn | 91 +++++++++++++++++++--- doc/tips/comments_feed.mdwn | 2 +- ...o-create_tag_pages_according_to_a_template.mdwn | 2 +- doc/todo/auto_rebuild_on_template_change.mdwn | 2 +- doc/todo/html.mdwn | 2 +- doc/todo/multiple_templates.mdwn | 2 +- doc/usage.mdwn | 5 +- doc/wikitemplates.mdwn | 52 ------------- doc/wikitemplates/discussion.mdwn | 46 ----------- 22 files changed, 111 insertions(+), 141 deletions(-) delete mode 100644 doc/wikitemplates.mdwn delete mode 100644 doc/wikitemplates/discussion.mdwn (limited to 'doc/templates.mdwn') diff --git a/doc/bugs/SSI_include_stripped_from_mdwn.mdwn b/doc/bugs/SSI_include_stripped_from_mdwn.mdwn index 5519e45c6..270da86d3 100644 --- a/doc/bugs/SSI_include_stripped_from_mdwn.mdwn +++ b/doc/bugs/SSI_include_stripped_from_mdwn.mdwn @@ -10,7 +10,7 @@ If I have a <--#include virtual="foo" --> in some file, it gets stripped, > Anyway, it makes sense for the htmlscrubber to strip server-side > includes because otherwise your wiki could be attacked > by them being added to it. If you want to use both the htmlscrubber and -> SSI together, I'd suggest you modify the [[wikitemplates]] +> SSI together, I'd suggest you modify the [[templates]] > and put the SSI on there. > > Ie, `page.tmpl` has a diff --git a/doc/bugs/login_page_non-obvious_with_openid.mdwn b/doc/bugs/login_page_non-obvious_with_openid.mdwn index 1d087985a..9aa702037 100644 --- a/doc/bugs/login_page_non-obvious_with_openid.mdwn +++ b/doc/bugs/login_page_non-obvious_with_openid.mdwn @@ -36,7 +36,7 @@ If you want to keep it as one form, then perhaps using some javascript to disabl > that allows modifying that form, but does not allow creating a separate > form. The best way to make it obvious how to use it currently is to just > disable password auth, then it's nice and simple. :-) Javascript is an -> interesting idea. It's also possible to write a custom [[signin.tmpl wikitemplates]] that +> interesting idea. It's also possible to write a custom [[templates]] that > is displayed instead of the regular signin form, and it should be > possible to use that to manually lay it out better than FormBuilder > manages with its automatic layout. --[[Joey]] @@ -44,4 +44,4 @@ If you want to keep it as one form, then perhaps using some javascript to disabl > I've improved the form, I think it's more obvious now that the openid > stuff is separate. Good enough to call this [[done]]. I think. --[[Joey]] ->> Looks good, thanks! :-) -- [[AdamShand]] \ No newline at end of file +>> Looks good, thanks! :-) -- [[AdamShand]] diff --git a/doc/features.mdwn b/doc/features.mdwn index ab521213d..07ce648ea 100644 --- a/doc/features.mdwn +++ b/doc/features.mdwn @@ -72,7 +72,7 @@ you would care to syndicate. Ikiwiki aims to produce [valid XHTML 1.0](http://validator.w3.org/check?url=referer). Ikiwiki -generates html using [[templates|wikitemplates]], and uses [[css]], so you +generates html using [[templates]], and uses [[css]], so you can change the look and layout of all pages in any way you would like. ## [[Plugins]] diff --git a/doc/freesoftware.mdwn b/doc/freesoftware.mdwn index 7ac1ac6b4..2243d9b1f 100644 --- a/doc/freesoftware.mdwn +++ b/doc/freesoftware.mdwn @@ -4,7 +4,7 @@ ikiwiki, and this documentation wiki, are licensed under the terms of the GNU [[GPL]], version 2 or later. The parts of ikiwiki that become part of your own wiki (the [[basewiki]] -pages (but not the smilies) and the [[templates|wikitemplates]]) are licensed +pages (but not the smilies) and the [[templates]]) are licensed as follows: > Redistribution and use in source and compiled forms, with or without diff --git a/doc/ikiwiki-calendar.mdwn b/doc/ikiwiki-calendar.mdwn index c1f4d7267..03cbdd86c 100644 --- a/doc/ikiwiki-calendar.mdwn +++ b/doc/ikiwiki-calendar.mdwn @@ -43,7 +43,7 @@ An example crontab: # TEMPLATES -This command uses two [[template|wikitemplates]] to generate +This command uses two [[templates]] to generate the pages, `calendarmonth.tmpl` and `calendaryear.tmpl`. # AUTHOR diff --git a/doc/ikiwiki/directive/edittemplate.mdwn b/doc/ikiwiki/directive/edittemplate.mdwn index d731bdb47..c486e821b 100644 --- a/doc/ikiwiki/directive/edittemplate.mdwn +++ b/doc/ikiwiki/directive/edittemplate.mdwn @@ -21,7 +21,7 @@ something like: Details: The template page can also contain [[!cpan HTML::Template]] directives, -similar to other ikiwiki [[templates]]. Currently only one variable is +like other ikiwiki [[templates]]. Currently only one variable is set: `` is replaced with the name of the page being created. diff --git a/doc/ikiwiki/directive/pagetemplate.mdwn b/doc/ikiwiki/directive/pagetemplate.mdwn index 8ad901c1a..401b38099 100644 --- a/doc/ikiwiki/directive/pagetemplate.mdwn +++ b/doc/ikiwiki/directive/pagetemplate.mdwn @@ -1,17 +1,13 @@ The `pagetemplate` directive is supplied by the [[!iki plugins/pagetemplate desc=pagetemplate]] plugin. -This directive allows a page to be displayed using a different template than -the default `page.tmpl` template. +This directive allows a page to be displayed using a different +[[template|templates]] than the default `page.tmpl` template. The page text is inserted into the template, so the template controls the overall look and feel of the wiki page. This is in contrast to the [[ikiwiki/directive/template]] directive, which allows inserting templates _into_ the body of a page. -This directive can only reference templates that are already installed -by the system administrator, typically into the -`/usr/share/ikiwiki/templates` directory. Example: - \[[!pagetemplate template="my_fancy.tmpl"]] [[!meta robots="noindex, follow"]] diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index ae71ba5b5..052ca7873 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -1,7 +1,11 @@ The `template` directive is supplied by the [[!iki plugins/template desc=template]] plugin. -[[Templates]] are files that can be filled out and inserted into pages in the -wiki, by using the template directive. The directive has an `id` parameter +The template directive allows wiki pages to be used as templates. +These templates can be filled out and inserted into other pages in the +wiki using the directive. The [[templates]] page lists templates +that can be used with this directive. + +The directive has an `id` parameter that identifies the template to use. The remaining parameters are used to fill out the template. diff --git a/doc/plugins/autoindex.mdwn b/doc/plugins/autoindex.mdwn index d1133e4f5..7c4e40419 100644 --- a/doc/plugins/autoindex.mdwn +++ b/doc/plugins/autoindex.mdwn @@ -3,5 +3,5 @@ This plugin searches for [[SubPages|ikiwiki/subpage]] with a missing parent page, and generates the parent pages. The generated page content is -controlled by the `autoindex.tmpl` [[template|wikitemplates]], which by +controlled by the `autoindex.tmpl` [[template|templates]], which by default, uses a [[map]] to list the SubPages. diff --git a/doc/plugins/map/discussion.mdwn b/doc/plugins/map/discussion.mdwn index 2f7b140d6..54c921b0f 100644 --- a/doc/plugins/map/discussion.mdwn +++ b/doc/plugins/map/discussion.mdwn @@ -1,7 +1,7 @@ I'm wanting a [[map]] (with indentation levels) showing page _titles_ instead of page 'names'. As far as I can see, this is not an option with existing plugins - I can get a list of pages using [[inline]] and -appropriate [[wikitemplates]], but that has no indentation and therefore +appropriate [[templates]], but that has no indentation and therefore doesn't show structure well. The quick way is to modify the map plugin to have a 'titles' option. The diff --git a/doc/plugins/pagetemplate.mdwn b/doc/plugins/pagetemplate.mdwn index 53f069d0d..8254e14c5 100644 --- a/doc/plugins/pagetemplate.mdwn +++ b/doc/plugins/pagetemplate.mdwn @@ -3,8 +3,4 @@ This plugin provides the [[ikiwiki/directive/pagetemplate]] [[ikiwiki/directive]], which allows a page to be displayed -using a different [[template|wikitemplates]] than the default. - -This plugin can only use templates that are already installed in -`/usr/share/ikiwiki/templates` (or wherever ikiwiki is configured to look for -them). You can choose to use any .tmpl files in that directory. +using a different [[template|templates]] than the default. diff --git a/doc/plugins/template.mdwn b/doc/plugins/template.mdwn index da775f232..8d17e2825 100644 --- a/doc/plugins/template.mdwn +++ b/doc/plugins/template.mdwn @@ -3,5 +3,5 @@ This plugin provides the [[ikiwiki/directive/template]] [[ikiwiki/directive]]. With this plugin, you can set up templates, and cause them to be filled out -and inserted into pages in the wiki. It's documented and existing templates -are listed in the [[templates]] page. +and inserted into pages in the wiki. Existing templates are listed in the +[[templates]] page. diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 00b54bdd3..9128c7f54 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -297,7 +297,7 @@ value is ignored. hook(type => "pagetemplate", id => "foo", call => \&pagetemplate); -[[Templates|wikitemplates]] are filled out for many different things in +[[Templates]] are filled out for many different things in ikiwiki, like generating a page, or part of a blog page, or an rss feed, or a cgi. This hook allows modifying the variables available on those templates. The function is passed named parameters. The "page" and @@ -313,7 +313,7 @@ a new custom parameter to the template. hook(type => "templatefile", id => "foo", call => \&templatefile); -This hook allows plugins to change the [[template|wikitemplates]] that is +This hook allows plugins to change the [[template|templates]] that is used for a page in the wiki. The hook is passed a "page" parameter, and should return the name of the template file to use (relative to the template directory), or undef if it doesn't want to change the default diff --git a/doc/templates.mdwn b/doc/templates.mdwn index f2b581d2f..f7b3adae5 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -1,17 +1,88 @@ -[[!meta robots="noindex, follow"]] -[[!if test="enabled(template)" -then="This wiki has templates **enabled**." -else="This wiki has templates **disabled**." -]] +[[Ikiwiki]] uses many templates for many purposes. By editing its templates, +you can fully customise this site. -Templates are files that can be filled out and inserted into pages in the -wiki. +[[!if test="enabled(template)" then=""" +## The template directive +The template directive allows wiki pages to be used as templates. +These templates can be filled out and inserted into other pages in the +wiki using the directive. +"""]] [[!if test="enabled(template) and enabled(inline)" then=""" - -These templates are available for use with the template directive. - [[!inline pages="templates/* and !*/discussion" feeds=no archive=yes sort=title template=titlepage rootpage=templates postformtext="Add a new template named:"]] """]] + +[[!if test="enabled(edittemplate)" then=""" +## The edittemplate directive + +The edittemplate directive can be used to make new pages default to +containing text from a template, which can be filled as out the page is +edited. +"""]] + +## Wiki templates + +These templates are used to build the wiki. The aim is to keep almost all +html out of ikiwiki and in the templates. + +* `page.tmpl` - Used for displaying all regular wiki pages. +* `misc.tmpl` - Generic template used for any page that doesn't + have a custom template. +* `editpage.tmpl` - Create/edit page. +* `change.tmpl` - Used to create a page describing a change made to the wiki. +* `passwordmail.tmpl` - Not a html template, this is used to + generate a mail with an url the user can use to reset their password. +* `rsspage.tmpl` - Used for generating rss feeds for [[blogs|blog]]. +* `rssitem.tmpl` - Used for generating individual items on rss feeds. +* `atompage.tmpl` - Used for generating atom feeds for blogs. +* `atomitem.tmpl` - Used for generating individual items on atom feeds. +* `inlinepage.tmpl` - Used for adding a page inline in a blog + page. +* `archivepage.tmpl` - Used for listing a page in a blog archive page. +* `microblog.tmpl` - Used for showing a microblogging post inline. +* `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links) +* `feedlink.tmpl` - Used to add rss/atom links if blogpost.tmpl is not used. +* `aggregatepost.tmpl` - Used by the [[plugins/aggregate]] plugin to create + a page for a post. +* `searchform.tmpl` - Used by the [[plugins/search]] plugin to add a search + form to wiki pages. +* `searchquery.tmpl` - This is an omega template, used by the + [[plugins/search]] plugin. +* `comment.tmpl` - This template is used to display a comment + by the [[plugins/comments]] plugin. +* `editcomment.tmpl` - This template is the comment post form for the + [[plugins/comments]] plugin. +* `commentmoderation.tmpl` - This template is used to produce the comment + moderation form. +* `recentchanges.tmpl` - This template is used for listing a change + on the RecentChanges page. + +[[!if test="enabled(pagetemplate)" then=""" +## The pagetemplate directive + +The pagetemplate directive can allow individual pages to use a +different template than `page.tmpl`. +"""]] + +## Template locations + +Templates are located in `/usr/share/ikiwiki/templates` by default; +the `templatedir` setting can be used to make another directory be +searched first. Customized templates can also be placed inside the +"templates/" directory in your wiki's source. + +## Template syntax + +Ikiwiki uses the HTML::Template module as its template engine. This +supports things like conditionals and loops in templates and is pretty easy +to learn. All you really need to know are a few things: + +* To insert the value of a template variable, use ``. +* To make a block of text conditional on a variable being set use + `text`. +* To use one block of text if a variable is set and a second if it's not, + use `textother text` + +[[!meta robots="noindex, follow"]] diff --git a/doc/tips/comments_feed.mdwn b/doc/tips/comments_feed.mdwn index 6f8137256..6d4dbb803 100644 --- a/doc/tips/comments_feed.mdwn +++ b/doc/tips/comments_feed.mdwn @@ -6,5 +6,5 @@ add a feed that contains all the comments posted to any page. Here's how: \[[!inline pages="internal(*/comment_*)" template=comment]] The special [[ikiwiki/PageSpec]] matches all comments. The -[[template|wikitemplates]] causes the comments to be displayed formatted +[[template|templates]] causes the comments to be displayed formatted nicely. diff --git a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn index f6d444890..7eb404910 100644 --- a/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn +++ b/doc/todo/auto-create_tag_pages_according_to_a_template.mdwn @@ -17,7 +17,7 @@ The new tag file is then complied during the change phase. *see git history of this page if you want the patch --[[smcv]]* -This uses a [[template|wikitemplates]] called `autotagpage.tmpl`, here is my template file: +This uses a [[template|templates]] called `autotagpage.tmpl`, here is my template file: \[[!inline pages="link()" archive="yes"]] diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn index a112cb9da..838d15c1a 100644 --- a/doc/todo/auto_rebuild_on_template_change.mdwn +++ b/doc/todo/auto_rebuild_on_template_change.mdwn @@ -6,7 +6,7 @@ This would allow setting: templatedir => "$srcdir/templates", -.. and then the [[wikitemplates]] are managed like other wiki files; and +.. and then the [[templates]] are managed like other wiki files; and like other wiki files, a change to them automatically updates dependent pages. diff --git a/doc/todo/html.mdwn b/doc/todo/html.mdwn index 44f20c876..4f4542be2 100644 --- a/doc/todo/html.mdwn +++ b/doc/todo/html.mdwn @@ -1,6 +1,6 @@ Create some nice(r) stylesheets. Should be doable w/o touching a single line of code, just -editing the [[wikitemplates]] and/or editing [[style.css]]. +editing the [[templates]] and/or editing [[style.css]]. [[done]] ([[css_market]] ..) diff --git a/doc/todo/multiple_templates.mdwn b/doc/todo/multiple_templates.mdwn index 72783c556..30fb8d6ee 100644 --- a/doc/todo/multiple_templates.mdwn +++ b/doc/todo/multiple_templates.mdwn @@ -1,4 +1,4 @@ -> Another useful feature might be to be able to choose a different [[template|wikitemplates]] +> Another useful feature might be to be able to choose a different [[template|templates]] > file for some pages; [[blog]] pages would use a template different from the > home page, even if both are managed in the same repository, etc. diff --git a/doc/usage.mdwn b/doc/usage.mdwn index 2e12517ea..9cf61cc6c 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -120,10 +120,11 @@ also be configured using a setup file. * --templatedir dir - Specify the directory that the page [[templates|wikitemplates]] are stored in. + Specify the directory that [[templates|templates]] are stored in. Default is `/usr/share/ikiwiki/templates`, or another location as configured at build time. If the templatedir is changed, missing templates will still - be searched for in the default location as a fallback. + be searched for in the default location as a fallback. Templates can also be + placed in the "templates/" subdirectory of the srcdir. Note that if you choose to copy and modify ikiwiki's templates, you will need to be careful to keep them up to date when upgrading to new versions of diff --git a/doc/wikitemplates.mdwn b/doc/wikitemplates.mdwn deleted file mode 100644 index 6e5a7261d..000000000 --- a/doc/wikitemplates.mdwn +++ /dev/null @@ -1,52 +0,0 @@ -ikiwiki uses the HTML::Template module as its template engine. This -supports things like conditionals and loops in templates and is pretty easy -to learn. - -The aim is to keep almost all html out of ikiwiki and in the templates. - -It ships with some basic templates which can be customised. These are -located in `/usr/share/ikiwiki/templates` by default; the `templatedir` -setting can be used to make another directory be searched first. - -* `page.tmpl` - Used for displaying all regular wiki pages. -* `misc.tmpl` - Generic template used for any page that doesn't - have a custom template. -* `editpage.tmpl` - Create/edit page. -* `change.tmpl` - Used to create a page describing a change made to the wiki. -* `passwordmail.tmpl` - Not a html template, this is used to - generate a mail with an url the user can use to reset their password. -* `rsspage.tmpl` - Used for generating rss feeds for [[blogs|blog]]. -* `rssitem.tmpl` - Used for generating individual items on rss feeds. -* `atompage.tmpl` - Used for generating atom feeds for blogs. -* `atomitem.tmpl` - Used for generating individual items on atom feeds. -* `inlinepage.tmpl` - Used for adding a page inline in a blog - page. -* `archivepage.tmpl` - Used for listing a page in a blog archive page. -* `microblog.tmpl` - Used for showing a microblogging post inline. -* `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links) -* `feedlink.tmpl` - Used to add rss/atom links if blogpost.tmpl is not used. -* `aggregatepost.tmpl` - Used by the [[plugins/aggregate]] plugin to create - a page for a post. -* `searchform.tmpl` - Used by the [[plugins/search]] plugin to add a search - form to wiki pages. -* `searchquery.tmpl` - This is an omega template, used by the - [[plugins/search]] plugin. -* `comment.tmpl` - This template is used to display a comment - by the [[plugins/comments]] plugin. -* `editcomment.tmpl` - This template is the comment post form for the - [[plugins/comments]] plugin. -* `commentmoderation.tmpl` - This template is used to produce the comment - moderation form. -* `recentchanges.tmpl` - This template is used for listing a change - on the RecentChanges page. - -The [[plugins/pagetemplate]] plugin can allow individual pages to use a -different template than `page.tmpl`. - -The [[plugins/template]] plugin also uses templates, though those -[[templates]] are typically stored as pages in the wiki, and are inserted -into pages. - -The [[plugins/edittemplate]] plugin is used to make new pages default to -containing text from a template, which can be filled as out the page is -edited. diff --git a/doc/wikitemplates/discussion.mdwn b/doc/wikitemplates/discussion.mdwn deleted file mode 100644 index f97444e5f..000000000 --- a/doc/wikitemplates/discussion.mdwn +++ /dev/null @@ -1,46 +0,0 @@ -## Place for local templates -Where does one put any locally modified templates for an individual ikiwiki? --Ivan Z. - -> You can put them whereever you like; the `templatedir` controls -> where ikiwiki looks for them. --[[Joey]] - -Thank you for your response! My question arose out of my intention to make -custom templates for a wiki--specifically suited for the kind of content -it will have--so, that would mean I would want to distribute them through -git together with other content of the wiki. So, for this case the -separation of conceptually ONE thing (the content, the templates, and the -config option which orders to use these templates) into THREE separate -files/repos (the main content repo, the repo with templates, and the config -file) is not convenient: instead of distributing a single repo, I have to -tell people to take three things if they want to replicate this wiki. How -would you solve this inconvenience? Perhaps, a default location of the -templates *inside* the source repo would do?--Ivan Z. - -> I would avoid putting the templates in a subdirectory of the ikiwiki srcdir. -> (I'd also avoid putting the ikiwiki setup file there.) -> While it's safe to do either in some cases, there are configurations where -> it's unsafe. For example, a malicious user could use attachment handling to -> replace those files with their own, bad versions. -> -> So, two ideas for where to put the templatedir and ikiwiki setup. - -> * The easiest option is to put your wiki content in a subdirectory -> ("wiki", say) and point `srcdir` at that. -> then you can have another subdirectory for the wikitemplates, -> and put the setup file at the top. -> * Another option if using git would be to have a separate branch, -> in the same git repository, that holds wikitemplates and the setup file. -> Then you check out the repository once to make the `srcdir` available, -> and have a second checkout, of the other branch, to make the other stuff -> available. -> -> Note that with either of these methods, you have to watch out if -> giving other direct commit access to the repository. They could -> still edit the setup file and templates, so only trusted users should -> be given access. (It is, however, perfectly safe to let people edit -> the wiki via the web, and is even safe to configure -> [[tips/untrusted_git_push]] to such a repository.) --[[Joey]] - -Thanks, that's a nice and simple idea: to have a subdirectory! I'll try it. --Ivan Z. - -A [[!taglink wish|wishlist]]: the ikiwiki program could be improved so that it follows the same logic as git in looking for its config: it could ascend directories until it finds an `.ikiwiki/` directory with `.ikiwiki/setup` and then uses that configuration. Now I'm tired to always type `ikiwiki --setup path/to/the/setup --refresh` when working in my working clone of the sources; I'd like to simply type `ikiwiki` instead, and let it find the setup file. The default location to look for templates could also be made to be a sibling of the setup file: `.ikiwiki/templates/`. --Ivan Z. -- cgit v1.2.3 From 9b112cc986023e3a9ec5a4b5e9824af05e80c4d8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 23 Apr 2010 17:23:31 -0400 Subject: add test case to ensure all templates are documented --- doc/templates.mdwn | 42 +++++++++++++++++++++--------------------- t/templates_documented.t | 14 ++++++++++++++ 2 files changed, 35 insertions(+), 21 deletions(-) create mode 100755 t/templates_documented.t (limited to 'doc/templates.mdwn') diff --git a/doc/templates.mdwn b/doc/templates.mdwn index f7b3adae5..7b56600d1 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -30,34 +30,34 @@ html out of ikiwiki and in the templates. * `page.tmpl` - Used for displaying all regular wiki pages. * `misc.tmpl` - Generic template used for any page that doesn't have a custom template. -* `editpage.tmpl` - Create/edit page. -* `change.tmpl` - Used to create a page describing a change made to the wiki. -* `passwordmail.tmpl` - Not a html template, this is used to - generate a mail with an url the user can use to reset their password. -* `rsspage.tmpl` - Used for generating rss feeds for [[blogs|blog]]. +* `rsspage.tmpl` - Used for generating rss feeds for blogs. * `rssitem.tmpl` - Used for generating individual items on rss feeds. * `atompage.tmpl` - Used for generating atom feeds for blogs. * `atomitem.tmpl` - Used for generating individual items on atom feeds. -* `inlinepage.tmpl` - Used for adding a page inline in a blog - page. +* `inlinepage.tmpl` - Used for displaying a post in a blog. * `archivepage.tmpl` - Used for listing a page in a blog archive page. +* `titlepage.tmpl` - Used for listing a page by title in a blog archive page. * `microblog.tmpl` - Used for showing a microblogging post inline. * `blogpost.tmpl` - Used for a form to add a post to a blog (and a rss/atom links) -* `feedlink.tmpl` - Used to add rss/atom links if blogpost.tmpl is not used. -* `aggregatepost.tmpl` - Used by the [[plugins/aggregate]] plugin to create +* `feedlink.tmpl` - Used to add rss/atom links if `blogpost.tmpl` is not used. +* `aggregatepost.tmpl` - Used by the aggregate plugin to create a page for a post. -* `searchform.tmpl` - Used by the [[plugins/search]] plugin to add a search - form to wiki pages. -* `searchquery.tmpl` - This is an omega template, used by the - [[plugins/search]] plugin. -* `comment.tmpl` - This template is used to display a comment - by the [[plugins/comments]] plugin. -* `editcomment.tmpl` - This template is the comment post form for the - [[plugins/comments]] plugin. -* `commentmoderation.tmpl` - This template is used to produce the comment - moderation form. -* `recentchanges.tmpl` - This template is used for listing a change - on the RecentChanges page. +* `searchform.tmpl`, `googleform.tmpl` - Used by the search plugin + and google plugin to add search forms to wiki pages. +* `searchquery.tmpl` - This is a Omega template, used by the + search plugin. +* `comment.tmpl` - Used by the comments plugin to display a comment. +* `change.tmpl` - Used to create a page describing a change made to the wiki. +* `recentchanges.tmpl` - Used for listing a change on the RecentChanges page. +* `autoindex.tmpl` - Filled in by the autoindex plugin to make index pages. +* `autotag.tmpl` - Filled in by the tag plugin to make tag pages. +* `calendarmonth.tmpl`, `calendaryear.tmpl` - Used by ikiwiki-calendar to + make calendar archive pages. +* `editpage.tmpl`, `editconflict.tmpl`, `editcreationconflict.tmpl`, + `editfailedsave.tmpl`, `editpagegone.tmpl`, `pocreatepage.tmpl`, + `editcomment.tmpl` `commentmoderation.tmpl`, `renamesummary.tmpl`, + `passwordmail.tmpl` - Parts of ikiwiki's user interface; do not + normally need to be customised. [[!if test="enabled(pagetemplate)" then=""" ## The pagetemplate directive diff --git a/t/templates_documented.t b/t/templates_documented.t new file mode 100755 index 000000000..826c51d36 --- /dev/null +++ b/t/templates_documented.t @@ -0,0 +1,14 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Test::More 'no_plan'; + +$/=undef; +open(IN, "doc/templates.mdwn") || die "doc/templates.mdwn: $!"; +my $page=; +close IN; + +foreach my $file (glob("templates/*.tmpl")) { + $file=~s/templates\///; + ok($page =~ /\Q$file\E/, "$file documented on doc/templates.mdwn"); +} -- cgit v1.2.3 From 05517a5426fb585fdd56b21ce13cb4b80d2bc709 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 00:41:52 -0400 Subject: wording --- doc/templates.mdwn | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'doc/templates.mdwn') diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 7b56600d1..c91037670 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -4,9 +4,8 @@ you can fully customise this site. [[!if test="enabled(template)" then=""" ## The template directive -The template directive allows wiki pages to be used as templates. -These templates can be filled out and inserted into other pages in the -wiki using the directive. +The template directive allows wiki pages to be used as templates, +filled out and inserted into other pages in the wiki. """]] [[!if test="enabled(template) and enabled(inline)" then=""" [[!inline pages="templates/* and !*/discussion" feeds=no archive=yes -- cgit v1.2.3 From c0b2334815303d4dc2fdf0b22dff12085671c8d8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 01:13:37 -0400 Subject: reword, reorg, add example --- doc/templates.mdwn | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'doc/templates.mdwn') diff --git a/doc/templates.mdwn b/doc/templates.mdwn index c91037670..0e54ae8a0 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -2,7 +2,7 @@ you can fully customise this site. [[!if test="enabled(template)" then=""" -## The template directive +## template pages The template directive allows wiki pages to be used as templates, filled out and inserted into other pages in the wiki. @@ -12,21 +12,32 @@ filled out and inserted into other pages in the wiki. sort=title template=titlepage rootpage=templates postformtext="Add a new template named:"]] """]] +[[!if test="enabled(template)" then=""" +[[!template id=note text="This note box is built using the +[[note]] template!"]] +[[!template id=popup mouseover="popup example" popup="This popup is built using +the [[popup]] template!"]] +"""]] [[!if test="enabled(edittemplate)" then=""" -## The edittemplate directive +## edit templates The edittemplate directive can be used to make new pages default to containing text from a template, which can be filled as out the page is edited. """]] -## Wiki templates +## wiki templates These templates are used to build the wiki. The aim is to keep almost all html out of ikiwiki and in the templates. -* `page.tmpl` - Used for displaying all regular wiki pages. +* `page.tmpl` - Used for displaying all regular wiki pages. This is the + key template customize. +[[!if test="enabled(pagetemplate)" then=""" + (The pagetemplate directive can be used to make a page use a + different template than `page.tmpl`.) +"""]] * `misc.tmpl` - Generic template used for any page that doesn't have a custom template. * `rsspage.tmpl` - Used for generating rss feeds for blogs. @@ -58,13 +69,6 @@ html out of ikiwiki and in the templates. `passwordmail.tmpl` - Parts of ikiwiki's user interface; do not normally need to be customised. -[[!if test="enabled(pagetemplate)" then=""" -## The pagetemplate directive - -The pagetemplate directive can allow individual pages to use a -different template than `page.tmpl`. -"""]] - ## Template locations Templates are located in `/usr/share/ikiwiki/templates` by default; -- cgit v1.2.3 From a95d824cb43b9ffadb802f0804818b329f57d69a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 01:36:01 -0400 Subject: update --- doc/templates.mdwn | 46 +++++++++++++++++----------------------------- 1 file changed, 17 insertions(+), 29 deletions(-) (limited to 'doc/templates.mdwn') diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 0e54ae8a0..67e5517e4 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -1,6 +1,21 @@ [[Ikiwiki]] uses many templates for many purposes. By editing its templates, you can fully customise this site. +Templates are located in `/usr/share/ikiwiki/templates` by default; +the `templatedir` setting can be used to make another directory be +searched first. Customized templates can also be placed inside the +"templates/" directory in your wiki's source. + +Ikiwiki uses the HTML::Template module as its template engine. This +supports things like conditionals and loops in templates and is pretty +easy to learn. All you really need to know are a few things: + +* To insert the value of a template variable, use ``. +* To make a block of text conditional on a variable being set use + `text`. +* To use one block of text if a variable is set and a second if it's not, + use `textother text` + [[!if test="enabled(template)" then=""" ## template pages @@ -12,12 +27,6 @@ filled out and inserted into other pages in the wiki. sort=title template=titlepage rootpage=templates postformtext="Add a new template named:"]] """]] -[[!if test="enabled(template)" then=""" -[[!template id=note text="This note box is built using the -[[note]] template!"]] -[[!template id=popup mouseover="popup example" popup="This popup is built using -the [[popup]] template!"]] -"""]] [[!if test="enabled(edittemplate)" then=""" ## edit templates @@ -33,11 +42,9 @@ These templates are used to build the wiki. The aim is to keep almost all html out of ikiwiki and in the templates. * `page.tmpl` - Used for displaying all regular wiki pages. This is the - key template customize. -[[!if test="enabled(pagetemplate)" then=""" + key template to customize. [[!if test="enabled(pagetemplate)" then=""" (The pagetemplate directive can be used to make a page use a - different template than `page.tmpl`.) -"""]] + different template than `page.tmpl`.)"""]] * `misc.tmpl` - Generic template used for any page that doesn't have a custom template. * `rsspage.tmpl` - Used for generating rss feeds for blogs. @@ -69,23 +76,4 @@ html out of ikiwiki and in the templates. `passwordmail.tmpl` - Parts of ikiwiki's user interface; do not normally need to be customised. -## Template locations - -Templates are located in `/usr/share/ikiwiki/templates` by default; -the `templatedir` setting can be used to make another directory be -searched first. Customized templates can also be placed inside the -"templates/" directory in your wiki's source. - -## Template syntax - -Ikiwiki uses the HTML::Template module as its template engine. This -supports things like conditionals and loops in templates and is pretty easy -to learn. All you really need to know are a few things: - -* To insert the value of a template variable, use ``. -* To make a block of text conditional on a variable being set use - `text`. -* To use one block of text if a variable is set and a second if it's not, - use `textother text` - [[!meta robots="noindex, follow"]] -- cgit v1.2.3 From c6a473b8eea0ea015c44c3cd7a267f6325febac5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 20:30:05 -0400 Subject: update --- doc/templates.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/templates.mdwn') diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 67e5517e4..892e36cd2 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -23,8 +23,8 @@ The template directive allows wiki pages to be used as templates, filled out and inserted into other pages in the wiki. """]] [[!if test="enabled(template) and enabled(inline)" then=""" -[[!inline pages="templates/* and !*/discussion" feeds=no archive=yes -sort=title template=titlepage +[[!inline pages="templates/* and !*.tmpl and !*/discussion" +feeds=no archive=yes sort=title template=titlepage rootpage=templates postformtext="Add a new template named:"]] """]] -- cgit v1.2.3 From 5afda336720dc83e0fd4c6e2f311ff6664c68211 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Apr 2010 21:39:03 -0400 Subject: wording --- doc/templates.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/templates.mdwn') diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 892e36cd2..9208db0eb 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -8,7 +8,7 @@ searched first. Customized templates can also be placed inside the Ikiwiki uses the HTML::Template module as its template engine. This supports things like conditionals and loops in templates and is pretty -easy to learn. All you really need to know are a few things: +easy to learn. All you really need to know to modify templates is this: * To insert the value of a template variable, use ``. * To make a block of text conditional on a variable being set use -- cgit v1.2.3 From 66cc23a591f25344072deb07b2ccc7a4d4c89047 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 May 2010 18:22:47 -0400 Subject: no more misc.tmpl * Removed misc.tmpl. Now to theme ikiwiki, you only need to customise a single template, page.tmpl. * misc.tmpl will, however, still be read if a locally modified version exists. This is to avoid forcing users to update page.tmpl right now. --- IkiWiki.pm | 22 +++++++++++++++------- debian/changelog | 9 +++++++++ doc/roadmap.mdwn | 3 +++ doc/templates.mdwn | 2 -- 4 files changed, 27 insertions(+), 9 deletions(-) (limited to 'doc/templates.mdwn') diff --git a/IkiWiki.pm b/IkiWiki.pm index c428de77f..d20a3709c 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1742,21 +1742,29 @@ sub template ($;@) { sub misctemplate ($$;@) { my $title=shift; - my $pagebody=shift; + my $content=shift; - my $template=template("misc.tmpl"); + my $template=template("misc.tmpl") || template("page.tmpl"); + + run_hooks(pagetemplate => sub { + shift->(page => "", destpage => "", template => $template); + }); + $template->param( title => $title, - indexlink => indexlink(), wikiname => $config{wikiname}, - pagebody => $pagebody, + content => $content, baseurl => baseurl(), html5 => $config{html5}, + have_actions => 0, # force off + searchform => 0, # ditto + parentlinks => [{ # override + url => $config{url}, + page => $config{wikiname}, + }], @_, ); - run_hooks(pagetemplate => sub { - shift->(page => "", destpage => "", template => $template); - }); + return $template->output; } diff --git a/debian/changelog b/debian/changelog index 43c907544..0c3a99f0e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +ikiwiki (3.20100505) UNRELEASED; urgency=low + + * Removed misc.tmpl. Now to theme ikiwiki, you only need to customise + a single template, page.tmpl. + * misc.tmpl will, however, still be read if a locally modified version + exists. This is to avoid forcing users to update page.tmpl right now. + + -- Joey Hess Wed, 05 May 2010 18:07:29 -0400 + ikiwiki (3.20100504) unstable; urgency=low * Add parameter to displaytime to specify that it is a pubdate, diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index e257c21a2..729d22fb8 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -81,6 +81,9 @@ Probably incomplete list: * Enable tagbase by default (so that tag autocreation will work by default). Note that this is already done for wikis created by `auto-blog.setup`. * [[tips/html5]] on by default (some day..) +* stop reading misc.tmpl if it exists (only done in case users have a customized + version, or an outdated version of page.tmpl that cannot be used by + misctemplate) In general, we try to use [[ikiwiki-transition]] or forced rebuilds on upgrade to deal with changes that break compatability. Some things that diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 9208db0eb..2444cf14d 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -45,8 +45,6 @@ html out of ikiwiki and in the templates. key template to customize. [[!if test="enabled(pagetemplate)" then=""" (The pagetemplate directive can be used to make a page use a different template than `page.tmpl`.)"""]] -* `misc.tmpl` - Generic template used for any page that doesn't - have a custom template. * `rsspage.tmpl` - Used for generating rss feeds for blogs. * `rssitem.tmpl` - Used for generating individual items on rss feeds. * `atompage.tmpl` - Used for generating atom feeds for blogs. -- cgit v1.2.3 From f52f395437a946478da2a126015c05e3e0afdc1f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 May 2010 21:08:41 -0400 Subject: consistently drop NAME= in templates also add template syntax smoke test --- doc/ikiwiki/directive/template.mdwn | 8 ++--- doc/templates.mdwn | 4 +-- doc/templates/gitbranch.mdwn | 2 +- doc/templates/note.mdwn | 2 +- doc/templates/plugin.mdwn | 2 +- doc/templates/popup.mdwn | 2 +- templates/aggregatepost.tmpl | 18 +++++------ templates/archivepage.tmpl | 6 ++-- templates/atomitem.tmpl | 24 +++++++------- templates/atompage.tmpl | 10 +++--- templates/blogpost.tmpl | 8 ++--- templates/change.tmpl | 18 +++++------ templates/comment.tmpl | 30 ++++++++--------- templates/commentmoderation.tmpl | 4 +-- templates/editcomment.tmpl | 12 +++---- templates/editpage.tmpl | 12 +++---- templates/feedlink.tmpl | 8 ++--- templates/googleform.tmpl | 1 + templates/inlinepage.tmpl | 18 +++++------ templates/microblog.tmpl | 4 +-- templates/page.tmpl | 64 ++++++++++++++++++------------------- templates/pocreatepage.tmpl | 4 +-- templates/renamesummary.tmpl | 4 +-- templates/rssitem.tmpl | 14 ++++---- templates/titlepage.tmpl | 2 +- 25 files changed, 141 insertions(+), 140 deletions(-) (limited to 'doc/templates.mdwn') diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn index 052ca7873..6c50fa32e 100644 --- a/doc/ikiwiki/directive/template.mdwn +++ b/doc/ikiwiki/directive/template.mdwn @@ -53,21 +53,21 @@ few things: * To insert the raw value of a variable, with wiki markup not yet converted to html, use ``. * To make a block of text conditional on a variable being set use - `text`. + `text`. * To use one block of text if a variable is set and a second if it's not, - use `textother text` + use `textother text` Here's a sample template: Name: \[[]]
Age:
- + Favorite color:
No favorite color.
- +
diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 2444cf14d..8f6561fcf 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -12,9 +12,9 @@ easy to learn. All you really need to know to modify templates is this: * To insert the value of a template variable, use ``. * To make a block of text conditional on a variable being set use - `text`. + `text`. * To use one block of text if a variable is set and a second if it's not, - use `textother text` + use `textother text` [[!if test="enabled(template)" then=""" ## template pages diff --git a/doc/templates/gitbranch.mdwn b/doc/templates/gitbranch.mdwn index fcce925d9..962420940 100644 --- a/doc/templates/gitbranch.mdwn +++ b/doc/templates/gitbranch.mdwn @@ -3,7 +3,7 @@ Available in a [[!taglink /git]] repository.
Branch:
Author:
- + This template is used to create an infobox for a git branch. It uses these parameters: diff --git a/doc/templates/note.mdwn b/doc/templates/note.mdwn index 4cc323c0e..9ef5ad942 100644 --- a/doc/templates/note.mdwn +++ b/doc/templates/note.mdwn @@ -1,7 +1,7 @@
- + Use this template to insert a note into a page. The note will be styled to float to the right of other text on the page. This template has one parameter: diff --git a/doc/templates/plugin.mdwn b/doc/templates/plugin.mdwn index c1d1974d6..322c49445 100644 --- a/doc/templates/plugin.mdwn +++ b/doc/templates/plugin.mdwn @@ -8,7 +8,7 @@ Currently enabled: [[!if test="enabled()" then="yes" else="no"]]< [[!if test="sourcepage(plugins/contrib/*)" then="""[[!meta title=" (third party plugin)"]]"""]] [[!tag plugins/type/core]] - + This template is used to create an infobox for an ikiwiki plugin. It uses these parameters:
    diff --git a/doc/templates/popup.mdwn b/doc/templates/popup.mdwn index b355daa2e..92455eb21 100644 --- a/doc/templates/popup.mdwn +++ b/doc/templates/popup.mdwn @@ -1,4 +1,4 @@ - + Use this template to create a popup window that is displayed when the mouse is over part of the page. This template has two parameters:
      diff --git a/templates/aggregatepost.tmpl b/templates/aggregatepost.tmpl index 8b8936733..4e89efe32 100644 --- a/templates/aggregatepost.tmpl +++ b/templates/aggregatepost.tmpl @@ -1,15 +1,15 @@ - + [[!tag ]] - -[[!meta title=""]] + +[[!meta title=""]] - -[[!meta permalink=""]] + +[[!meta permalink=""]] - -[[!meta copyright=""]] + +[[!meta copyright=""]] -[[!meta author=""]] -[[!meta authorurl=""]] +[[!meta author=""]] +[[!meta authorurl=""]] diff --git a/templates/archivepage.tmpl b/templates/archivepage.tmpl index 28800e763..93bdd9ce0 100644 --- a/templates/archivepage.tmpl +++ b/templates/archivepage.tmpl @@ -1,14 +1,14 @@

      - +

      Posted - + by - + diff --git a/templates/atomitem.tmpl b/templates/atomitem.tmpl index 87cbee9e0..4ed17bc62 100644 --- a/templates/atomitem.tmpl +++ b/templates/atomitem.tmpl @@ -1,17 +1,17 @@ <TMPL_VAR TITLE> - + - + - + - + @@ -19,30 +19,30 @@ - + - - + + - + - - " type="text/html" /> + + - - " type="application/atom+xml" /> + + diff --git a/templates/atompage.tmpl b/templates/atompage.tmpl index fc0088ae8..e82b59827 100644 --- a/templates/atompage.tmpl +++ b/templates/atompage.tmpl @@ -5,15 +5,15 @@ - + - + - + @@ -21,13 +21,13 @@ - + - + diff --git a/templates/blogpost.tmpl b/templates/blogpost.tmpl index 7eeede603..5a31e3f8a 100644 --- a/templates/blogpost.tmpl +++ b/templates/blogpost.tmpl @@ -1,10 +1,10 @@

      - -RSS + +RSS - -Atom + +Atom diff --git a/templates/change.tmpl b/templates/change.tmpl index 5f277a0fb..671b9e483 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -2,15 +2,15 @@ [[!meta authorurl=""""""]] -[[!meta title="""change to on """]] +[[!meta title="""change to on """]] [[!meta permalink=""]]
      - - -
      + + +
      - +
      -
      +
       
      diff --git a/templates/comment.tmpl b/templates/comment.tmpl index 39cba0ff9..fa90e6d26 100644 --- a/templates/comment.tmpl +++ b/templates/comment.tmpl @@ -1,5 +1,5 @@ -
      -
      +
      +
      @@ -15,40 +15,40 @@
      Comment by - - + + - + - - + + - + - - + + - - + + - +
      - +