Bugzilla – Attachment 164242 Details for
Bug 35812
Should specify canonical URLs to help search indexers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35812: add noindex attribute to search result pages in OPAC
Bug-35812-add-noindex-attribute-to-search-result-p.patch (text/plain), 4.19 KB, created by
Pedro Amorim
on 2024-04-02 08:47:46 UTC
(
hide
)
Description:
Bug 35812: add noindex attribute to search result pages in OPAC
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-04-02 08:47:46 UTC
Size:
4.19 KB
patch
obsolete
>From 27199ed9f2457f09a2e9bb1b05bdc3ed7955a675 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Micha=C5=82=20Kula?= > <148193449+mkibp@users.noreply.github.com> >Date: Wed, 27 Mar 2024 09:25:37 +0100 >Subject: [PATCH] Bug 35812: add noindex attribute to search result pages in > OPAC > >This will prevent search engines from putting the search results pages into their indexes, to prevent cluttering of the search results and give better visibility to the actual bibliographic records' pages. > >Note that "noindex" is separate from "nofollow", meaning that the search engine is allowed to get and process the search results page and extract ("follow") further links from it, such as links to biblio records, which is exactly what we want. > >This approach is better to the sitemaps, which search engines are free to choose whether to use or not, based on multiple factors such as the size of the page. In practice for small pages Google will just not download them at all, meaning that indexing by following links around is the only way the indexer will extract any links. > >Note that for this to work properly, you must NOT block the affected pages in your robots.txt file (they're not blocked by default). > >Also, this patch moves "cssinclude" block in opac-results.tt inside of <head>, because in all other templates it's inside, meaning its current positioning is a small mistake I fixed while at it. > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > .../opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt | 1 + > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt | 1 + > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 3 ++- > 3 files changed, 4 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt >index ed9819ad20f..8dc1c2b9ef3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-authorities-home.tt >@@ -5,6 +5,7 @@ > [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Authority search › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title> >+<meta name="robots" content="noindex"> > [% INCLUDE 'doc-head-close.inc' %] > [% BLOCK cssinclude %][% END %] > </head> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt >index d050b5941dd..6619137c4cf 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-browse.tt >@@ -6,6 +6,7 @@ > [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Browse our catalog › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title> >+<meta name="robots" content="noindex"> > [% INCLUDE 'doc-head-close.inc' %] > [% BLOCK cssinclude %][% END %] > [% INCLUDE 'bodytag.inc' bodyid='opac-browser' %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 5df882aff73..aa9f1e20769 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -25,11 +25,12 @@ > › > [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog > </title> >+<meta name="robots" content="noindex"> > [% INCLUDE 'doc-head-close.inc' %] >+[% BLOCK cssinclude %][% END %] > > <link rel="alternate" type="application/rss+xml" title="[% LibraryName | html %] Search RSS feed" href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&count=[% countrss |uri %]&sort_by=acqdate_dsc&format=rss" /> > </head> >-[% BLOCK cssinclude %][% END %] > [% INCLUDE 'bodytag.inc' bodyid='results' bodyclass='scrollto' %] > [% INCLUDE 'masthead.inc' %] > >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35812
:
163987
|
163988
|
163989
|
163990
|
164242
|
164243
|
164244
|
164245
|
166404
|
166405
|
166406
|
166407