Subject: [PATCH links] Adding rel="nofollow" to external links to avoid the SEO spammers.

From: Peter Sanchez <[email-masked]>
Date: Thu, 29 May 2025 11:36:06 -0600

Changelog-changed: Links to external sites will now have rel="nofollow"
  to help avoid the site from becoming a spam haven.
---
 templates/feed.html        | 2 +-
 templates/link_detail.html | 4 ++--
 templates/link_list.html   | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/templates/feed.html b/templates/feed.html
index 9c6aa7a..b3cbb19 100644
--- a/templates/feed.html
+++ b/templates/feed.html
@@ -52,7 +52,7 @@
       <article>
         <div class="d-flex items-center">
           <h3 class="is-marginless mr-1">
-            <a class="text-dark" href="{{.URL}}" target="_blank">{{truncate .Title 60}}</a>
+            <a class="text-dark" href="{{.URL}}" rel="nofollow" target="_blank">{{truncate .Title 60}}</a>
 	    {{ if showCounter . }}<a href="{{ reverse "core:bookmarks" .BaseURLHash }}" class="button outline primary tag tag-popular is-small">{{if $.isPopular}}{{ .Counter }}{{ else }}{{ .BaseURLCounter }}{{ end }}</a>{{ end }}
           </h3>
         </div>
diff --git a/templates/link_detail.html b/templates/link_detail.html
index 08ca228..56cb1a2 100644
--- a/templates/link_detail.html
+++ b/templates/link_detail.html
@@ -10,7 +10,7 @@
   <header class="d-flex flex-row justify-between items-center">
     <div class="d-flex flex-row items-center">
       <div class="ml-1">
-        <h2><a class="text-dark" href="{{reverse "core:link_redirect" .link.Hash}}">{{.link.Title}}</a></h2>
+        <h2><a class="text-dark" href="{{reverse "core:link_redirect" .link.Hash}}" rel="nofollow" target="_blank">{{.link.Title}}</a></h2>
         <div class="d-flex flex-row items-center">
             {{if .IsPrivate}}
             <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width:20px; margin-right: 7px;">
@@ -29,7 +29,7 @@
     </div>
   </header>
   {{ if eq .link.Type "LINK" }}
-  <p><a href="{{reverse "core:link_redirect" .link.Hash}}" target="_blank">{{stripCommonProtocol .link.URL}}</a></p>
+  <p><a href="{{reverse "core:link_redirect" .link.Hash}}" rel="nofollow" target="_blank">{{stripCommonProtocol .link.URL}}</a></p>
   {{end}}
   <p>{{ htmlSafe (newlinebr .link.Description) }}</p>
   {{if .link.Tags}}
diff --git a/templates/link_list.html b/templates/link_list.html
index de514ae..797285a 100644
--- a/templates/link_list.html
+++ b/templates/link_list.html
@@ -119,7 +119,7 @@
               {{end}}
           {{end}}
           <h3 class="is-marginless mr-1">
-            <a class="text-dark" href="{{.URL}}" target="_blank">{{truncate .Title 60}}</a>
+            <a class="text-dark" href="{{.URL}}" rel="nofollow" target="_blank">{{truncate .Title 60}}</a>
 	      {{ if not $.hideSaveCount }}{{ if showCounter . }}<a href="{{ if $.isPopular }}{{ reverse "core:bookmarks" .Hash }}{{ else }}{{ reverse "core:bookmarks" .BaseURLHash }}{{ end }}" class="button outline primary tag tag-popular is-small">{{if $.isPopular}}{{ .Counter }}{{ else }}{{ .BaseURLCounter }}{{ end }}</a>{{ end }}{{ end }}
           </h3>
           {{if $.isOrgLink}}
@@ -171,7 +171,7 @@
 
                 <!-- Archived -->
                 {{if .ArchiveURL}}
-                <a class="icon-link tooltip-link" href="{{.ArchiveURL}}" target="_blank" data-tooltip="{{$.pd.Data.archive}}">
+                <a class="icon-link tooltip-link" href="{{.ArchiveURL}}" rel="nofollow" target="_blank" data-tooltip="{{$.pd.Data.archive}}">
                     <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6" style="width:20px;">
                         <path stroke-linecap="round" stroke-linejoin="round" d="m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z" />
                     </svg>
-- 
2.47.2