Merge commit 'smcv/force-uuids' into force-uuids
commit
0fe87efc34
|
@ -442,6 +442,13 @@ sub genfeed ($$$$@) { #{{{
|
|||
mdate_3339 => date_3339($pagemtime{$p}),
|
||||
);
|
||||
|
||||
if (exists $pagestate{$p} &&
|
||||
exists $pagestate{$p}{meta}{uuid}) {
|
||||
my $atom_id = $pagestate{$p}{meta}{uuid};
|
||||
|
||||
$itemtemplate->param(uuid => $atom_id);
|
||||
}
|
||||
|
||||
if ($itemtemplate->query(name => "enclosure")) {
|
||||
my $file=$pagesources{$p};
|
||||
my $type=pagetype($file);
|
||||
|
|
|
@ -84,6 +84,16 @@ sub preprocess (@) { #{{{
|
|||
$pagestate{$page}{meta}{description}=HTML::Entities::encode_numeric($value);
|
||||
# fallthrough
|
||||
}
|
||||
elsif ($key eq 'uuid') {
|
||||
my $abs = $value;
|
||||
|
||||
if ($abs =~ m/^[[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12}$/) {
|
||||
$abs = lc "urn:uuid:$abs";
|
||||
}
|
||||
|
||||
$pagestate{$page}{meta}{uuid}=HTML::Entities::encode_numeric($abs);
|
||||
# fallthrough
|
||||
}
|
||||
elsif ($key eq 'license') {
|
||||
push @{$metaheaders{$page}}, '<link rel="license" href="#page_license" />';
|
||||
$pagestate{$page}{meta}{license}=$value;
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
<entry>
|
||||
<title><TMPL_VAR TITLE></title>
|
||||
<TMPL_IF NAME="UUID">
|
||||
<id><TMPL_VAR UUID></id>
|
||||
<TMPL_ELSE>
|
||||
<id><TMPL_VAR URL></id>
|
||||
</TMPL_IF>
|
||||
<link href="<TMPL_VAR PERMALINK>"/>
|
||||
<TMPL_IF NAME="AUTHOR">
|
||||
<author><name><TMPL_VAR AUTHOR ESCAPE=HTML></name></author>
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
<TMPL_ELSE>
|
||||
<title><TMPL_VAR TITLE></title>
|
||||
</TMPL_IF>
|
||||
<TMPL_IF NAME="UUID">
|
||||
<guid isPermaLink="no"><TMPL_VAR UUID></guid>
|
||||
<TMPL_ELSE>
|
||||
<guid><TMPL_VAR URL></guid>
|
||||
</TMPL_IF>
|
||||
<link><TMPL_VAR PERMALINK></link>
|
||||
<TMPL_IF NAME="CATEGORIES">
|
||||
<TMPL_LOOP NAME="CATEGORIES">
|
||||
|
|
Loading…
Reference in New Issue