Fix robots.txt, minified assets and dead links in the preview build (#3079)

This commit is contained in:
Paweł Kuna authored and GitHub committed 2026-09-17 10:57:08 +02:00
1 parent 39e73cea60
commit 084d2021d3
13 files changed
+80 -30

No files matched your search

+3 -1
View File
@@ -1,5 +1,7 @@
---
// Legacy alias kept for old bookmarks and the downloadable package: the page
// moved to prose.html.
import RedirectLayout from '@shared/layouts/RedirectLayout.astro'
---
<RedirectLayout />
<RedirectLayout url="/prose.html" />
+5 -3
View File
@@ -3,15 +3,17 @@ import { site } from '@shared/lib/site'
export const prerender = true
// development, and crawling is allowed only in the preview environment.
// Vercel sets VERCEL_ENV to "production" on preview.tabler.io and to "preview"
// on branch deploys; it is unset locally. Only production may be crawled,
// and the sitemap URL is absolute outside development.
export const GET: APIRoute = () => {
const environment = process.env.NODE_ENV || 'production'
const isProduction = process.env.VERCEL_ENV === 'production'
const sitemapBase = environment !== 'development' ? site.previewUrl : ''
const body = `Sitemap: ${sitemapBase}/sitemap.xml
User-agent: *
Disallow:${environment === 'preview' ? '' : ' /'}
Disallow:${isProduction ? '' : ' /'}
`
return new Response(body, {
+4 -2
View File
@@ -3,7 +3,9 @@ import { site } from '@shared/lib/site'
export const prerender = true
// Index pages collapse to directory URLs (build.format 'file').
// build.format 'file' emits x/index.astro as x.html (the hosting serves no
// x/ directory), so nested index pages collapse to that file; the root index
// stays "/".
const pages = import.meta.glob('./**/*.astro')
const urls = Object.keys(pages)
@@ -16,7 +18,7 @@ const urls = Object.keys(pages)
})
.map((path) => {
if (path === 'index.html') return '/'
if (path.endsWith('/index.html')) return `/${path.slice(0, -'index.html'.length)}`
if (path.endsWith('/index.html')) return `/${path.slice(0, -'/index.html'.length)}.html`
return `/${path}`
})
+1 -1
View File
@@ -18,7 +18,7 @@ import Icon from '@ui/Icon.astro'
<Card>
<CardHeader title="Product Tour Example">
<CardActions>
<Button id="start-tour" text="Start Tour" icon="play" color="primary" element="button" />
<Button id="start-tour" text="Start Tour" icon="player-play" color="primary" element="button" />
</CardActions>
</CardHeader>
<CardBody>