From 1b7c455f4a4214bc9df766be4ec2b12adcf679e1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Apr 2010 16:03:53 -0400 Subject: thinking about changing how templatedir works and allowing wikitemplate files into the srcdir --- doc/todo/auto_rebuild_on_template_change.mdwn | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 doc/todo/auto_rebuild_on_template_change.mdwn (limited to 'doc/todo/auto_rebuild_on_template_change.mdwn') diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn new file mode 100644 index 000000000..c4ffae178 --- /dev/null +++ b/doc/todo/auto_rebuild_on_template_change.mdwn @@ -0,0 +1,33 @@ +If `page.tmpl` is changed, it would be nice if ikiwiki automatically +noticed, and rebuilt all pages. If `inlinepage.tmpl` is changed, a rebuild +of all pages using it in an inline would be stellar. + +This would allow setting: + + templatedir => "$srcdir/templates", + +.. and then the [[wikitemplates]] are managed like other wiki files; and +like other wiki files, a change to them automatically updates dependent +pages. + +Originally, it made good sense not to have the templatedir inside the wiki. +Those templates can be used to bypass the htmlscrubber, and you don't want +just anyone to edit them. But the same can be said of `style.css` and +`ikiwiki.js`, which *are* in the wiki. We rely on `allowed_attachments` +being set to secure those to prevent users uploading replacements. And we +assume that users who can directly (non-anon) commit *can* edit them, and +that's ok. + +So, perhaps the easiest way to solve this [[wishlist]] would be to +make templatedir *default* to "$srcdir/templates/, and make ikiwiki +register dependencies on `page.tmpl`, `inlinepage.tmpl`, etc, as they're +used. Although, having every page declare an explicit dep on `page.tmpl` +is perhaps a bit much; might be better to implement a special case for that +one. Also, having the templates be copied to `destdir` is not desirable. + +The risk is that a site might have `allowed_attachments` set to "templates/*" +or "*.tmpl" something like that. I think such a configuration is the *only* +risk, and it's unlikely enough that a NEWS warning should suffice. + +(This would also help to clear up the tricky disctinction between +wikitemplates and in-wiki templates.) -- cgit v1.2.3 From 09c647c1773d5c8eafacea486082684909e47449 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 20 Apr 2010 02:31:00 +0000 Subject: response --- doc/todo/auto_rebuild_on_template_change.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/todo/auto_rebuild_on_template_change.mdwn') diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn index c4ffae178..2799842ed 100644 --- a/doc/todo/auto_rebuild_on_template_change.mdwn +++ b/doc/todo/auto_rebuild_on_template_change.mdwn @@ -31,3 +31,5 @@ risk, and it's unlikely enough that a NEWS warning should suffice. (This would also help to clear up the tricky disctinction between wikitemplates and in-wiki templates.) + +> But would this require that templates be parseable as wiki pages? Because that would be a nuisance. --[[KathrynAndersen]] -- cgit v1.2.3 From 9f00692a798888b9cc9edb30a961c6418efba39b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Apr 2010 22:37:55 -0400 Subject: response --- doc/todo/auto_rebuild_on_template_change.mdwn | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'doc/todo/auto_rebuild_on_template_change.mdwn') diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn index 2799842ed..cde19700c 100644 --- a/doc/todo/auto_rebuild_on_template_change.mdwn +++ b/doc/todo/auto_rebuild_on_template_change.mdwn @@ -25,11 +25,15 @@ used. Although, having every page declare an explicit dep on `page.tmpl` is perhaps a bit much; might be better to implement a special case for that one. Also, having the templates be copied to `destdir` is not desirable. -The risk is that a site might have `allowed_attachments` set to "templates/*" -or "*.tmpl" something like that. I think such a configuration is the *only* -risk, and it's unlikely enough that a NEWS warning should suffice. +The risk is that a site might have `allowed_attachments` set to +`templates/*` or `*.tmpl` something like that. I think such a configuration +is the *only* risk, and it's unlikely enough that a NEWS warning should +suffice. (This would also help to clear up the tricky disctinction between wikitemplates and in-wiki templates.) > But would this require that templates be parseable as wiki pages? Because that would be a nuisance. --[[KathrynAndersen]] + +>> It would be better for them not to be rendered separately at all. +>> --[[Joey]] -- cgit v1.2.3 From 529929e732e1c6604d31b68e81898780de06e640 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Tue, 20 Apr 2010 02:45:14 +0000 Subject: non comprend --- doc/todo/auto_rebuild_on_template_change.mdwn | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/todo/auto_rebuild_on_template_change.mdwn') diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn index cde19700c..6a1013f8d 100644 --- a/doc/todo/auto_rebuild_on_template_change.mdwn +++ b/doc/todo/auto_rebuild_on_template_change.mdwn @@ -37,3 +37,5 @@ wikitemplates and in-wiki templates.) >> It would be better for them not to be rendered separately at all. >> --[[Joey]] + +>>> I don't follow you. --[[KathrynAndersen]] -- cgit v1.2.3 From 563428ebd2a75cfabccf1974da0c1cbbe07eb369 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 19 Apr 2010 23:52:16 -0400 Subject: response --- doc/todo/auto_rebuild_on_template_change.mdwn | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/todo/auto_rebuild_on_template_change.mdwn') diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn index 6a1013f8d..2558d5f3e 100644 --- a/doc/todo/auto_rebuild_on_template_change.mdwn +++ b/doc/todo/auto_rebuild_on_template_change.mdwn @@ -24,6 +24,7 @@ register dependencies on `page.tmpl`, `inlinepage.tmpl`, etc, as they're used. Although, having every page declare an explicit dep on `page.tmpl` is perhaps a bit much; might be better to implement a special case for that one. Also, having the templates be copied to `destdir` is not desirable. +(However, if they're not copied, wikilinks to them will be broken. Hmm.) The risk is that a site might have `allowed_attachments` set to `templates/*` or `*.tmpl` something like that. I think such a configuration @@ -39,3 +40,8 @@ wikitemplates and in-wiki templates.) >> --[[Joey]] >>> I don't follow you. --[[KathrynAndersen]] + +>>>> If they don't render to output files, they clearly don't +>>>> need to be treated as wiki pages. (They need to be treated +>>>> as raw files anyway, because you don't want random users editing them +>>>> in the online editor.) --[[Joey]] -- cgit v1.2.3 From 11718519348382892d5c6fdb21b8e721c2413eb0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 20 Apr 2010 01:32:19 -0400 Subject: similarity to internal pages --- doc/todo/auto_rebuild_on_template_change.mdwn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'doc/todo/auto_rebuild_on_template_change.mdwn') diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn index 2558d5f3e..2e4ba8e9a 100644 --- a/doc/todo/auto_rebuild_on_template_change.mdwn +++ b/doc/todo/auto_rebuild_on_template_change.mdwn @@ -24,7 +24,8 @@ register dependencies on `page.tmpl`, `inlinepage.tmpl`, etc, as they're used. Although, having every page declare an explicit dep on `page.tmpl` is perhaps a bit much; might be better to implement a special case for that one. Also, having the templates be copied to `destdir` is not desirable. -(However, if they're not copied, wikilinks to them will be broken. Hmm.) +In a sense, these template would be like internal pages, except not wiki +pages, but raw files. The risk is that a site might have `allowed_attachments` set to `templates/*` or `*.tmpl` something like that. I think such a configuration -- cgit v1.2.3