Package: ikiwiki
Version: 3.20120202
Severity: wishlist

I store the static HTML output of ikiwiki for my website and blog in git
so that I can detect changes in the output that might not be desirable.
Every time I upgrade ikiwiki and rebuild my HTML, all of the atom feeds
have changed because ikiwiki hardcodes the version number in the
template. I find it a bit annoying to have to commit this before I start
a new blog post so I would like to remove it. According to RFC 4287[1],
both the generator tag itself and the version attribute are optional. I
have prepared the attached patch to allow these to be disabled.

     1. http://tools.ietf.org/html/rfc4287#section-4.2.4

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (700, 'testing'), (600, 'unstable'), (550, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages ikiwiki depends on:
ii  libhtml-parser-perl             3.69-1+b1
ii  libhtml-scrubber-perl           0.09-1
ii  libhtml-template-perl           2.10-1
ii  libjson-perl                    2.53-1
ii  libtext-markdown-discount-perl  0.02-1
ii  liburi-perl                     1.59-1
ii  libyaml-libyaml-perl            0.38-1
ii  perl                            5.14.2-7
ii  python                          2.7.2-10
ii  python-support                  1.0.14

Versions of packages ikiwiki recommends:
ii  bzr                          2.5.0~bzr6458-2
ii  darcs                        2.5.2-6+b2
ii  gcc [c-compiler]             4:4.6.2-4
ii  gcc-4.4 [c-compiler]         4.4.6-14
ii  gcc-4.5 [c-compiler]         4.5.3-12
ii  gcc-4.6 [c-compiler]         4.6.2-12
ii  git [git-core]               1:1.7.9-1
ii  git-core                     1:1.7.9-1
ii  libauthen-passphrase-perl    <none>
ii  libc6-dev [libc-dev]         2.13-26
ii  libcgi-formbuilder-perl      <none>
ii  libcgi-session-perl          <none>
ii  libcrypt-ssleay-perl         0.58-1
ii  libgravatar-url-perl         <none>
ii  liblwpx-paranoidagent-perl   <none>
ii  libmail-sendmail-perl        0.79.16-1
ii  libnet-openid-consumer-perl  <none>
ii  librpc-xml-perl              <none>
ii  libterm-readline-gnu-perl    <none>
ii  libtimedate-perl             1.2000-1
ii  libxml-simple-perl           2.18-3
ii  mercurial                    2.1-1
ii  subversion                   1.6.17dfsg-3

Versions of packages ikiwiki suggests:
pn  dvipng                      <none>
pn  file                        5.10-1
pn  gettext                     0.18.1.1-5
pn  graphviz                    2.26.3-9
pn  libfile-mimeinfo-perl       <none>
pn  libhighlight-perl           <none>
pn  libhtml-tree-perl           4.2-1
pn  liblocale-gettext-perl      1.05-7+b1
pn  libmailtools-perl           2.08-1
pn  libnet-amazon-s3-perl       <none>
pn  libnet-inet6glue-perl       0.5-1
pn  libsearch-xapian-perl       1.2.8.0-2
pn  libsort-naturally-perl      <none>
pn  libsparkline-php            <none>
pn  libtext-csv-perl            1.21-1
pn  libtext-multimarkdown-perl  <none>
pn  libtext-textile-perl        <none>
pn  libtext-typography-perl     <none>
pn  libtext-wikicreole-perl     <none>
pn  libtext-wikiformat-perl     <none>
pn  libxml-feed-perl            0.46+dfsg-1
pn  perlmagick                  8:6.6.9.7-6
pn  po4a                        0.41-1
pn  polygen                     <none>
pn  python-docutils             0.8.1-5
pn  texlive                     <none>
pn  tidy                        <none>
pn  viewvc | gitweb | viewcvs   <none>
pn  xapian-omega                <none>

-- 
bye,
pabs

http://wiki.debian.org/PaulWise
From 2e5a46a1886eed587b7df4a15837af852b107cd3 Mon Sep 17 00:00:00 2001
From: Paul Wise <pa...@bonedaddy.net>
Date: Tue, 28 Feb 2012 11:32:45 +0800
Subject: [PATCH] Allow dropping the generator tag or the version attribute on
 it.

Both the generator tag and its version attribute are optional:

http://tools.ietf.org/html/rfc4287#section-4.2.4
---
 IkiWiki.pm               |   16 ++++++++++++++++
 IkiWiki/Plugin/inline.pm |    3 ++-
 templates/atompage.tmpl  |    6 ++++++
 3 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/IkiWiki.pm b/IkiWiki.pm
index 2a83777..1b6cc55 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -497,6 +497,22 @@ sub getsetup () {
 		safe => 0,
 		rebuild => 0,
 	},
+	generator => {
+		type => "boolean",
+		default => 1,
+		description => "advertise that pages are generated using ikiwiki?",
+		advanced => 1,
+		safe => 1,
+		rebuild => 1,
+	},
+	generator_version => {
+		type => "boolean",
+		default => 1,
+		description => "advertise which version of ikiwiki was used to generate pages?",
+		advanced => 1,
+		safe => 1,
+		rebuild => 1,
+	},
 }
 
 sub defaultconfig () {
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 159cc5d..e25922c 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -668,6 +668,8 @@ sub genfeed ($$$$$@) {
 	}
 
 	my $template=template_depends($feedtype."page.tmpl", $page, blind_cache => 1);
+	$template->param(generator => "yes") if $config{generator};
+	$template->param(version => $IkiWiki::version) if $config{generator_version};
 	$template->param(
 		title => $page ne "index" ? pagetitle($page) : $config{wikiname},
 		wikiname => $config{wikiname},
@@ -677,7 +679,6 @@ sub genfeed ($$$$$@) {
 		guid => $guid,
 		feeddate => date_3339($lasttime),
 		feedurl => $feedurl,
-		version => $IkiWiki::version,
 	);
 	run_hooks(pagetemplate => sub {
 		shift->(page => $page, destpage => $page,
diff --git a/templates/atompage.tmpl b/templates/atompage.tmpl
index e82b598..05a4a97 100644
--- a/templates/atompage.tmpl
+++ b/templates/atompage.tmpl
@@ -33,7 +33,13 @@
 <id><TMPL_VAR PAGEURL></id>
 </TMPL_IF>
 <subtitle type="html"><TMPL_VAR FEEDDESC ESCAPE=HTML></subtitle>
+<TMPL_IF GENERATOR>
+<TMPL_IF VERSION>
 <generator uri="http://ikiwiki.info/"; version="<TMPL_VAR VERSION>">ikiwiki</generator>
+<TMPL_ELSE>
+<generator uri="http://ikiwiki.info/";>ikiwiki</generator>
+</TMPL_IF>
+</TMPL_IF>
 <updated><TMPL_VAR FEEDDATE></updated>
 <TMPL_VAR CONTENT>
 </feed>
-- 
1.7.9

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to