summaryrefslogtreecommitdiff
path: root/doc/todo/Allow_filenames_that_are_all_type.mdwn
blob: b8b136aeb0ae25bd868b713f1ab33d41f892e39f (plain)

This is a [[patch]] to allow filenames that are just the type. The best example of this is wanting to pass a Makefile through one of the [[todo/syntax_highlighting/]] plugins. With this patch, if the plugin can process files of type .Makefile then it will also process Makefile.

I put this patch on the [[todo/syntax_highlighting/]] page a while ago, but it seemed to get lost because it didn't have its own bug to track it. Now it does :). -- [[Will]]

This changes pagename(), but what about pagetype()? Many things in ikiwiki check if pagetype($file) returns true to see if it's a page, etc. --[[Joey]]

diff --git a/IkiWiki.pm b/IkiWiki.pm
index 8d728c9..1bd46a9 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -618,6 +618,8 @@ sub pagetype ($) {
 	
 	if ($page =~ /\.([^.]+)$/) {
 		return $1 if exists $hooks{htmlize}{$1};
+	} elsif ($hooks{htmlize}{$page}{keepextension}) {
+		return $page;
 	}
 	return;
 }