]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Use rel=nofollow microformat for dynamic (CGI-related) URLs
authorSimon McVittie <smcv@debian.org>
Mon, 9 Jan 2017 11:37:10 +0000 (11:37 +0000)
committerSimon McVittie <smcv@debian.org>
Mon, 9 Jan 2017 13:07:24 +0000 (13:07 +0000)
Some of these might be relatively expensive to dereference or result
in messages being logged, and there's no reason why a search engine
should need to index them. (In particular, we'd probably prefer search
engines to index the rendered page, not its source code.)

IkiWiki/Plugin/comments.pm
IkiWiki/Plugin/passwordauth.pm
templates/editcomment.tmpl
templates/page.tmpl

index 0858f69f1def801d8f12f03be0c3dfd8c9e7b881..46e1b268f1c2f503890ef17194728935112faef4 100644 (file)
@@ -126,7 +126,7 @@ sub htmlize {
 sub htmlize_pending {
        my %params = @_;
        return sprintf(gettext("this comment needs %s"),
-               '<a href="'.
+               '<a rel="nofollow" href="'.
                IkiWiki::cgiurl(do => "commentmoderation").'">'.
                gettext("moderation").'</a>');
 }
@@ -286,7 +286,7 @@ sub preprocess_moderation {
                unless defined $params{desc};
 
        if (length $config{cgiurl}) {
-               return '<a href="'.
+               return '<a rel="nofollow" href="'.
                        IkiWiki::cgiurl(do => 'commentmoderation').
                        '">'.$params{desc}.'</a>';
        }
@@ -946,7 +946,7 @@ sub pagetemplate (@) {
                                );
                        }
                        elsif (commentsopen($page)) {
-                               $link = "<a href=\"".addcommenturl($page)."\">".
+                               $link = "<a rel=\"nofollow\" href=\"".addcommenturl($page)."\">".
                                        #translators: Here "Comment" is a verb;
                                        #translators: the user clicks on it to
                                        #translators: post a comment.
index c966087ce75039baa9f1492a81976de4502936fd..fb3fd9ee1620911558ec09c96b466405a3a0592a 100644 (file)
@@ -305,7 +305,7 @@ sub formbuilder_setup (@) {
                                                noimageinline => 1));
                        }
                        else {
-                               $form->text("<a href=\"".
+                               $form->text("<a rel=\"nofollow\" href=\"".
                                        IkiWiki::cgiurl(do => "edit", page => $userpage).
                                        "\">".gettext("Create your user page")."</a>");
                        }
index e177db959412355240ccb2c83fc016ff7c477ca1..703564eb6d4af7243840165b010341aa18279787 100644 (file)
@@ -8,7 +8,7 @@
 <TMPL_UNLESS NAME=USERNAME>
 <TMPL_IF NAME=ALLOWAUTHOR>
 <label for="author" class="block">Name:</label>
-<TMPL_VAR NAME=FIELD-AUTHOR> (optional, or <a href="<TMPL_VAR SIGNINURL>">signin</a>)
+<TMPL_VAR NAME=FIELD-AUTHOR> (optional, or <a rel="nofollow" href="<TMPL_VAR SIGNINURL>">signin</a>)
 <br/>
 <label for="url" class="block">Website:</label>
 <TMPL_VAR NAME=FIELD-URL> (optional)
@@ -17,7 +17,7 @@
 <TMPL_VAR NAME=FIELD-EMAIL> <TMPL_VAR FIELD-ANONSUBSCRIBE>
 <br />
 <TMPL_ELSE>
-(You might want to <a href="<TMPL_VAR SIGNINURL>">Signin</a> first?)
+(You might want to <a rel="nofollow" href="<TMPL_VAR SIGNINURL>">Signin</a> first?)
 <br />
 </TMPL_IF>
 </TMPL_UNLESS>
index 183d733e1637f518f99a0c835765364f38edffd5..a1991f6e4cc96bc9cb39eccb3584f7c6af2dd991 100644 (file)
 <li><a href="<TMPL_VAR RECENTCHANGESURL>">RecentChanges</a></li>
 </TMPL_IF>
 <TMPL_IF HISTORYURL>
-<li><a href="<TMPL_VAR HISTORYURL>">History</a></li>
+<li><a rel="nofollow" href="<TMPL_VAR HISTORYURL>">History</a></li>
 </TMPL_IF>
 <TMPL_IF GETSOURCEURL>
-<li><a href="<TMPL_VAR GETSOURCEURL>">Source</a></li>
+<li><a rel="nofollow" href="<TMPL_VAR GETSOURCEURL>">Source</a></li>
 </TMPL_IF>
 <TMPL_IF PREFSURL>
-<li><a href="<TMPL_VAR PREFSURL>">Preferences</a></li>
+<li><a rel="nofollow" href="<TMPL_VAR PREFSURL>">Preferences</a></li>
 </TMPL_IF>
 <TMPL_IF ACTIONS>
 <TMPL_LOOP ACTIONS>
 <TMPL_VAR COMMENTS>
 <TMPL_IF ADDCOMMENTURL>
 <div class="addcomment">
-<a href="<TMPL_VAR ADDCOMMENTURL>">Add a comment</a>
+<a rel="nofollow" href="<TMPL_VAR ADDCOMMENTURL>">Add a comment</a>
 </div>
 <TMPL_ELSE>
 <div class="addcomment">Comments on this page are closed.</div>