diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-08-04 00:01:51 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-08-04 00:01:51 +0000 |
commit | c5919df5f3697e0f8968e2b8f49cd15c1e0aa412 (patch) | |
tree | e4e6047286cd5144e6048e6c1921e9b9027f499c /IkiWiki/Plugin/meta.pm | |
parent | e8b39b094116e8b50cf12fe56b9c6a04f05683e5 (diff) |
* Make aggregator save permalinks and author name to pages as metadata.
* Add permalink and author support to meta plugin, affecting RSS feeds
and blog pages.
* Change titlepage() to encode utf-8 alnum characters. This is necessary
to avoid UTF-8 creeping into filenames in urls. (There are still
some other ways that it can get in.)
Diffstat (limited to 'IkiWiki/Plugin/meta.pm')
-rw-r--r-- | IkiWiki/Plugin/meta.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index bac163469..b6226ed88 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -8,6 +8,8 @@ use IkiWiki; my %meta; my %title; +my %permalink; +my %author; sub import { #{{{ IkiWiki::hook(type => "preprocess", id => "meta", @@ -57,9 +59,15 @@ sub preprocess (@) { #{{{ elsif ($key eq 'title') { $title{$page}=$value; } + elsif ($key eq 'permalink') { + $permalink{$page}=$value; + } else { $meta{$page}.="<meta name=\"".encode_entities($key). "\" content=\"".encode_entities($value)."\" />\n"; + if ($key eq 'author') { + $author{$page}=$value; + } } return ""; @@ -74,6 +82,11 @@ sub pagetemplate (@) { #{{{ if exists $meta{$page} && $template->query(name => "meta"); $template->param(title => $title{$page}) if exists $title{$page} && $template->query(name => "title"); + $template->param(permalink => $permalink{$page}) + if exists $permalink{$page} && $template->query(name => "permalink"); + $template->param(author => $author{$page}) + if exists $author{$page} && $template->query(name => "author"); + } # }}} 1 |