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

+1 -1
View File
@@ -314,7 +314,7 @@
},
"marketing": {
"title": "Marketing",
"url": "marketing/index.html"
"url": "marketing.html"
},
"music": {
"title": "Music",
+6 -5
View File
@@ -28,9 +28,10 @@ const { title, pageLibs = [], bodyClass, rtl = false, base = '.', description, t
// script runs, so a page keeps its variant until the visitor chooses otherwise.
const themeAttributes = themeDataAttributes(themeSettings)
// Development build: unminified assets, dev favicon.
const environment = 'development'
const min = environment === 'development' ? '' : '.min'
// Development build: unminified assets, dev favicon (same rule as DocsLayout).
const environment = process.env.NODE_ENV || 'production'
const isDevelopment = environment === 'development'
const min = isDevelopment ? '' : '.min'
// RTL swaps tabler/plugin stylesheets for their .rtl.css variants (demo stays LTR)
const rtlSuffix = rtl ? '.rtl' : ''
@@ -55,8 +56,8 @@ const libJsFiles = (head: boolean) => pageLibEntries.filter(([, lib]) => Boolean
<title>{title ? `${title} - ` : ''}{site.title} - {site.descriptionShort}</title>
<meta name="description" content={description ?? site.descriptionShort} />
<link rel="icon" href={`${base}/favicon-dev.ico`} type="image/x-icon" />
<link rel="shortcut icon" href={`${base}/favicon-dev.ico`} type="image/x-icon" />
<link rel="icon" href={`${base}/favicon${isDevelopment ? '-dev' : ''}.ico`} type="image/x-icon" />
<link rel="shortcut icon" href={`${base}/favicon${isDevelopment ? '-dev' : ''}.ico`} type="image/x-icon" />
<!-- END META -->
{
+7 -2
View File
@@ -24,8 +24,13 @@ const FILLER_PATH = /<path stroke="none" d="M0 0h24v24H0z" fill="none"\s*\/>/
* aria-hidden="true" focusable="false" and the given classes.
*/
export function iconSvg(name: string, { filled = false, classes = 'icon' }: { filled?: boolean | undefined; classes?: string | undefined } = {}): string | undefined {
const icon = (icons as unknown as Record<string, IconRecord>)[name]
if (!icon) return undefined
const icon = (icons as unknown as Record<string, IconRecord | undefined>)[name]
if (!icon) {
// Icon.astro renders nothing for an unknown name, which is invisible in the
// page; say so in the build log instead of failing silently.
console.warn(`[svg] unknown Tabler icon "${name}"`)
return undefined
}
let svg = icon.svg?.[filled ? 'filled' : 'outline'] ?? ''
svg = svg.replace(FILLER_PATH, '')
svg = svg.replace(/class="[^"]+"/, `aria-hidden="true" focusable="false" class="${classes}"`)