From 8dc18fc9d401faca9b066d25d1a893528c9cacaa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 10 May 2008 13:18:26 -0400 Subject: web commit by http://madduck.net/ --- doc/todo/more_customisable_titlepage_function.mdwn | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 doc/todo/more_customisable_titlepage_function.mdwn (limited to 'doc/todo') diff --git a/doc/todo/more_customisable_titlepage_function.mdwn b/doc/todo/more_customisable_titlepage_function.mdwn new file mode 100644 index 000000000..46f7f6a2a --- /dev/null +++ b/doc/todo/more_customisable_titlepage_function.mdwn @@ -0,0 +1,11 @@ +I understand the `IkiWiki::titlepage` function is used to generate filenames from titles. It would be nice if there were an easier way to override what it does. I suppose I could write an *external* plugin and call `inject`, but maybe this could instead be done via the configuration file? + +I imagine two things: a lookup hash and a template. + +Since `IkiWiki::titlepage` basically translates characters, it would be cool to be able to define a lookup hash in the configuration, which would be consulted before falling back to the generic `__xx__` `ord()` representation of a letter. For instance, in German, I might prefer to have 'ä' become 'ae' instead of something illegible. + +Second, maybe a template could be honoured. The template could have a slot `%s` where the calculated title goes, and it could contain `strftime` symbols as well as variables, which get interpolated on use. + +-- [[madduck]] + +[[wishlist]] -- cgit v1.2.3 From 345c707921de3d86081b7b8362266bdee4414086 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 10 May 2008 14:15:23 -0400 Subject: web commit by http://madduck.net/ --- doc/todo/more_customisable_titlepage_function.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/todo') diff --git a/doc/todo/more_customisable_titlepage_function.mdwn b/doc/todo/more_customisable_titlepage_function.mdwn index 46f7f6a2a..eb1d62448 100644 --- a/doc/todo/more_customisable_titlepage_function.mdwn +++ b/doc/todo/more_customisable_titlepage_function.mdwn @@ -2,10 +2,12 @@ I understand the `IkiWiki::titlepage` function is used to generate filenames fro I imagine two things: a lookup hash and a template. -Since `IkiWiki::titlepage` basically translates characters, it would be cool to be able to define a lookup hash in the configuration, which would be consulted before falling back to the generic `__xx__` `ord()` representation of a letter. For instance, in German, I might prefer to have 'ä' become 'ae' instead of something illegible. +Since `IkiWiki::titlepage` basically translates characters, it would be cool to be able to define a lookup hash in the configuration, which would be consulted before falling back to the generic `__xx__` `ord()` representation of a letter. For instance, in German, I might prefer to have 'ä' become 'ae' instead of something illegible. Second, maybe a template could be honoured. The template could have a slot `%s` where the calculated title goes, and it could contain `strftime` symbols as well as variables, which get interpolated on use. +Another option would be a function I could define in the setup file, or an external script, though that would be pretty expensive. + -- [[madduck]] [[wishlist]] -- cgit v1.2.3 From be81c594cea408309e68d78e405ab4a7097de4c4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 12 May 2008 14:38:17 -0400 Subject: thoughts --- doc/todo/more_customisable_titlepage_function.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'doc/todo') diff --git a/doc/todo/more_customisable_titlepage_function.mdwn b/doc/todo/more_customisable_titlepage_function.mdwn index eb1d62448..51b560746 100644 --- a/doc/todo/more_customisable_titlepage_function.mdwn +++ b/doc/todo/more_customisable_titlepage_function.mdwn @@ -10,4 +10,22 @@ Another option would be a function I could define in the setup file, or an exter -- [[madduck]] +I don't think that changing titlepage is a good idea, there are +compatability problems. + +Instead, I think that in the specific case of the blogpost form, there +should be an interface to allow plugins to do arbitrary transformatiosn of +the page name. + +So, add a hidden field to blogpost.tmpl, something like blogpost=1. Then in +`editpage`, if blogpost is set, call the blogpost hooks, which are passed +a page name and return a transformed version. + +If the page name is changed by those, then the user's original title might +need to be preserved via a meta title directive. This could just be +inserted if any changes are made to the page name. Only problem with this +is that having the directive appear in the edit box for a new page could +confuse the user. The title could be passed on in a hidden field, and +prepended to the page when it's saved.. + [[wishlist]] -- cgit v1.2.3