Skip to content

Commit fea1505

Browse files
committed
Fix SEO indexing issues (trailing slashes, sitemap, meta tags)
- Add trailing slashes to /acp/ and /solawi/ URLs everywhere (locales, sitemap, layout, header, footer) to avoid GitHub Pages 301 redirects - Add self-referencing hreflang to each sitemap entry per Google/Bing spec - Fix og:image and twitter:image pointing to non-existent og-image.png, use logo.png (1024x1024) instead - Fix JSON-LD logo URL that was 404 due to asset hashing - Exclude logo.png from asset hashing for stable absolute URLs - Fix og:locale format (en -> en_US, fr -> fr_FR, de -> de_DE) - Switch twitter:card from summary_large_image to summary (square logo) - Remove deprecated content-language and X-UA-Compatible meta tags
1 parent c84a71a commit fea1505

File tree

8 files changed

+41
-38
lines changed

8 files changed

+41
-38
lines changed

config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
configure :build do
2323
set :asset_host, @app.data.site.host
2424
set :relative_links, true
25-
activate :asset_hash
25+
activate :asset_hash, ignore: %w[images/logo.png]
2626
activate :directory_indexes
2727
activate :gzip
2828
activate :relative_assets

locales/de.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ de:
6161
site:
6262
description: Open-Source-Webanwendung für effiziente Solawi-Verwaltung (Solidarische Landwirtschaft). Vereinfachen Sie Ihre Abläufe – Demo jetzt anfordern!
6363
title: "CSA Admin - Effizientere Verwaltung Ihrer Solawi"
64-
path: /solawi
64+
path: /solawi/
6565
subtitle: Seit 2014 nutzen %{orgs_link} CSA Admin, um ihre täglichen Aufgaben zu erleichtern und die jährliche Verteilung von über <span class='font-semibold'>%{baskets_count} Anteilen</span> zu verwalten. Schließen Sie sich ihnen an!
6666
subtitle_orgs_link: <span class="whitespace-nowrap">zahlreiche Organisationen</span>
6767
title: Effizientere <span class="whitespace-nowrap">%{org_name}-Verwaltung.</span>

locales/fr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fr:
6161
site:
6262
description: Application web open source pour gérer efficacement votre ACP (Agriculture Contractuelle de Proximité). Simplifiez vos opérations, demandez une démo!
6363
title: CSA Admin - Simplifiez la gestion de votre ACP
64-
path: /acp
64+
path: /acp/
6565
subtitle: Depuis 2014, %{orgs_link} utilisent CSA Admin pour faciliter leurs tâches quotidiennes et gérer la distribution annuelle de plus de <span class='font-semibold'>%{baskets_count} paniers</span>. Rejoignez-les !
6666
subtitle_orgs_link: <span class="whitespace-nowrap">de nombreuses organisations</span>
6767
title: Simplifiez la gestion de <span class="whitespace-nowrap">votre %{org_name}.</span>

source/_footer.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
/
88
</li>
99
<li>
10-
<%= link_to "FR", '/acp', class: "font-semibold p-1 #{"active" unless current_page?('/acp') }" %>
10+
<%= link_to "FR", '/acp/', class: "font-semibold p-1 #{"active" unless current_page?('/acp/') }" %>
1111
</li>
1212
<li class="text-gray-400 font-extralight text-xs">
1313
/
1414
</li>
1515
<li>
16-
<%= link_to 'DE', '/solawi', class: "font-semibold p-1 #{"active" unless current_page?('/solawi') }" %>
16+
<%= link_to 'DE', '/solawi/', class: "font-semibold p-1 #{"active" unless current_page?('/solawi/') }" %>
1717
</li>
1818
</ul>
1919

source/_header.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
/
1010
</span>
1111
<span>
12-
<%= link_to "ACP", "/acp", class: "font-bold #{"no-underline" unless I18n.locale == :fr} decoration-2 hover:underline" %>
12+
<%= link_to "ACP", "/acp/", class: "font-bold #{"no-underline" unless I18n.locale == :fr} decoration-2 hover:underline" %>
1313
</span>
1414
<span class="font-extralight text-base px-1 md:px-2">
1515
/
1616
</span>
1717
<span>
18-
<%= link_to "Solawi", "/solawi", class: "font-bold #{"no-underline" unless I18n.locale == :de} decoration-2 hover:underline" %>
18+
<%= link_to "Solawi", "/solawi/", class: "font-bold #{"no-underline" unless I18n.locale == :de} decoration-2 hover:underline" %>
1919
</span>
2020
<span class="ml-3">
2121
Admin

source/images/logo.png

10.5 KB
Loading

source/layouts/layout.erb

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<head>
44
<title><%= t('site.title') %></title>
55
<meta charset="utf-8">
6-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7-
<meta http-equiv="content-language" content="<%= I18n.locale %>">
86
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
97
<meta name="description" content="<%= t('site.description') %>">
108
<meta name="author" content="<%= data.site.author.name %>">
@@ -16,24 +14,24 @@
1614
<meta property="og:description" content="<%= t('site.description') %>">
1715
<meta property="og:url" content="https://csa-admin.org<%= t('site.path') %>">
1816
<meta property="og:site_name" content="<%= data.site.name %>">
19-
<meta property="og:image" content="https://csa-admin.org/images/og-image.png">
20-
<meta property="og:image:width" content="1200">
21-
<meta property="og:image:height" content="630">
22-
<meta property="og:locale" content="<%= I18n.locale %>">
23-
<meta property="og:locale:alternate" content="en">
24-
<meta property="og:locale:alternate" content="fr">
25-
<meta property="og:locale:alternate" content="de">
17+
<meta property="og:image" content="https://csa-admin.org/images/logo.png">
18+
<meta property="og:image:width" content="1024">
19+
<meta property="og:image:height" content="1024">
20+
<meta property="og:locale" content="<%= { en: 'en_US', fr: 'fr_FR', de: 'de_DE' }[I18n.locale] %>">
21+
<% ({ en: 'en_US', fr: 'fr_FR', de: 'de_DE' }.except(I18n.locale)).each_value do |locale| %>
22+
<meta property="og:locale:alternate" content="<%= locale %>">
23+
<% end %>
2624

2725
<!-- Twitter Card -->
28-
<meta name="twitter:card" content="summary_large_image">
26+
<meta name="twitter:card" content="summary">
2927
<meta name="twitter:title" content="<%= t('site.title') %>">
3028
<meta name="twitter:description" content="<%= t('site.description') %>">
31-
<meta name="twitter:image" content="https://csa-admin.org/images/og-image.png">
29+
<meta name="twitter:image" content="https://csa-admin.org/images/logo.png">
3230

3331
<link rel="canonical" href="https://csa-admin.org<%= t('site.path') %>">
3432
<link rel="alternate" hreflang="en" href="https://csa-admin.org">
35-
<link rel="alternate" hreflang="fr" href="https://csa-admin.org/acp">
36-
<link rel="alternate" hreflang="de" href="https://csa-admin.org/solawi">
33+
<link rel="alternate" hreflang="fr" href="https://csa-admin.org/acp/">
34+
<link rel="alternate" hreflang="de" href="https://csa-admin.org/solawi/">
3735
<link rel="alternate" hreflang="x-default" href="https://csa-admin.org">
3836

3937
<script type="application/ld+json">
@@ -91,7 +89,7 @@
9189
},
9290
{
9391
"@type": "WebPage",
94-
"@id": "https://csa-admin.org<%= t('site.path') %>/#webpage",
92+
"@id": "https://csa-admin.org<%= t('site.path') %>#webpage",
9593
"url": "https://csa-admin.org<%= t('site.path') %>",
9694
"name": "<%= t('site.title') %>",
9795
"description": "<%= t('site.description').gsub('"', '\\"') %>",

source/sitemap.xml.builder

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
xml.instruct!
2-
xml.urlset("xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9", "xmlns:xhtml" => "http://www.w3.org/1999/xhtml") do
2+
xml.urlset('xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9', 'xmlns:xhtml' => 'http://www.w3.org/1999/xhtml') do
33
xml.url do
4-
xml.loc "https://csa-admin.org"
5-
xml.changefreq "weekly"
6-
xml.priority "1.0"
7-
xml.tag!("xhtml:link", rel: "alternate", hreflang: "fr", href: "https://csa-admin.org/acp")
8-
xml.tag!("xhtml:link", rel: "alternate", hreflang: "de", href: "https://csa-admin.org/solawi")
9-
xml.tag!("xhtml:link", rel: "alternate", hreflang: "x-default", href: "https://csa-admin.org")
4+
xml.loc 'https://csa-admin.org'
5+
xml.changefreq 'weekly'
6+
xml.priority '1.0'
7+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'en', href: 'https://csa-admin.org')
8+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'fr', href: 'https://csa-admin.org/acp/')
9+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'de', href: 'https://csa-admin.org/solawi/')
10+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'x-default', href: 'https://csa-admin.org')
1011
end
1112

1213
xml.url do
13-
xml.loc "https://csa-admin.org/acp"
14-
xml.changefreq "weekly"
15-
xml.priority "0.9"
16-
xml.tag!("xhtml:link", rel: "alternate", hreflang: "en", href: "https://csa-admin.org")
17-
xml.tag!("xhtml:link", rel: "alternate", hreflang: "de", href: "https://csa-admin.org/solawi")
14+
xml.loc 'https://csa-admin.org/acp/'
15+
xml.changefreq 'weekly'
16+
xml.priority '0.9'
17+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'en', href: 'https://csa-admin.org')
18+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'fr', href: 'https://csa-admin.org/acp/')
19+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'de', href: 'https://csa-admin.org/solawi/')
20+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'x-default', href: 'https://csa-admin.org')
1821
end
1922

2023
xml.url do
21-
xml.loc "https://csa-admin.org/solawi"
22-
xml.changefreq "weekly"
23-
xml.priority "0.9"
24-
xml.tag!("xhtml:link", rel: "alternate", hreflang: "en", href: "https://csa-admin.org")
25-
xml.tag!("xhtml:link", rel: "alternate", hreflang: "fr", href: "https://csa-admin.org/acp")
24+
xml.loc 'https://csa-admin.org/solawi/'
25+
xml.changefreq 'weekly'
26+
xml.priority '0.9'
27+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'en', href: 'https://csa-admin.org')
28+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'fr', href: 'https://csa-admin.org/acp/')
29+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'de', href: 'https://csa-admin.org/solawi/')
30+
xml.tag!('xhtml:link', rel: 'alternate', hreflang: 'x-default', href: 'https://csa-admin.org')
2631
end
2732
end

0 commit comments

Comments
 (0)