diff mbox series

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

Message ID HEXE_22I7KEI5Xxn2AoQFc7W3S1P0NpXojVg_giRKLqr-cZHCJjlKaJ31kAWu9AZfJ68-_XG5Gnyx4qBka0Gih7pnx_NElUP9zr2oYgtwrc=@protonmail.com
State Accepted
Headers show
Series [bug#43803] website: theme: Allow adding noindex meta element to pages. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

ashish.is--- via Guix-patches" via Oct. 5, 2020, 6:41 p.m. UTC
Sorry, I sent an answer only to Othacehe by mistake. Here it is again.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Monday, October 5, 2020 1:18 PM, Mathieu Othacehe <othacehe@gnu.org> wrote:

> Hello,
>
> > -                  (noindex? #false)
> >
> >
>
> You can use #f instead.

Yes, I know :)


> This means that indexing will be disabled for every single page?

No. But, now that I read your question I'm confused by the keyword. So how about renaming it to "index?". Patch attached.

Comments

Mathieu Othacehe Oct. 6, 2020, 7:08 a.m. UTC | #1
Hello,

> * website/apps/base/templates/theme.scm (theme): New parameter INDEX?

Sounds fine, thanks!

Mathieu
Ludovic Courtès Oct. 22, 2020, 2:52 p.m. UTC | #2
Hi,

Luis Felipe <luis.felipe.la@protonmail.com> skribis:

> From 367ce04bf6c1d138eff6c678df536328e60cdb7e Mon Sep 17 00:00:00 2001
> From: Luis Felipe <luis.felipe.la@protonmail.com>
> 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’.
diff mbox series

Patch

From 367ce04bf6c1d138eff6c678df536328e60cdb7e Mon Sep 17 00:00:00 2001
From: Luis Felipe <luis.felipe.la@protonmail.com>
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?
---
 website/apps/base/templates/theme.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/website/apps/base/templates/theme.scm b/website/apps/base/templates/theme.scm
index 4734ee5..05d801a 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 '())
+                (index? #true)
                 (active-menu-item (C_ "website menu" "About"))
 		(css '())
 		(scripts '())
@@ -42,6 +44,11 @@ 
      A list of keyword strings that will be used as the value for
      the keywords meta element of the document.
 
+   INDEX? (boolean)
+     Indicate whether the page should be indexed by Internet robots,
+     such as search engine robots. If not provided, it defaults to
+     true.
+
    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 +86,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 index?
+           ""
+           '(meta (@ (name "robots") (content "noindex"))))
       ;; Menu prefetch.
       (link (@ (rel "prefetch") (href ,(guix-url "menu/index.html"))))
       ;; Base CSS.
-- 
2.28.0