功能:添加 pjax/ajax
This commit is contained in:
1 parent
9d1ed54ad8
commit
703cc58d95
24 files changed
+976
-133
No files matched your search
@@ -24,6 +24,18 @@ let diagrams = 0;
|
||||
for (const [path, html] of pages) {
|
||||
const page = relative(root, path).split(sep).join('/');
|
||||
const base = new URL(page.replace(/index\.html$/, ''), origin);
|
||||
if (!/http-equiv="refresh"/i.test(html)) {
|
||||
if (!html.includes('name="astro-view-transitions-enabled"')) {
|
||||
errors.push(`${page}: missing client-side document navigation`);
|
||||
}
|
||||
const wordmark = html.match(/<svg\b[^>]*class="[^"]*\bsite-wordmark\b[^"]*"[^>]*>[\s\S]*?<\/svg>/)?.[0];
|
||||
if (!wordmark || !wordmark.includes('<path') || /<text\b|font-family|@font-face/i.test(wordmark)) {
|
||||
errors.push(`${page}: site wordmark must use static SVG paths without fonts`);
|
||||
}
|
||||
if (/fonts\.googleapis[^"<>]*(?:Manrope|Archivo)/i.test(html)) {
|
||||
errors.push(`${page}: unexpected wordmark font request`);
|
||||
}
|
||||
}
|
||||
if (html.includes('class="katex-error"')) errors.push(`${page}: invalid math`);
|
||||
if (/<style\b[^>]*\sset:html=/.test(html)) errors.push(`${page}: MDX emitted inert SVG styles`);
|
||||
const diagramCount = [...html.matchAll(/class="mermaid-diagram"/g)].length;
|
||||
|
||||
Reference in new issue
Block a user