* Add rel=tag attribute to tag links, supporting that microformat, as well

as allowing them to be styled specially. Thanks, NicolasLimare.
master
joey 2007-08-05 20:48:13 +00:00
parent 1d61c4d4d6
commit 09b0a3b73f
15 changed files with 82 additions and 64 deletions

View File

@ -546,7 +546,12 @@ sub htmllink ($$$;@) { #{{{
$bestlink.="#".$opts{anchor};
}
return "<a href=\"$bestlink\">$linktext</a>";
my @attrs;
if (defined $opts{rel}) {
push @attrs, ' rel="'.$opts{rel}.'"';
}
return "<a href=\"$bestlink\"@attrs>$linktext</a>";
} #}}}
sub htmlize ($$$) { #{{{

View File

@ -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");

4
debian/changelog vendored
View File

@ -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 <joeyh@debian.org> Fri, 03 Aug 2007 20:33:43 -0700
-- Joey Hess <joeyh@debian.org> Sun, 05 Aug 2007 13:35:37 -0700
ikiwiki (2.5) unstable; urgency=low

View File

@ -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($;$)`

View File

@ -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]]

View File

@ -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 "<span class=\"selflink\">$linktext</span>"
if length $bestlink && $page eq $bestlink;
@@ -546,7 +548,7 @@
$bestlink.="#".$opts{anchor};
}
- return "<a href=\"$bestlink\">$linktext</a>";
+ return "<a href=\"$bestlink\"$rel>$linktext</a>";
} #}}}
sub htmlize ($$$) { #{{{
This one uses it for tags:
<pre>
--- 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]]
[[tag wishlist patch]]

View File

@ -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 <dam@modsodtsys.com>\n"
"Language-Team: Bulgarian <dict@fsa-bg.org>\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"

View File

@ -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 <kurem@debian.cz>\n"
"Language-Team: Czech <debian-l10n-czech@lists.debian.org>\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"

View File

@ -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 <victor@taquiones.net>\n"
"Language-Team: Spanish <es@li.org>\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 ""

View File

@ -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) <jean-luc.coulon@wanadoo.fr>\n"
"Language-Team: French <debian-l10n-french@lists.debian.org>\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 ""

View File

@ -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 <kartik.mistry@gmail.com>\n"
"Language-Team: Gujarati <team@utkarsh.org>\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 ઉંડાણ પર"

View File

@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""

View File

@ -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 <ptecza@net.icm.edu.pl>\n"
"Language-Team: Debian L10n Polish <debian-l10n-polish@lists.debian.org>\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"

View File

@ -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 <po@danielnylander.se>\n"
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\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"

View File

@ -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 <clytie@riverland.net.au>\n"
"Language-Team: Vietnamese <vi-VN@googlegroups.com>\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"