]> sipb.mit.edu Git - ikiwiki.git/commitdiff
thinking about changing how templatedir works and allowing wikitemplate files into...
authorJoey Hess <joey@kitenet.net>
Mon, 19 Apr 2010 20:03:53 +0000 (16:03 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 19 Apr 2010 20:03:53 +0000 (16:03 -0400)
doc/todo/auto_rebuild_on_template_change.mdwn [new file with mode: 0644]

diff --git a/doc/todo/auto_rebuild_on_template_change.mdwn b/doc/todo/auto_rebuild_on_template_change.mdwn
new file mode 100644 (file)
index 0000000..c4ffae1
--- /dev/null
@@ -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.)