Skip to content

Commit 3812225

Browse files
committed
Enforce trailing slashes to fix Search Console indexing issues
Set trailingSlash: 'always' in Astro config and update all internal links to use trailing slashes, avoiding unnecessary redirects on GitHub Pages.
1 parent 975b506 commit 3812225

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import sitemap from '@astrojs/sitemap';
55
export default defineConfig({
66
integrations: [tailwind(), sitemap()],
77
site: 'https://barbacane.dev',
8+
trailingSlash: 'always',
89
markdown: {
910
shikiConfig: {
1011
themes: {

src/layouts/Layout.astro

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ const structuredData = type === 'article' && article
121121
<div class="hidden md:flex items-center gap-8">
122122
<a href="/#features" class="text-foreground-muted hover:text-primary transition-colors">Features</a>
123123
<a href="/#use-cases" class="text-foreground-muted hover:text-primary transition-colors">Use Cases</a>
124-
<a href="/blog" class="text-foreground-muted hover:text-primary transition-colors">Blog</a>
125-
<a href="/pricing" class="text-foreground-muted hover:text-primary transition-colors">Services</a>
124+
<a href="/blog/" class="text-foreground-muted hover:text-primary transition-colors">Blog</a>
125+
<a href="/pricing/" class="text-foreground-muted hover:text-primary transition-colors">Services</a>
126126
<a href="https://github.com/barbacane-dev/barbacane" target="_blank" rel="noopener" class="text-foreground-muted hover:text-primary transition-colors">GitHub</a>
127127
</div>
128128

@@ -157,8 +157,8 @@ const structuredData = type === 'article' && article
157157
<div class="container-custom py-4 space-y-4">
158158
<a href="/#features" class="block text-foreground-muted hover:text-primary transition-colors py-2">Features</a>
159159
<a href="/#use-cases" class="block text-foreground-muted hover:text-primary transition-colors py-2">Use Cases</a>
160-
<a href="/blog" class="block text-foreground-muted hover:text-primary transition-colors py-2">Blog</a>
161-
<a href="/pricing" class="block text-foreground-muted hover:text-primary transition-colors py-2">Services</a>
160+
<a href="/blog/" class="block text-foreground-muted hover:text-primary transition-colors py-2">Blog</a>
161+
<a href="/pricing/" class="block text-foreground-muted hover:text-primary transition-colors py-2">Services</a>
162162
<a href="https://github.com/barbacane-dev/barbacane" target="_blank" rel="noopener" class="block text-foreground-muted hover:text-primary transition-colors py-2">GitHub</a>
163163
<a href="https://docs.barbacane.dev" class="block text-foreground-muted hover:text-primary transition-colors py-2">Documentation</a>
164164
<a href="/#get-started" class="block text-foreground-muted hover:text-primary transition-colors py-2">Get Started</a>
@@ -220,7 +220,7 @@ const structuredData = type === 'article' && article
220220
<h4 class="font-semibold mb-4">Product</h4>
221221
<ul class="space-y-2 text-foreground-muted">
222222
<li><a href="/#features" class="hover:text-primary transition-colors">Features</a></li>
223-
<li><a href="/blog" class="hover:text-primary transition-colors">Blog</a></li>
223+
<li><a href="/blog/" class="hover:text-primary transition-colors">Blog</a></li>
224224
<li><a href="https://docs.barbacane.dev" class="hover:text-primary transition-colors">Documentation</a></li>
225225
<li><a href="https://github.com/barbacane-dev/barbacane" class="hover:text-primary transition-colors">GitHub</a></li>
226226
</ul>
@@ -229,9 +229,9 @@ const structuredData = type === 'article' && article
229229
<div>
230230
<h4 class="font-semibold mb-4">Services</h4>
231231
<ul class="space-y-2 text-foreground-muted">
232-
<li><a href="/pricing#consulting" class="hover:text-primary transition-colors">Consulting</a></li>
233-
<li><a href="/pricing#support" class="hover:text-primary transition-colors">Pro Support</a></li>
234-
<li><a href="/pricing#training" class="hover:text-primary transition-colors">Training</a></li>
232+
<li><a href="/pricing/#consulting" class="hover:text-primary transition-colors">Consulting</a></li>
233+
<li><a href="/pricing/#support" class="hover:text-primary transition-colors">Pro Support</a></li>
234+
<li><a href="/pricing/#training" class="hover:text-primary transition-colors">Training</a></li>
235235
</ul>
236236
</div>
237237
</div>
@@ -241,7 +241,7 @@ const structuredData = type === 'article' && article
241241
&copy; {new Date().getFullYear()} Barbacane. Open source under Apache 2.0.
242242
</p>
243243
<p class="text-foreground-muted text-sm">
244-
<a href="/trademarks" class="hover:text-primary transition-colors">Trademark Policy</a>
244+
<a href="/trademarks/" class="hover:text-primary transition-colors">Trademark Policy</a>
245245
</p>
246246
</div>
247247
</div>

src/pages/blog/[slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const postUrl = `https://barbacane.dev/blog/${post.id}`;
113113

114114
<!-- Back to Blog -->
115115
<div class="max-w-3xl mx-auto mt-8 text-center">
116-
<a href="/blog" class="inline-flex items-center text-primary hover:underline text-sm">
116+
<a href="/blog/" class="inline-flex items-center text-primary hover:underline text-sm">
117117
<svg class="mr-1 w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
118118
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
119119
</svg>

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ import Layout from '../layouts/Layout.astro';
512512
<a href="https://docs.barbacane.dev/guide/getting-started.html" class="btn-primary text-lg px-8 py-4">
513513
Read the docs
514514
</a>
515-
<a href="/pricing" class="btn-secondary text-lg px-8 py-4">
515+
<a href="/pricing/" class="btn-secondary text-lg px-8 py-4">
516516
Need help? Talk to us
517517
</a>
518518
</div>

0 commit comments

Comments
 (0)