From: joey Date: Sun, 5 Aug 2007 20:48:13 +0000 (+0000) Subject: * Add rel=tag attribute to tag links, supporting that microformat, as well X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/09b0a3b73f7c9ca873c3e20a64b124c0749b3d3b * Add rel=tag attribute to tag links, supporting that microformat, as well as allowing them to be styled specially. Thanks, NicolasLimare. --- diff --git a/IkiWiki.pm b/IkiWiki.pm index 88dcdcb5b..0af4a4fe9 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -546,7 +546,12 @@ sub htmllink ($$$;@) { #{{{ $bestlink.="#".$opts{anchor}; } - return "$linktext"; + my @attrs; + if (defined $opts{rel}) { + push @attrs, ' rel="'.$opts{rel}.'"'; + } + + return "$linktext"; } #}}} sub htmlize ($$$) { #{{{ diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 48ed1a8f8..bae8e1432 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -60,7 +60,8 @@ sub pagetemplate (@) { #{{{ $template->param(tags => [ map { - link => htmllink($page, $destpage, tagpage($_)) + link => htmllink($page, $destpage, tagpage($_), + rel => "tag") }, sort keys %{$tags{$page}} ]) if exists $tags{$page} && %{$tags{$page}} && $template->query(name => "tags"); diff --git a/debian/changelog b/debian/changelog index e8752e653..e5c259fca 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,10 @@ ikiwiki (2.6) UNRELEASED; urgency=low * Allow raw html in the rst plugin. * Add --set-option command line switch. * pagetemplate: don't display template name + * Add rel=tag attribute to tag links, supporting that microformat, as well + as allowing them to be styled specially. Thanks, NicolasLimare. - -- Joey Hess Fri, 03 Aug 2007 20:33:43 -0700 + -- Joey Hess Sun, 05 Aug 2007 13:35:37 -0700 ikiwiki (2.5) unstable; urgency=low diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index a122845af..90818c42e 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -372,6 +372,7 @@ control some options. These are: * forcesubpage - set to force a link to a subpage * linktext - set to force the link text to something * anchor - set to make the link include an anchor +* rel - set to add a rel attribute to the link. #### `readfile($;$)` diff --git a/doc/todo/CSS_classes_for_links.mdwn b/doc/todo/CSS_classes_for_links.mdwn index fedf5b355..ad4813eb2 100644 --- a/doc/todo/CSS_classes_for_links.mdwn +++ b/doc/todo/CSS_classes_for_links.mdwn @@ -68,4 +68,8 @@ My best regards, > Reason is that there are many ways for external links to get into an > ikiwiki page, including being entered as raw html. The only time ikiwiki > controls a link is when an internal link is added using a WikiLink. +> +> (Note that tags get their own special +> [[rel_attribute|rel_attribute_for_link]] now that CSS can use.) +> > --[[Joey]] diff --git a/doc/todo/rel_attribute_for_links.mdwn b/doc/todo/rel_attribute_for_links.mdwn index 7dc220afa..ced192758 100644 --- a/doc/todo/rel_attribute_for_links.mdwn +++ b/doc/todo/rel_attribute_for_links.mdwn @@ -7,44 +7,13 @@ A rel="" attribute is desirable for links, for example to This patch adds this possibility to htmllink(). - --- IkiWiki.pm.orig 2007-08-04 19:04:36.000000000 +0200 - +++ IkiWiki.pm 2007-08-04 19:19:24.000000000 +0200 - @@ -517,6 +517,8 @@ - $linktext=pagetitle(basename($link)); - } - - + my $rel=(defined $opts{rel} ? $rel=" rel=\"".$opts{rel}."\"" : ''); - + - return "$linktext" - if length $bestlink && $page eq $bestlink; - - @@ -546,7 +548,7 @@ - $bestlink.="#".$opts{anchor}; - } - - - return "$linktext"; - + return "$linktext"; - } #}}} - - sub htmlize ($$$) { #{{{ - This one uses it for tags: -
-    --- tag.pm.orig 2007-08-04 19:06:15.000000000 +0200
-    +++ tag.pm      2007-08-04 19:20:47.000000000 +0200
-    @@ -60,7 +60,8 @@
-     
-            $template->param(tags => [
-                    map { 
-    -                       link => htmllink($page, $destpage, tagpage($_))
-    +                       link => htmllink($page, $destpage, 
-    +                                        tagpage($_), rel => "tag")
-                    }, sort keys %{$tags{$page}}
-            ]) if exists $tags{$page} && %{$tags{$page}} && $template->query(name => "tags");
+> Both applied, thanks. Leaving the bug open since rel=nofollow etc are
+> still requested here. --[[Joey]]
 
 This can also help for css decoraton. An example of these patches in use: http://poivron.org/~nil/iki/japonesie/horizon_large/
 
 — NicolasLimare
 
-[[tag wishlist patch]]
\ No newline at end of file
+[[tag wishlist patch]]
diff --git a/po/bg.po b/po/bg.po
index 9c413fddf..c43452275 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ikiwiki-bg\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-07-26 21:44-0400\n"
+"POT-Creation-Date: 2007-08-05 13:46-0700\n"
 "PO-Revision-Date: 2007-01-12 01:19+0200\n"
 "Last-Translator: Damyan Ivanov \n"
 "Language-Team: Bulgarian \n"
@@ -152,7 +152,7 @@ msgstr "приставката „googlecalendar” не намери URL в HTM
 msgid "failed to run graphviz"
 msgstr "приставката „linkmap”: грешка при изпълнение на „dot”"
 
-#: ../IkiWiki/Plugin/graphviz.pm:80
+#: ../IkiWiki/Plugin/graphviz.pm:85
 msgid "prog not a valid graphviz program"
 msgstr ""
 
@@ -589,6 +589,10 @@ msgstr "успешно генериране на %s"
 msgid "usage: ikiwiki [options] source dest"
 msgstr "формат: ikiwiki [опции] източник местоназначение"
 
+#: ../ikiwiki.in:81
+msgid "usage: --set var=value"
+msgstr ""
+
 #: ../IkiWiki.pm:124
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr ""
@@ -603,7 +607,7 @@ msgstr "Грешка"
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
-#: ../IkiWiki.pm:662
+#: ../IkiWiki.pm:667
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr "открита е циклична завидимост при %s на „%s” на дълбочина %i"
diff --git a/po/cs.po b/po/cs.po
index 73f79b8ca..39aad286e 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ikiwiki\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-07-26 21:44-0400\n"
+"POT-Creation-Date: 2007-08-05 13:46-0700\n"
 "PO-Revision-Date: 2007-05-09 21:21+0200\n"
 "Last-Translator: Miroslav Kure \n"
 "Language-Team: Czech \n"
@@ -147,7 +147,7 @@ msgstr "v html se nepodařilo nalézt url"
 msgid "failed to run graphviz"
 msgstr "nepodařilo se spustit graphviz"
 
-#: ../IkiWiki/Plugin/graphviz.pm:80
+#: ../IkiWiki/Plugin/graphviz.pm:85
 msgid "prog not a valid graphviz program"
 msgstr "program není platným programem graphviz"
 
@@ -568,6 +568,10 @@ msgstr "%s byl úspěšně vytvořen"
 msgid "usage: ikiwiki [options] source dest"
 msgstr "použití: ikiwiki [volby] zdroj cíl"
 
+#: ../ikiwiki.in:81
+msgid "usage: --set var=value"
+msgstr ""
+
 #: ../IkiWiki.pm:124
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr "Při použití --cgi musíte pomocí --url zadat url k wiki"
@@ -580,7 +584,7 @@ msgstr "Chyba"
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
-#: ../IkiWiki.pm:662
+#: ../IkiWiki.pm:667
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr "Byla rozpoznána smyčka direktivy %s na %s v hloubce %i"
diff --git a/po/es.po b/po/es.po
index 12d6cbb23..7daec98d3 100644
--- a/po/es.po
+++ b/po/es.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: es\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-07-26 21:44-0400\n"
+"POT-Creation-Date: 2007-08-05 13:46-0700\n"
 "PO-Revision-Date: 2007-04-28 22:01+0200\n"
 "Last-Translator: Víctor Moral \n"
 "Language-Team: Spanish \n"
@@ -149,7 +149,7 @@ msgstr ""
 msgid "failed to run graphviz"
 msgstr "no he podido ejecutar el programa graphviz "
 
-#: ../IkiWiki/Plugin/graphviz.pm:80
+#: ../IkiWiki/Plugin/graphviz.pm:85
 msgid "prog not a valid graphviz program"
 msgstr "prog no es un programa graphviz válido "
 
@@ -577,6 +577,10 @@ msgstr "creado con éxito el programa envoltorio %s"
 msgid "usage: ikiwiki [options] source dest"
 msgstr "uso: ikiwiki [opciones] origen destino"
 
+#: ../ikiwiki.in:81
+msgid "usage: --set var=value"
+msgstr ""
+
 #: ../IkiWiki.pm:124
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr ""
@@ -591,7 +595,7 @@ msgstr "Error"
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
-#: ../IkiWiki.pm:662
+#: ../IkiWiki.pm:667
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr ""
diff --git a/po/fr.po b/po/fr.po
index 891387458..20f88798a 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ikiwiki\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-07-26 21:44-0400\n"
+"POT-Creation-Date: 2007-08-05 13:46-0700\n"
 "PO-Revision-Date: 2007-06-25 16:38+0200\n"
 "Last-Translator: Jean-Luc Coulon (f5ibh) \n"
 "Language-Team: French \n"
@@ -150,7 +150,7 @@ msgstr "Échec dans la recherche de l'url dans le code html"
 msgid "failed to run graphviz"
 msgstr "Échec de lancement de graphviz"
 
-#: ../IkiWiki/Plugin/graphviz.pm:80
+#: ../IkiWiki/Plugin/graphviz.pm:85
 msgid "prog not a valid graphviz program"
 msgstr "Le programme n'est pas un programme graphviz valable"
 
@@ -577,6 +577,10 @@ msgstr "%s a été créé avec succès"
 msgid "usage: ikiwiki [options] source dest"
 msgstr "Syntaxe : ikiwiki [options] source destination"
 
+#: ../ikiwiki.in:81
+msgid "usage: --set var=value"
+msgstr ""
+
 #: ../IkiWiki.pm:124
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr ""
@@ -591,7 +595,7 @@ msgstr "Erreur"
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
-#: ../IkiWiki.pm:662
+#: ../IkiWiki.pm:667
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr ""
diff --git a/po/gu.po b/po/gu.po
index 61a00cc97..715d4f73d 100644
--- a/po/gu.po
+++ b/po/gu.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ikiwiki-gu\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-07-26 21:44-0400\n"
+"POT-Creation-Date: 2007-08-05 13:46-0700\n"
 "PO-Revision-Date: 2007-01-11 16:05+0530\n"
 "Last-Translator: Kartik Mistry \n"
 "Language-Team: Gujarati \n"
@@ -148,7 +148,7 @@ msgstr "htmlમાં યુઆરએલ શોધવામાં નિષ્
 msgid "failed to run graphviz"
 msgstr "ગ્રાફવિઝ ચલાવવામાં નિષ્ફળ"
 
-#: ../IkiWiki/Plugin/graphviz.pm:80
+#: ../IkiWiki/Plugin/graphviz.pm:85
 msgid "prog not a valid graphviz program"
 msgstr "કાર્યક્રમએ યોગ્ય ગ્રાફવિઝ કાર્યક્રમ નથી"
 
@@ -568,6 +568,10 @@ msgstr "સફળતાપૂર્વક પેદા કરેલ છે %s"
 msgid "usage: ikiwiki [options] source dest"
 msgstr "ઉપયોગ: ikiwiki [વિકલ્પો] source dest"
 
+#: ../ikiwiki.in:81
+msgid "usage: --set var=value"
+msgstr ""
+
 #: ../IkiWiki.pm:124
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr "જ્યારે --cgi ઉપયોગ કરતાં હોય ત્યારે વીકીનું યુઆરએલ સ્પષ્ટ કરવું જ પડશે"
@@ -580,7 +584,7 @@ msgstr "ક્ષતિ"
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
-#: ../IkiWiki.pm:662
+#: ../IkiWiki.pm:667
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr "%s પર શોધાયેલ લુપ  %s પર ચલાવે છે %i ઉંડાણ પર"
diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot
index 6ec473ce6..1f7c1b158 100644
--- a/po/ikiwiki.pot
+++ b/po/ikiwiki.pot
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-07-26 21:44-0400\n"
+"POT-Creation-Date: 2007-08-05 13:46-0700\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME \n"
 "Language-Team: LANGUAGE \n"
@@ -148,7 +148,7 @@ msgstr ""
 msgid "failed to run graphviz"
 msgstr ""
 
-#: ../IkiWiki/Plugin/graphviz.pm:80
+#: ../IkiWiki/Plugin/graphviz.pm:85
 msgid "prog not a valid graphviz program"
 msgstr ""
 
@@ -567,6 +567,10 @@ msgstr ""
 msgid "usage: ikiwiki [options] source dest"
 msgstr ""
 
+#: ../ikiwiki.in:81
+msgid "usage: --set var=value"
+msgstr ""
+
 #: ../IkiWiki.pm:124
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr ""
@@ -579,7 +583,7 @@ msgstr ""
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
-#: ../IkiWiki.pm:662
+#: ../IkiWiki.pm:667
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr ""
diff --git a/po/pl.po b/po/pl.po
index d46e9f7a7..ebc55353e 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ikiwiki 1.51\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-07-26 21:44-0400\n"
+"POT-Creation-Date: 2007-08-05 13:46-0700\n"
 "PO-Revision-Date: 2007-04-27 22:05+0200\n"
 "Last-Translator: Pawel Tecza \n"
 "Language-Team: Debian L10n Polish \n"
@@ -154,7 +154,7 @@ msgstr "awaria w trakcie wyszukiwania adresu URL na stronie HTML"
 msgid "failed to run graphviz"
 msgstr "awaria w trakcie uruchamiania wtyczki graphviz"
 
-#: ../IkiWiki/Plugin/graphviz.pm:80
+#: ../IkiWiki/Plugin/graphviz.pm:85
 msgid "prog not a valid graphviz program"
 msgstr "prog nie jest poprawnym programem graphviz"
 
@@ -593,6 +593,10 @@ msgstr "pomyślnie utworzono %s"
 msgid "usage: ikiwiki [options] source dest"
 msgstr "użycie: ikiwiki [parametry] źródło cel"
 
+#: ../ikiwiki.in:81
+msgid "usage: --set var=value"
+msgstr ""
+
 #: ../IkiWiki.pm:124
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr ""
@@ -607,7 +611,7 @@ msgstr "Błąd"
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
-#: ../IkiWiki.pm:662
+#: ../IkiWiki.pm:667
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr "polecenie preprocesora %s wykryte w %s na głębokości %i"
diff --git a/po/sv.po b/po/sv.po
index 91fc355cc..98056806b 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ikiwiki\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-07-26 21:44-0400\n"
+"POT-Creation-Date: 2007-08-05 13:46-0700\n"
 "PO-Revision-Date: 2007-01-10 23:47+0100\n"
 "Last-Translator: Daniel Nylander \n"
 "Language-Team: Swedish \n"
@@ -151,7 +151,7 @@ msgstr "googlecalendar misslyckades med att hitta url i html"
 msgid "failed to run graphviz"
 msgstr "linkmap misslyckades att köra dot"
 
-#: ../IkiWiki/Plugin/graphviz.pm:80
+#: ../IkiWiki/Plugin/graphviz.pm:85
 msgid "prog not a valid graphviz program"
 msgstr ""
 
@@ -585,6 +585,10 @@ msgstr "generering av %s lyckades"
 msgid "usage: ikiwiki [options] source dest"
 msgstr "användning: ikiwiki [flaggor] källa mål"
 
+#: ../ikiwiki.in:81
+msgid "usage: --set var=value"
+msgstr ""
+
 #: ../IkiWiki.pm:124
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr "Måste ange url till wiki med --url när --cgi används"
@@ -597,7 +601,7 @@ msgstr "Fel"
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
-#: ../IkiWiki.pm:662
+#: ../IkiWiki.pm:667
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr "%s förbehandlingsslinga detekterades på %s, djup %i"
diff --git a/po/vi.po b/po/vi.po
index acd54a72f..23d3bf25c 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ikiwiki\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-07-26 21:44-0400\n"
+"POT-Creation-Date: 2007-08-05 13:46-0700\n"
 "PO-Revision-Date: 2007-01-13 15:31+1030\n"
 "Last-Translator: Clytie Siddall \n"
 "Language-Team: Vietnamese \n"
@@ -152,7 +152,7 @@ msgstr "googlecalendar không tìm thấy địa chỉ URL trong mã HTML"
 msgid "failed to run graphviz"
 msgstr "linkmap không chạy dot được"
 
-#: ../IkiWiki/Plugin/graphviz.pm:80
+#: ../IkiWiki/Plugin/graphviz.pm:85
 msgid "prog not a valid graphviz program"
 msgstr ""
 
@@ -585,6 +585,10 @@ msgstr "%s đã được tạo ra"
 msgid "usage: ikiwiki [options] source dest"
 msgstr "cách sử dụng: ikiwiki [tùy chọn] nguồn đích"
 
+#: ../ikiwiki.in:81
+msgid "usage: --set var=value"
+msgstr ""
+
 #: ../IkiWiki.pm:124
 msgid "Must specify url to wiki with --url when using --cgi"
 msgstr ""
@@ -598,7 +602,7 @@ msgstr "Lỗi"
 #. translators: preprocessor directive name,
 #. translators: the second a page name, the
 #. translators: third a number.
-#: ../IkiWiki.pm:662
+#: ../IkiWiki.pm:667
 #, perl-format
 msgid "%s preprocessing loop detected on %s at depth %i"
 msgstr "vòng lặp tiền xử lý %s được phát hiện trên %s ở độ sâu %i"