vagejs 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +196 -25
- package/dist/checks/check.d.ts +2 -0
- package/dist/checks/check.js +106 -2
- package/dist/checks/crawlability.d.ts +34 -0
- package/dist/checks/crawlability.js +142 -0
- package/dist/checks/integrity.d.ts +36 -0
- package/dist/checks/integrity.js +145 -0
- package/dist/checks/links.d.ts +18 -0
- package/dist/checks/links.js +47 -0
- package/dist/checks/verify.d.ts +42 -0
- package/dist/checks/verify.js +264 -0
- package/dist/cli/index.js +118 -10
- package/dist/cli/info.d.ts +46 -0
- package/dist/cli/info.js +65 -5
- package/dist/content/images.d.ts +26 -0
- package/dist/content/images.js +129 -0
- package/dist/content/markdown.d.ts +4 -0
- package/dist/content/markdown.js +8 -1
- package/dist/content/optimize.d.ts +31 -0
- package/dist/content/optimize.js +92 -0
- package/dist/content/sanitize.d.ts +18 -2
- package/dist/content/sanitize.js +49 -9
- package/dist/core/build.js +11 -0
- package/dist/core/clone.d.ts +6 -0
- package/dist/core/clone.js +16 -0
- package/dist/core/config.d.ts +26 -0
- package/dist/core/config.js +43 -4
- package/dist/core/dates.d.ts +2 -0
- package/dist/core/dates.js +4 -0
- package/dist/core/errors.d.ts +2 -0
- package/dist/core/errors.js +3 -0
- package/dist/core/html.d.ts +22 -0
- package/dist/core/html.js +31 -0
- package/dist/core/pages.d.ts +67 -0
- package/dist/core/pages.js +168 -0
- package/dist/core/render.d.ts +24 -1
- package/dist/core/render.js +69 -10
- package/dist/core/site.d.ts +12 -1
- package/dist/core/site.js +77 -18
- package/dist/core/validate.d.ts +2 -0
- package/dist/core/validate.js +6 -0
- package/dist/deploy/cloudflare-pages.js +3 -1
- package/dist/deploy/cloudflare-workers.d.ts +59 -0
- package/dist/deploy/cloudflare-workers.js +223 -0
- package/dist/deploy/github-pages.js +2 -0
- package/dist/deploy/headers.js +1 -1
- package/dist/deploy/publish.d.ts +1 -1
- package/dist/deploy/publish.js +3 -3
- package/dist/deploy/redirects.js +1 -1
- package/dist/deploy/secrets.js +1 -1
- package/dist/dev/guard.d.ts +2 -0
- package/dist/dev/guard.js +30 -1
- package/dist/dev/server.js +22 -4
- package/dist/discovery/feed.d.ts +21 -0
- package/dist/discovery/feed.js +68 -0
- package/dist/discovery/git-dates.d.ts +10 -0
- package/dist/discovery/git-dates.js +57 -0
- package/dist/discovery/markdown-copy.d.ts +13 -0
- package/dist/discovery/markdown-copy.js +112 -0
- package/dist/guidelines/rule-pack.json +101 -2
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/integrations/api-keys.d.ts +1 -1
- package/dist/integrations/api-keys.js +1 -1
- package/dist/integrations/google-auth.js +1 -1
- package/dist/integrations/tags.d.ts +1 -1
- package/dist/integrations/tags.js +1 -1
- package/dist/seo/head.js +17 -1
- package/package.json +4 -1
- package/templates/starter/.github/dependabot.yml +11 -0
- package/templates/starter/.github/workflows/ci.yml +4 -0
- package/templates/starter/.github/workflows/verify.yml +34 -0
- package/templates/starter/AGENTS.md +45 -16
- package/templates/starter/links.lock.json +4 -0
- package/templates/starter/package.json +1 -1
- package/templates/starter/src/layouts/blog.ts +13 -0
- package/templates/starter/src/layouts/default.ts +8 -7
- package/templates/starter/src/pages/blog/index.md +7 -0
- package/templates/starter/src/pages/index.md +2 -2
- package/templates/starter/vage.config.ts +5 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { html, raw, type Layout } from "vagejs";
|
|
2
2
|
|
|
3
|
+
// `html` escapes every ${value}; `raw(content)` inserts the page's already-sanitized HTML.
|
|
3
4
|
const layout: Layout = ({ content, page, site }) => {
|
|
4
5
|
const title = site.title && site.title !== page.title ? `${page.title} | ${site.title}` : page.title;
|
|
5
|
-
return `<!doctype html>
|
|
6
|
-
<html lang="${
|
|
6
|
+
return html`<!doctype html>
|
|
7
|
+
<html lang="${site.lang}">
|
|
7
8
|
<head>
|
|
8
9
|
<meta charset="utf-8" />
|
|
9
10
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
10
|
-
<title>${
|
|
11
|
+
<title>${title}</title>
|
|
11
12
|
<link rel="icon" href="/favicon.ico" sizes="32x32" />
|
|
12
13
|
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
|
13
14
|
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
|
|
@@ -21,17 +22,17 @@ const layout: Layout = ({ content, page, site }) => {
|
|
|
21
22
|
<nav aria-label="Main">
|
|
22
23
|
<a href="/">Home</a>
|
|
23
24
|
<a href="/about/">About</a>
|
|
24
|
-
<a href="/blog/
|
|
25
|
+
<a href="/blog/">Blog</a>
|
|
25
26
|
</nav>
|
|
26
27
|
</header>
|
|
27
28
|
<main>
|
|
28
|
-
${content}
|
|
29
|
+
${raw(content)}
|
|
29
30
|
</main>
|
|
30
31
|
</body>
|
|
31
32
|
</html>
|
|
32
33
|
`;
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
//
|
|
36
|
+
// vagejs adds description, canonical, Open Graph and JSON-LD tags before </head>
|
|
36
37
|
// unless this layout already writes them.
|
|
37
38
|
export default layout;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Home
|
|
3
|
-
description: Welcome to my website, built with
|
|
3
|
+
description: Welcome to my website, built with vagejs.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Welcome
|
|
7
7
|
|
|
8
|
-
This site is built with
|
|
8
|
+
This site is built with vagejs. Edit `src/pages/index.md` and the page reloads automatically.
|
|
@@ -4,7 +4,7 @@ export default defineConfig({
|
|
|
4
4
|
// Your production origin. Needed for canonical URLs and sitemap.xml. Replace before deploying.
|
|
5
5
|
site: "https://example.com",
|
|
6
6
|
title: "My Website",
|
|
7
|
-
description: "A website built with
|
|
7
|
+
description: "A website built with vagejs.",
|
|
8
8
|
lang: "en",
|
|
9
9
|
|
|
10
10
|
seo: {
|
|
@@ -20,6 +20,10 @@ export default defineConfig({
|
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
22
|
|
|
23
|
+
// Spam protection: links to other websites must be approved in links.lock.json
|
|
24
|
+
// (npx vage links approve <domain>). "require" also fails if that file is deleted.
|
|
25
|
+
security: { outboundLinks: "require" },
|
|
26
|
+
|
|
23
27
|
// redirects: { "/old-page/": "/about/" },
|
|
24
28
|
|
|
25
29
|
// Analytics is off until you configure it. Tags are added to production builds only.
|