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.
Files changed (80) hide show
  1. package/README.md +196 -25
  2. package/dist/checks/check.d.ts +2 -0
  3. package/dist/checks/check.js +106 -2
  4. package/dist/checks/crawlability.d.ts +34 -0
  5. package/dist/checks/crawlability.js +142 -0
  6. package/dist/checks/integrity.d.ts +36 -0
  7. package/dist/checks/integrity.js +145 -0
  8. package/dist/checks/links.d.ts +18 -0
  9. package/dist/checks/links.js +47 -0
  10. package/dist/checks/verify.d.ts +42 -0
  11. package/dist/checks/verify.js +264 -0
  12. package/dist/cli/index.js +118 -10
  13. package/dist/cli/info.d.ts +46 -0
  14. package/dist/cli/info.js +65 -5
  15. package/dist/content/images.d.ts +26 -0
  16. package/dist/content/images.js +129 -0
  17. package/dist/content/markdown.d.ts +4 -0
  18. package/dist/content/markdown.js +8 -1
  19. package/dist/content/optimize.d.ts +31 -0
  20. package/dist/content/optimize.js +92 -0
  21. package/dist/content/sanitize.d.ts +18 -2
  22. package/dist/content/sanitize.js +49 -9
  23. package/dist/core/build.js +11 -0
  24. package/dist/core/clone.d.ts +6 -0
  25. package/dist/core/clone.js +16 -0
  26. package/dist/core/config.d.ts +26 -0
  27. package/dist/core/config.js +43 -4
  28. package/dist/core/dates.d.ts +2 -0
  29. package/dist/core/dates.js +4 -0
  30. package/dist/core/errors.d.ts +2 -0
  31. package/dist/core/errors.js +3 -0
  32. package/dist/core/html.d.ts +22 -0
  33. package/dist/core/html.js +31 -0
  34. package/dist/core/pages.d.ts +67 -0
  35. package/dist/core/pages.js +168 -0
  36. package/dist/core/render.d.ts +24 -1
  37. package/dist/core/render.js +69 -10
  38. package/dist/core/site.d.ts +12 -1
  39. package/dist/core/site.js +77 -18
  40. package/dist/core/validate.d.ts +2 -0
  41. package/dist/core/validate.js +6 -0
  42. package/dist/deploy/cloudflare-pages.js +3 -1
  43. package/dist/deploy/cloudflare-workers.d.ts +59 -0
  44. package/dist/deploy/cloudflare-workers.js +223 -0
  45. package/dist/deploy/github-pages.js +2 -0
  46. package/dist/deploy/headers.js +1 -1
  47. package/dist/deploy/publish.d.ts +1 -1
  48. package/dist/deploy/publish.js +3 -3
  49. package/dist/deploy/redirects.js +1 -1
  50. package/dist/deploy/secrets.js +1 -1
  51. package/dist/dev/guard.d.ts +2 -0
  52. package/dist/dev/guard.js +30 -1
  53. package/dist/dev/server.js +22 -4
  54. package/dist/discovery/feed.d.ts +21 -0
  55. package/dist/discovery/feed.js +68 -0
  56. package/dist/discovery/git-dates.d.ts +10 -0
  57. package/dist/discovery/git-dates.js +57 -0
  58. package/dist/discovery/markdown-copy.d.ts +13 -0
  59. package/dist/discovery/markdown-copy.js +112 -0
  60. package/dist/guidelines/rule-pack.json +101 -2
  61. package/dist/index.d.ts +4 -1
  62. package/dist/index.js +4 -1
  63. package/dist/integrations/api-keys.d.ts +1 -1
  64. package/dist/integrations/api-keys.js +1 -1
  65. package/dist/integrations/google-auth.js +1 -1
  66. package/dist/integrations/tags.d.ts +1 -1
  67. package/dist/integrations/tags.js +1 -1
  68. package/dist/seo/head.js +17 -1
  69. package/package.json +4 -1
  70. package/templates/starter/.github/dependabot.yml +11 -0
  71. package/templates/starter/.github/workflows/ci.yml +4 -0
  72. package/templates/starter/.github/workflows/verify.yml +34 -0
  73. package/templates/starter/AGENTS.md +45 -16
  74. package/templates/starter/links.lock.json +4 -0
  75. package/templates/starter/package.json +1 -1
  76. package/templates/starter/src/layouts/blog.ts +13 -0
  77. package/templates/starter/src/layouts/default.ts +8 -7
  78. package/templates/starter/src/pages/blog/index.md +7 -0
  79. package/templates/starter/src/pages/index.md +2 -2
  80. package/templates/starter/vage.config.ts +5 -1
@@ -1,13 +1,14 @@
1
- import { escapeHtml, type Layout } from "vagejs";
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="${escapeHtml(site.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>${escapeHtml(title)}</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/first-post/">Blog</a>
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
- // VAGE JS adds description, canonical, Open Graph and JSON-LD tags before </head>
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;
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: Blog
3
+ description: Posts from this site, newest first.
4
+ layout: blog
5
+ ---
6
+
7
+ # Blog
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: Home
3
- description: Welcome to my website, built with VAGE JS.
3
+ description: Welcome to my website, built with vagejs.
4
4
  ---
5
5
 
6
6
  # Welcome
7
7
 
8
- This site is built with VAGE JS. Edit `src/pages/index.md` and the page reloads automatically.
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 VAGE JS.",
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.