Skip to content

Commit 7b28e44

Browse files
committed
Provide canonical url for name index
1 parent 3b14bd5 commit 7b28e44

7 files changed

Lines changed: 10 additions & 7 deletions

File tree

app/controllers/names_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ def show
209209
format.html
210210
format.json
211211
format.pdf do
212-
response.set_header('Link', '<%s>; rel="cannonical"' % url_for(@name))
212+
response.set_header('Link', '<%s>; rel="canonical"' % url_for(@name))
213213
render(
214214
template: 'names/show_pdf.html.erb',
215215
pdf: "#{@name.name} | SeqCode Registry",

app/helpers/application_helper.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module ApplicationHelper
2-
def cannonical_url
3-
url_for(only_path: false, protocol: 'https', host: 'registry.seqco.de')
2+
def canonical_url(opts = {})
3+
url_for({
4+
only_path: false, protocol: 'https', host: 'registry.seqco.de'
5+
}.merge(opts))
46
end
57

68
def report_history(obj, text: 'Report history')

app/models/name.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ def is_variant?(alt_spelling)
661661
# This method always return +nil+ for names that are not at (inferred) rank
662662
# of genus or species
663663
#
664-
# Find names similar to the current one (using the cannonical spelling
664+
# Find names similar to the current one (using the canonical spelling
665665
# from +base_name+) with Levenshtein ≤ 3, considering a search space
666666
# defined by the taxonomic rank and +among+:
667667
# - valid: All validly published names of genera or species of the same genus

app/views/genomes/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% provide(:title, @genome.title) %>
2-
<% provide(:canonical_url, cannonical_url) %>
2+
<% provide(:canonical_url, canonical_url) %>
33

44
<%=
55
download_buttons([

app/views/names/index.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
npar[:sort] = @sort if @sort.present?
55
npar[:user] = @user.username if @user.present?
66
%>
7+
<% provide(:canonical_url, canonical_url(npar)) %>
78
<%= download_buttons(
89
[[names_url(npar.merge(format: :json)), 'file-code', 'JSON']]
910
) %>

app/views/names/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% provide(:title, @name.abbr_name_raw) %>
2-
<% provide(:canonical_url, cannonical_url) %>
2+
<% provide(:canonical_url, canonical_url) %>
33
<% provide(:description, @name.page_description) %>
44

55
<%= render(partial: 'title') %>

app/views/strains/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% provide(:title, @strain.title) %>
2-
<% provide(:canonical_url, cannonical_url) %>
2+
<% provide(:canonical_url, canonical_url) %>
33

44
<%=
55
download_buttons([

0 commit comments

Comments
 (0)