Subject: bug#43803: closed (Re: [bug#43803] website: theme: Allow adding noindex meta element to pages.)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 22 Oct 2020 14:53:02 +0000

Your bug report

#43803: website: theme: Allow adding noindex meta element to pages.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
43803: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=43803
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#43803] website: theme: Allow adding noindex meta element to pages.
From: Ludovic Courtès <[email-masked]>
To: Luis Felipe <[email-masked]>
Cc: Mathieu Othacehe <[email-masked]>, "[email-masked]" <[email-masked]>
Date: Thu, 22 Oct 2020 16:52:16 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Luis Felipe <[email-masked]> skribis:

> From 367ce04bf6c1d138eff6c678df536328e60cdb7e Mon Sep 17 00:00:00 2001
> From: Luis Felipe <[email-masked]>
> Date: Mon, 5 Oct 2020 13:10:27 -0500
> Subject: [PATCH] website: theme: Allow adding the noindex meta element to
>  pages.
>
> This change allows to tell Internet robots not to index some pages.
>
> * website/apps/base/templates/theme.scm (theme): New parameter INDEX?

Pushed, thanks!

Ludo’.

Subject: website: theme: Allow adding noindex meta element to pages.
From: Luis Felipe <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Sun, 04 Oct 2020 21:07:17 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi, this is to allow some pages to tell search engines not to list them in search results. For example, the paginated pages of the package list and blog posts.

---
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/

From d93d31c6faf4b7ec24f875933893cf46315bd9fd Mon Sep 17 00:00:00 2001
From: Luis Felipe <[email-masked]>
Date: Sun, 4 Oct 2020 15:43:53 -0500
Subject: [PATCH] website: theme: Allow adding noindex meta element to pages.

This change allows to tell Internet robots not to index some pages.

* website/apps/base/templates/theme.scm (theme): New parameter NOINDEX?
---
 website/apps/base/templates/theme.scm | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/website/apps/base/templates/theme.scm b/website/apps/base/templates/theme.scm
index 4734ee5..8263bf5 100644
--- a/website/apps/base/templates/theme.scm
+++ b/website/apps/base/templates/theme.scm
@@ -1,4 +1,5 @@
 ;;; GNU Guix web site
+;;; Public domain 2020 Luis Felipe López Acevedo
 ;;; Initially written by sirgazil who waives all
 ;;; copyright interest on this file.
 
@@ -14,6 +15,7 @@
 		(title '())
 		(description "")
 		(keywords '())
+                (noindex? #false)
                 (active-menu-item (C_ "website menu" "About"))
 		(css '())
 		(scripts '())
@@ -42,6 +44,12 @@
      A list of keyword strings that will be used as the value for
      the keywords meta element of the document.
 
+   NOINDEX? (boolean)
+     Indicate whether the page should tell Internet robots not to
+     index it. This is useful, for example, to avoid search engine
+     robots listing some pages in search results. If not provided,
+     it defaults to false.
+
    ACTIVE-MENU-ITEM (string)
      The label of the menu item in the navigation bar that should be
      highlighted to indicate the current section of the website that
@@ -79,6 +87,10 @@
       (meta (@ (name "keywords") (content ,(string-join keywords ", "))))
       (meta (@ (name "description") (content ,description)))
       (meta (@ (name "viewport") (content "width=device-width, initial-scale=1.0")))
+      ;; Info for Internet robots.
+      ,(if noindex?
+           '(meta (@ (name "robots") (content "noindex")))
+           "")
       ;; Menu prefetch.
       (link (@ (rel "prefetch") (href ,(guix-url "menu/index.html"))))
       ;; Base CSS.
-- 
2.28.0