* [bug#43803] website: theme: Allow adding noindex meta element to pages.
@ 2020-10-04 21:07 Luis Felipe via Guix-patches via
2020-10-05 13:18 ` Mathieu Othacehe
0 siblings, 1 reply; 7+ messages in thread
From: Luis Felipe via Guix-patches via @ 2020-10-04 21:07 UTC (permalink / raw)
To: 43803
[-- Attachment #1.1: Type: text/plain, Size: 222 bytes --]
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/
[-- Attachment #1.2: Type: text/html, Size: 405 bytes --]
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-website-theme-Allow-adding-noindex-meta-element-to-p.patch --]
[-- Type: text/x-patch; name=0001-website-theme-Allow-adding-noindex-meta-element-to-p.patch, Size: 2129 bytes --]
From d93d31c6faf4b7ec24f875933893cf46315bd9fd Mon Sep 17 00:00:00 2001
From: Luis Felipe <luis.felipe.la@protonmail.com>
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [bug#43803] website: theme: Allow adding noindex meta element to pages.
2020-10-04 21:07 [bug#43803] website: theme: Allow adding noindex meta element to pages Luis Felipe via Guix-patches via
@ 2020-10-05 13:18 ` Mathieu Othacehe
2020-10-05 13:41 ` Ricardo Wurmus
2020-10-05 18:41 ` Luis Felipe via Guix-patches via
0 siblings, 2 replies; 7+ messages in thread
From: Mathieu Othacehe @ 2020-10-05 13:18 UTC (permalink / raw)
To: 43803; +Cc: luis.felipe.la
Hello,
> + (noindex? #false)
You can use #f instead.
This means that indexing will be disabled for every single page?
Thanks,
Mathieu
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#43803] website: theme: Allow adding noindex meta element to pages.
2020-10-05 13:18 ` Mathieu Othacehe
@ 2020-10-05 13:41 ` Ricardo Wurmus
2020-10-14 9:26 ` Ludovic Courtès
2020-10-05 18:41 ` Luis Felipe via Guix-patches via
1 sibling, 1 reply; 7+ messages in thread
From: Ricardo Wurmus @ 2020-10-05 13:41 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 43803, luis.felipe.la
Mathieu Othacehe <othacehe@gnu.org> writes:
>> + (noindex? #false)
>
> You can use #f instead.
I gotta say that I do prefer #false and think that using it elsewhere in
Guix would be nice. Yes, #f is shorter, but there’s something nice
about the readability of #false. We don’t usually abbreviate other
things in Scheme (cf “call-with-current-continuation”), so #false would
feel right at home :)
--
Ricardo
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#43803] website: theme: Allow adding noindex meta element to pages.
2020-10-05 13:41 ` Ricardo Wurmus
@ 2020-10-14 9:26 ` Ludovic Courtès
0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2020-10-14 9:26 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: Mathieu Othacehe, luis.felipe.la, 43803
Hi,
Ricardo Wurmus <rekado@elephly.net> skribis:
> I gotta say that I do prefer #false and think that using it elsewhere in
> Guix would be nice. Yes, #f is shorter, but there’s something nice
> about the readability of #false. We don’t usually abbreviate other
> things in Scheme (cf “call-with-current-continuation”), so #false would
> feel right at home :)
Seconded! I think at some point we should do a pass to replace as many
#t/#f as possible, especially in the manual and cookbook.
Ludo’.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [bug#43803] website: theme: Allow adding noindex meta element to pages.
2020-10-05 13:18 ` Mathieu Othacehe
2020-10-05 13:41 ` Ricardo Wurmus
@ 2020-10-05 18:41 ` Luis Felipe via Guix-patches via
2020-10-06 7:08 ` Mathieu Othacehe
2020-10-22 14:52 ` bug#43803: " Ludovic Courtès
1 sibling, 2 replies; 7+ messages in thread
From: Luis Felipe via Guix-patches via @ 2020-10-05 18:41 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 43803@debbugs.gnu.org
[-- Attachment #1: Type: text/plain, Size: 528 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-website-theme-Allow-adding-the-noindex-meta-element-.patch --]
[-- Type: text/x-patch; name=0001-website-theme-Allow-adding-the-noindex-meta-element-.patch, Size: 2043 bytes --]
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-10-22 14:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-04 21:07 [bug#43803] website: theme: Allow adding noindex meta element to pages Luis Felipe via Guix-patches via
2020-10-05 13:18 ` Mathieu Othacehe
2020-10-05 13:41 ` Ricardo Wurmus
2020-10-14 9:26 ` Ludovic Courtès
2020-10-05 18:41 ` Luis Felipe via Guix-patches via
2020-10-06 7:08 ` Mathieu Othacehe
2020-10-22 14:52 ` bug#43803: " Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.