diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 2f9983f53..4db6df4a5 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -28,6 +28,8 @@ export interface AstroConfig { site?: string; /** Generate sitemap (set to "false" to disable) */ sitemap: boolean; + /** Automatically prefetch internal links (set to "false" to disable) */ + linkPrefetch?: boolean; }; /** Options for the development server run with `astro dev`. */ devOptions: { diff --git a/packages/astro/src/ast.ts b/packages/astro/src/ast.ts index f80084cb2..59fe24ae5 100644 --- a/packages/astro/src/ast.ts +++ b/packages/astro/src/ast.ts @@ -13,7 +13,10 @@ export function getAttr(attributes: Attribute[], name: string): Attribute | unde export function getAttrValue(attributes: Attribute[], name: string): string | undefined { const attr = getAttr(attributes, name); if (attr) { - return attr.value[0]?.data; + const child = attr.value[0]; + if (!child) return; + if (child.type === 'Text') return child.data; + if (child.type === 'MustacheTag') return child.expression.codeChunks[0]; } }