+ (* It might be a template page ... These pages don't
+ * exist in the template, but can be synthesized on the
+ * fly by page.ml.
+ *)
+ let is_template_page url =
+ let sth = dbh#prepare_cached "select 1 from templates
+ where ? ~ url_regexp
+ order by ordering
+ limit 1" in
+ sth#execute [`String url];
+
+ try sth#fetch1int () = 1 with Not_found -> false
+ in
+
+ if is_template_page url then
+ "/" ^ url, "internal", title
+ else
+ (* No, it really doesn't exist, so make it a link to
+ * a new page.
+ *)