safe => 1,
rebuild => 0,
},
+ raw_templates => {
+ type => "string",
+ example => [qw{raw}],
+ description => "templates for which you want raw content",
+ safe => 0,
+ rebuild => 1,
+ },
}
sub checkconfig () {
my $file = $pagesources{$page};
my $type = pagetype($file);
if (! $raw) {
+ # is $params{template} in $config{raw_templates}?
+ my $read_raw = grep {$_ eq $params{template}} @{$config{raw_templates}};
if ($needcontent) {
# Get the content before populating the
# template, since getting the content uses
# the same template if inlines are nested.
- my $content=get_inline_content($page, $params{destpage});
+ my $content=get_inline_content($page, $params{destpage}, $read_raw);
$template->param(content => $content);
}
$template->param(pageurl => urlto($page, $params{destpage}));
my %inline_content;
my $cached_destpage="";
-sub get_inline_content ($$) {
+sub get_inline_content ($$$) {
my $page=shift;
my $destpage=shift;
-
+ my $read_raw=shift;
+
if (exists $inline_content{$page} && $cached_destpage eq $destpage) {
return $inline_content{$page};
}
my $file=$pagesources{$page};
my $type=pagetype($file);
my $ret="";
+ $nested++;
if (defined $type) {
- $nested++;
$ret=htmlize($page, $destpage, $type,
linkify($page, $destpage,
preprocess($page, $destpage,
filter($page, $destpage,
readfile(srcfile($file))))));
- $nested--;
- if (isinternal($page)) {
- # make inlined text of internal pages searchable
- run_hooks(indexhtml => sub {
- shift->(page => $page, destpage => $destpage,
- content => $ret);
- });
- }
+ } elsif ($read_raw) {
+ $ret=readfile(srcfile($file));
+ }
+ $nested--;
+ if (isinternal($page)) {
+ # make inlined text of internal pages searchable
+ run_hooks(indexhtml => sub {
+ shift->(page => $page, destpage => $destpage,
+ content => $ret);
+ });
}
if ($cached_destpage ne $destpage) {
my @pages=@_;
my $url=URI->new(encode_utf8(urlto($page,"",1)));
-
- my $itemtemplate=template_depends($feedtype."item.tmpl", $page, blind_cache => 1);
+
+ my $template=$feedtype."item";
+ my $itemtemplate=template_depends($template.".tmpl", $page, blind_cache => 1);
my $content="";
my $lasttime = 0;
foreach my $p (@pages) {
my $u=URI->new(encode_utf8(urlto($p, "", 1)));
- my $pcontent = absolute_urls(get_inline_content($p, $page), $url);
+ # is $params{template} in $config{raw_templates}?
+ my $read_raw = grep {$_ eq $template} @{$config{raw_templates}};
+ my $pcontent = absolute_urls(get_inline_content($p, $page, $read_raw), $url);
$itemtemplate->param(
title => pagetitle(basename($p)),
$lasttime = $pagemtime{$p} if $pagemtime{$p} > $lasttime;
}
- my $template=template_depends($feedtype."page.tmpl", $page, blind_cache => 1);
+ $template=template_depends($feedtype."page.tmpl", $page, blind_cache => 1);
$template->param(
title => $page ne "index" ? pagetitle($page) : $config{wikiname},
wikiname => $config{wikiname},
--- /dev/null
+<TMPL_IF HTML5><article class="inlinepage"><TMPL_ELSE><div class="inlinepage"></TMPL_IF>
+
+<TMPL_IF HTML5><section class="inlineheader"><TMPL_ELSE><div class="inlineheader"></TMPL_IF>
+<TMPL_IF HTML5><header class="header"><TMPL_ELSE><span class="header"></TMPL_IF>
+<TMPL_IF PERMALINK>
+<a href="<TMPL_VAR PERMALINK>"><TMPL_VAR TITLE></a>
+<TMPL_ELSE>
+<a href="<TMPL_VAR PAGEURL>"><TMPL_VAR TITLE></a>
+</TMPL_IF>
+<TMPL_IF HTML5></header><TMPL_ELSE></span></TMPL_IF>
+<TMPL_IF HTML5></section><TMPL_ELSE></div></TMPL_IF>
+
+<TMPL_IF HTML5><section class="inlinecontent"><TMPL_ELSE><div class="inlinecontent"></TMPL_IF>
+<pre><code>
+<TMPL_VAR CONTENT>
+</code></pre>
+<TMPL_IF HTML5></section><TMPL_ELSE></div></TMPL_IF>
+
+<TMPL_IF HTML5><footer class="inlinefooter"><TMPL_ELSE><div class="inlinefooter"></TMPL_IF>
+<span class="pagedate">
+Posted <TMPL_VAR CTIME>
+</span>
+<TMPL_IF HTML5></footer><TMPL_ELSE></div></TMPL_IF>
+
+<TMPL_IF HTML5></article><TMPL_ELSE></div></TMPL_IF>