From: Joey Hess <joey@kitenet.net>
Date: Thu, 21 Apr 2011 23:52:39 +0000 (-0400)
Subject: meta: Add FOAF support. Closes: #623156 (Jonas Smedegaard)
X-Git-Tag: 3.20110430~18
X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/270fd45c5d30c06f69e18488f08a7f6bdec95813

meta: Add FOAF support. Closes: #623156 (Jonas Smedegaard)
---

diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index cd6fa20ba..b857f453e 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -217,6 +217,13 @@ sub preprocess (@) {
 				'content="'.encode_entities($url).'" />';
 		}
 	}
+	elsif ($key eq 'foaf') {
+		if (safeurl($value)) {
+			push @{$metaheaders{$page}}, '<link rel="meta" '.
+				'type="application/rdf+xml" title="FOAF" '.
+				'href="'.encode_entities($value).'" />';
+		}
+	}
 	elsif ($key eq 'redir') {
 		return "" if $page ne $destpage;
 		my $safe=0;
diff --git a/debian/changelog b/debian/changelog
index a72ea6451..db672bd52 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ ikiwiki (3.20110329) UNRELEASED; urgency=low
   * meta: Fix bug in loading of HTML::Entities that can break inline
     archive=yes (mostly masked by other plugins that load the module).
   * Be quiet about updating wrappers, except in verbose mode. (jmtd)
+  * meta: Add FOAF support. Closes: #623156 (Jonas Smedegaard)
 
  -- Joey Hess <joeyh@debian.org>  Mon, 28 Mar 2011 13:08:23 -0400
 
diff --git a/doc/ikiwiki/directive/meta.mdwn b/doc/ikiwiki/directive/meta.mdwn
index 9c2147264..6b381f138 100644
--- a/doc/ikiwiki/directive/meta.mdwn
+++ b/doc/ikiwiki/directive/meta.mdwn
@@ -181,6 +181,15 @@ Supported fields:
   value. The date/time can be given in any format that
   [[!cpan TimeDate]] can understand, just like the `date` field.
 
+* foaf
+
+  Adds a Friend of a Friend ([FOAF](http://wiki.foaf-project.org/w/Autodiscovery))
+  reference to a page.
+
+  Example:
+
+  	\[[!meta foaf=foaf.rdf]]
+
 If the field is not one of the above predefined fields, the metadata will be
 written to the generated html page as a &lt;meta&gt; header. However, this
 won't be allowed if the [[!iki plugins/htmlscrubber desc=htmlscrubber]] plugin is enabled,