Skip to content

Commit 83467a6

Browse files
committed
feat(playground): add excludePatterns for static files and catch-all page
1 parent d244b1f commit 83467a6

File tree

10 files changed

+46
-0
lines changed

10 files changed

+46
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

playground/nuxt.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,12 @@ export default defineNuxtConfig({
9292
if (!selectedForm) return null
9393
return selectedForm.trim().replace('{count}', count.toString())
9494
},
95+
// Test excludePatterns functionality
96+
excludePatterns: [
97+
'/sitemap*.xml',
98+
'/robots.txt',
99+
'/api/**',
100+
/\.(pdf|doc)$/,
101+
],
95102
},
96103
})

playground/pages/[...path].vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<div>
3+
<h1>Catch-all Page</h1>
4+
<p>This page should only be reached for non-static files.</p>
5+
<p>Current path: {{ $route.fullPath }}</p>
6+
<p>If you see this page when accessing /sitemap-en.xml or /robots.txt, the exclusion is not working.</p>
7+
</div>
8+
</template>
9+
10+
<script setup>
11+
const route = useRoute()
12+
13+
// This should not be reached for static files
14+
console.log('Catch-all page reached for:', route.fullPath)
15+
</script>

playground/public/robots.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
User-agent: *
2+
Allow: /
3+
4+
Sitemap: http://localhost:3000/sitemap-en.xml

playground/public/sample.pdf

139 KB
Binary file not shown.

playground/public/sitemap-en.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<url>
4+
<loc>http://localhost:3000/</loc>
5+
<lastmod>2024-01-01</lastmod>
6+
<changefreq>daily</changefreq>
7+
<priority>1.0</priority>
8+
</url>
9+
<url>
10+
<loc>http://localhost:3000/en</loc>
11+
<lastmod>2024-01-01</lastmod>
12+
<changefreq>daily</changefreq>
13+
<priority>0.8</priority>
14+
</url>
15+
</urlset>

0 commit comments

Comments
 (0)