From 7d92d37b31e172a2192457567125bae9647ed3be Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 19 Oct 2015 22:21:58 -0400 Subject: [PATCH] LP#1507845: Improve search engine optimization Back in bug # 1414033 , we added rel="nofollow" attributes to many of the links that led to search results or call number browsing. This was the right idea, but a bit overzealous as it turns out. We actually want search engines to follow those links; we just don't want search engines to index them. Therefore, we can tweak the tag in the results and browse page headers to say "follow,noindex", and remove many of the inline rel="nofollow" attributes from the other pages. In addition, add a rel="canonical" link to the catalogue home page. Signed-off-by: Dan Scott Signed-off-by: Ben Shum Conflicts: Open-ILS/src/templates/opac/parts/record/subjects.tt2 --- Open-ILS/src/templates/opac/advanced.tt2 | 2 +- Open-ILS/src/templates/opac/browse.tt2 | 20 ++++++++++---------- Open-ILS/src/templates/opac/cnbrowse.tt2 | 2 +- Open-ILS/src/templates/opac/home.tt2 | 1 + Open-ILS/src/templates/opac/mylist.tt2 | 2 +- .../src/templates/opac/parts/advanced/search.tt2 | 2 +- Open-ILS/src/templates/opac/parts/record/authors.tt2 | 2 +- .../src/templates/opac/parts/record/cnbrowse.tt2 | 6 +++--- .../src/templates/opac/parts/record/navigation.tt2 | 6 +++--- Open-ILS/src/templates/opac/parts/record/series.tt2 | 2 +- .../src/templates/opac/parts/record/subjects.tt2 | 2 +- .../src/templates/opac/parts/result/paginate.tt2 | 6 +++--- Open-ILS/src/templates/opac/parts/searchbar.tt2 | 6 +++--- Open-ILS/src/templates/opac/results.tt2 | 14 +++++++------- 14 files changed, 37 insertions(+), 36 deletions(-) diff --git a/Open-ILS/src/templates/opac/advanced.tt2 b/Open-ILS/src/templates/opac/advanced.tt2 index 8efb9f2eed..de86006f49 100644 --- a/Open-ILS/src/templates/opac/advanced.tt2 +++ b/Open-ILS/src/templates/opac/advanced.tt2 @@ -5,7 +5,7 @@ pane = CGI.param("pane") || "advanced"; loc = ctx.search_ou; - ctx.metalinks.push(''); + ctx.metalinks.push(''); -%]

[% l('Advanced Search') %]

diff --git a/Open-ILS/src/templates/opac/browse.tt2 b/Open-ILS/src/templates/opac/browse.tt2 index 0626f429bd..9d58cd07a7 100644 --- a/Open-ILS/src/templates/opac/browse.tt2 +++ b/Open-ILS/src/templates/opac/browse.tt2 @@ -10,7 +10,7 @@ blimit = CGI.param('blimit') || ctx.opac_hits_per_page || 10; depart_list = ['blimit', 'bterm', 'bpivot']; - ctx.metalinks.push(''); + ctx.metalinks.push(''); %]

[% l('Catalog Browse') %]

@@ -18,9 +18,9 @@ [%# XXX TODO Give searchbar.tt2 more smarts so we can just do: # INCLUDE "opac/parts/searchbar.tt2" %] @@ -54,19 +54,19 @@ [% BLOCK browse_pager %]
[% IF ctx.back_pivot %] - ← [%l ('Back') %] + ← [%l ('Back') %] [% END %] [% IF ctx.pager_shortcuts; current_qtype = CGI.param('qtype') || 'title' %] [% FOR shortcut IN ctx.pager_shortcuts %] - [% shortcut.1 %] + [% shortcut.1 %] [% END %] [% END %] [% IF ctx.forward_pivot %] - [%l ('Next') %] → + [%l ('Next') %] → [% END %] [% alternative_link = BLOCK %] - [% ctx.browse_leading_article_alternative | html %] + [% ctx.browse_leading_article_alternative | html %] [%- END; # alternative_link BLOCK l("Did you mean [_1]?", alternative_link); END # IF %] @@ -108,7 +108,7 @@ [% result.value | html %] + }) %]">[% result.value | html %] ([% IF result.accurate == 'f'; l("At least"); " "; @@ -151,7 +151,7 @@ [% END %]
  • [% field.name %] - [% h.heading | html %] + [% h.heading | html %] ([% h.target_count %])
  • [% END %] @@ -187,7 +187,7 @@
      [% END %]
    • [% field.name %] - [% h.heading | html %] + [% h.heading | html %] ([% h.target_count %])
    • [% END %] diff --git a/Open-ILS/src/templates/opac/cnbrowse.tt2 b/Open-ILS/src/templates/opac/cnbrowse.tt2 index a0908f6a9c..3baa8c3118 100644 --- a/Open-ILS/src/templates/opac/cnbrowse.tt2 +++ b/Open-ILS/src/templates/opac/cnbrowse.tt2 @@ -3,7 +3,7 @@ PROCESS "opac/parts/header.tt2"; PROCESS "opac/parts/misc_util.tt2"; - ctx.metalinks.push(''); + ctx.metalinks.push(''); WRAPPER "opac/parts/base.tt2"; INCLUDE "opac/parts/topnav.tt2"; ctx.page_title = l("Call Number Browse"); %] diff --git a/Open-ILS/src/templates/opac/home.tt2 b/Open-ILS/src/templates/opac/home.tt2 index 3257ba46a9..77b1d511fb 100644 --- a/Open-ILS/src/templates/opac/home.tt2 +++ b/Open-ILS/src/templates/opac/home.tt2 @@ -2,6 +2,7 @@ WRAPPER "opac/parts/base.tt2"; INCLUDE "opac/parts/topnav.tt2"; ctx.page_title = l("Home") %] + ctx.metalinks.push('');

      [% l('Catalog Home') %]

      [% INCLUDE "opac/parts/searchbar.tt2" %]
      diff --git a/Open-ILS/src/templates/opac/mylist.tt2 b/Open-ILS/src/templates/opac/mylist.tt2 index 16488e2bc8..50578008b7 100644 --- a/Open-ILS/src/templates/opac/mylist.tt2 +++ b/Open-ILS/src/templates/opac/mylist.tt2 @@ -2,7 +2,7 @@ PROCESS "opac/parts/misc_util.tt2"; WRAPPER "opac/parts/base.tt2"; INCLUDE "opac/parts/topnav.tt2"; - ctx.metalinks.push(''); + ctx.metalinks.push(''); ctx.page_title = l("Record Detail") %]

      [% l('Temporary List') %]

      diff --git a/Open-ILS/src/templates/opac/parts/advanced/search.tt2 b/Open-ILS/src/templates/opac/parts/advanced/search.tt2 index 79ae4c45ba..ea0e25b69f 100644 --- a/Open-ILS/src/templates/opac/parts/advanced/search.tt2 +++ b/Open-ILS/src/templates/opac/parts/advanced/search.tt2 @@ -40,7 +40,7 @@ [% l('Clear Form') %] + class="opac-button">[% l('Clear Form') %]
      diff --git a/Open-ILS/src/templates/opac/parts/record/authors.tt2 b/Open-ILS/src/templates/opac/parts/record/authors.tt2 index fa8471ad3a..735b3ef1df 100644 --- a/Open-ILS/src/templates/opac/parts/record/authors.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/authors.tt2 @@ -114,7 +114,7 @@ BLOCK build_author_links; END; iprop = iprop _ '"'; END; - authtml = ' '; + authtml = ' '; IF iprop; authtml = authtml _ ''; END; authtml = authtml _ link_term.replace('^\s+', ''); IF iprop; authtml = authtml _ ''; END; diff --git a/Open-ILS/src/templates/opac/parts/record/cnbrowse.tt2 b/Open-ILS/src/templates/opac/parts/record/cnbrowse.tt2 index 2dba5e54cd..835eab3145 100644 --- a/Open-ILS/src/templates/opac/parts/record/cnbrowse.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/cnbrowse.tt2 @@ -12,12 +12,12 @@ [% l("<< Previous Page") %] + href="[% mkurl('', {cnoffset => cnoffset - 1}) %]#cnbrowse">[% l("<< Previous Page") %] [% l("Shelf Browser") %] [% l("Next Page >>") %] + href="[% mkurl('', {cnoffset => cnoffset + 1}) %]#cnbrowse">[% l("Next Page >>") %] @@ -47,7 +47,7 @@ href="[%- authorquery = rec_attrs.author | replace('[,\.:;]', ''); mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery, $loc_name => loc_value}, 1) - -%]" rel="nofollow" vocab="">[% rec_attrs.author | html %] + -%]">[% rec_attrs.author | html %]
      [% END %]
      [% cn.owning_lib.name | html %]
      diff --git a/Open-ILS/src/templates/opac/parts/record/navigation.tt2 b/Open-ILS/src/templates/opac/parts/record/navigation.tt2 index b93d6f47ff..003f6bdd59 100644 --- a/Open-ILS/src/templates/opac/parts/record/navigation.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/navigation.tt2 @@ -1,7 +1,7 @@ [% IF ctx.search_result_index.defined && ctx.search_result_index >= 0 %]
      - [% l('Search Results') %] + [% l('Search Results') %] [% l('Showing Item [_1] of [_2]', ctx.search_result_index + 1, ctx.hit_count) %] @@ -18,7 +18,7 @@ ctx.prev_rec_url = mkurl(ctx.prev_search_record, prev_args, stop_parms); %] [% l('Previous') %] + href='[% ctx.prev_rec_url %]'> [% l('Previous') %] [% END %] [% @@ -30,7 +30,7 @@ ctx.next_rec_url = mkurl(ctx.next_search_record, next_args, stop_parms); %] [% l('Next') %] + href='[% ctx.next_rec_url %]'>[% l('Next') %] [% END %]
      diff --git a/Open-ILS/src/templates/opac/parts/record/series.tt2 b/Open-ILS/src/templates/opac/parts/record/series.tt2 index 8f47bf6225..4be6b8326c 100644 --- a/Open-ILS/src/templates/opac/parts/record/series.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/series.tt2 @@ -26,7 +26,7 @@ BLOCK render_series; url = mkurl(ctx.opac_root _ '/results', { qtype=>'series', query=>total_term }, stop_parms.merge(expert_search_parms, general_search_parms, browse_search_parms, facet_search_parms) ); - series = series _ '' _ single_term _ ' '; + series = series _ '' _ single_term _ ' '; END; FOREACH link880 IN graphics; link = link880.value | html; diff --git a/Open-ILS/src/templates/opac/parts/record/subjects.tt2 b/Open-ILS/src/templates/opac/parts/record/subjects.tt2 index 9fd07c5f85..6b99b13f9d 100644 --- a/Open-ILS/src/templates/opac/parts/record/subjects.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/subjects.tt2 @@ -67,7 +67,7 @@ %][% single_term %] [%- + -%]">[% single_term %] [%- END; IF all_terms.size; "
      "; END; diff --git a/Open-ILS/src/templates/opac/parts/result/paginate.tt2 b/Open-ILS/src/templates/opac/parts/result/paginate.tt2 index cccf18bf4b..86de79894e 100644 --- a/Open-ILS/src/templates/opac/parts/result/paginate.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/paginate.tt2 @@ -24,7 +24,7 @@ href = mkurl('', {page => page - 1}); -%] [% l('Previous') %] + title='[% l("Previous page") %]'> [% l('Previous') %] [%- END; # show links to 4 previous pages, the current page, and 3 more pages. @@ -39,7 +39,7 @@ IF pageitr == page; %] [% pageitr + 1%] [% ELSE %] - [% pageitr + 1%] + [% pageitr + 1%] [% END; added = added + 1; IF added == 8; LAST; END; @@ -54,7 +54,7 @@ href = mkurl('', {page => page + 1}); -%] [% l('Next') %] + title='[% l("Next page") %]'> [% l('Next') %] [%- END; -%] diff --git a/Open-ILS/src/templates/opac/parts/searchbar.tt2 b/Open-ILS/src/templates/opac/parts/searchbar.tt2 index ac13ce0958..bd23358d45 100644 --- a/Open-ILS/src/templates/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates/opac/parts/searchbar.tt2 @@ -7,8 +7,8 @@ [% IF CGI.param('query') %] @@ -47,10 +47,10 @@
      [% END %] @@ -70,8 +70,8 @@ [%- IF show_more_details.default != 'hide' -%] [%- END -%] -- 2.11.0