@beforesemicolon/builder 1.8.13 → 1.8.18
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/dist/cjs/docs/run.js +15 -13
- package/dist/cjs/docs/templates/fading-citrus/README.md +8 -6
- package/dist/cjs/docs/templates/fading-citrus/assets/logo.dark.svg +8 -0
- package/dist/cjs/docs/templates/fading-citrus/assets/logo.light.svg +8 -0
- package/dist/cjs/docs/templates/fading-citrus/layouts/_footer.js +7 -3
- package/dist/cjs/docs/templates/fading-citrus/layouts/_head-meta.js +3 -2
- package/dist/cjs/docs/templates/fading-citrus/layouts/_header.js +6 -1
- package/dist/cjs/docs/templates/fading-citrus/layouts/document.js +2 -1
- package/dist/cjs/docs/templates/fading-citrus/layouts/landing.js +3 -1
- package/dist/cjs/docs/templates/fading-citrus/stylesheets/common.css +132 -49
- package/dist/cjs/docs/templates/fading-citrus/stylesheets/documentation.css +32 -24
- package/dist/cjs/docs/templates/fading-citrus/stylesheets/github-dark.hightlighter.css +12 -12
- package/dist/cjs/docs/templates/fading-citrus/stylesheets/github-light.hightlighter.css +22 -22
- package/dist/cjs/docs/templates/fading-citrus/stylesheets/landing.css +74 -87
- package/dist/cjs/docs/templates/fading-citrus/template.config.js +106 -15
- package/dist/cjs/docs/types.js +1 -1
- package/dist/esm/docs/run.js +16 -14
- package/dist/esm/docs/templates/fading-citrus/README.md +8 -6
- package/dist/esm/docs/templates/fading-citrus/assets/logo.dark.svg +8 -0
- package/dist/esm/docs/templates/fading-citrus/assets/logo.light.svg +8 -0
- package/dist/esm/docs/templates/fading-citrus/layouts/_footer.js +7 -3
- package/dist/esm/docs/templates/fading-citrus/layouts/_head-meta.js +3 -2
- package/dist/esm/docs/templates/fading-citrus/layouts/_header.js +6 -1
- package/dist/esm/docs/templates/fading-citrus/layouts/document.js +2 -1
- package/dist/esm/docs/templates/fading-citrus/layouts/landing.js +3 -1
- package/dist/esm/docs/templates/fading-citrus/stylesheets/common.css +132 -49
- package/dist/esm/docs/templates/fading-citrus/stylesheets/documentation.css +32 -24
- package/dist/esm/docs/templates/fading-citrus/stylesheets/github-dark.hightlighter.css +12 -12
- package/dist/esm/docs/templates/fading-citrus/stylesheets/github-light.hightlighter.css +22 -22
- package/dist/esm/docs/templates/fading-citrus/stylesheets/landing.css +74 -87
- package/dist/esm/docs/templates/fading-citrus/template.config.js +106 -15
- package/dist/types/docs/types.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/docs/templates/fading-citrus/assets/before-semicolon-logo.png +0 -0
- package/dist/esm/docs/templates/fading-citrus/assets/before-semicolon-logo.png +0 -0
|
@@ -50,62 +50,153 @@ export default {
|
|
|
50
50
|
light: {
|
|
51
51
|
'--background': 'oklch(0.98 0.006 250)',
|
|
52
52
|
'--foreground': 'oklch(0.18 0.015 250)',
|
|
53
|
+
'--heading': 'var(--foreground)',
|
|
53
54
|
'--card': 'oklch(1 0 0)',
|
|
54
55
|
'--primary': 'oklch(0.66 0.18 45)',
|
|
55
56
|
'--primary-glow': 'oklch(0.72 0.19 50)',
|
|
56
57
|
'--primary-foreground': 'oklch(0.98 0.006 250)',
|
|
58
|
+
'--primary-soft':
|
|
59
|
+
'color-mix(in oklch, var(--primary) 12%, transparent)',
|
|
60
|
+
'--primary-softer':
|
|
61
|
+
'color-mix(in oklch, var(--primary) 6%, transparent)',
|
|
62
|
+
'--primary-border':
|
|
63
|
+
'color-mix(in oklch, var(--primary) 45%, transparent)',
|
|
57
64
|
'--secondary': 'oklch(0.93 0.01 250)',
|
|
58
65
|
'--muted': 'oklch(0.94 0.01 250)',
|
|
59
66
|
'--muted-foreground': 'oklch(0.42 0.02 250)',
|
|
60
67
|
'--accent': 'oklch(0.58 0.16 200)',
|
|
68
|
+
'--accent-soft':
|
|
69
|
+
'color-mix(in oklch, var(--accent) 12%, transparent)',
|
|
70
|
+
'--accent-softer':
|
|
71
|
+
'color-mix(in oklch, var(--accent) 6%, transparent)',
|
|
72
|
+
'--accent-border':
|
|
73
|
+
'color-mix(in oklch, var(--accent) 35%, transparent)',
|
|
61
74
|
'--border': 'oklch(0.86 0.018 250)',
|
|
62
75
|
'--ring': 'oklch(0.66 0.18 45)',
|
|
63
|
-
'--
|
|
76
|
+
'--surface': 'color-mix(in oklch, var(--card) 84%, transparent)',
|
|
77
|
+
'--surface-muted':
|
|
78
|
+
'color-mix(in oklch, var(--muted) 78%, transparent)',
|
|
79
|
+
'--surface-hover':
|
|
80
|
+
'color-mix(in oklch, var(--primary) 8%, var(--card))',
|
|
81
|
+
'--surface-border':
|
|
82
|
+
'color-mix(in oklch, var(--border) 78%, transparent)',
|
|
83
|
+
'--surface-border-strong':
|
|
84
|
+
'color-mix(in oklch, var(--foreground) 20%, transparent)',
|
|
85
|
+
'--header-bg':
|
|
86
|
+
'color-mix(in oklch, var(--background) 72%, transparent)',
|
|
87
|
+
'--footer-bg':
|
|
88
|
+
'color-mix(in oklch, var(--background) 96%, var(--foreground) 4%)',
|
|
89
|
+
'--grid-line':
|
|
90
|
+
'color-mix(in oklch, var(--foreground) 7%, transparent)',
|
|
91
|
+
'--inline-code-bg':
|
|
92
|
+
'color-mix(in oklch, var(--background) 92%, var(--foreground) 8%)',
|
|
93
|
+
'--code-bg':
|
|
94
|
+
'color-mix(in oklch, var(--background) 94%, var(--foreground) 6%)',
|
|
95
|
+
'--code-header-bg':
|
|
96
|
+
'color-mix(in oklch, var(--code-bg) 88%, var(--foreground) 12%)',
|
|
97
|
+
'--code-border': 'var(--surface-border)',
|
|
98
|
+
'--code-line-number':
|
|
99
|
+
'color-mix(in oklch, var(--muted-foreground) 65%, transparent)',
|
|
100
|
+
'--success': 'oklch(0.58 0.16 145)',
|
|
101
|
+
'--success-soft':
|
|
102
|
+
'color-mix(in oklch, var(--success) 14%, transparent)',
|
|
103
|
+
'--warning': 'oklch(0.64 0.15 90)',
|
|
104
|
+
'--warning-soft':
|
|
105
|
+
'color-mix(in oklch, var(--warning) 14%, transparent)',
|
|
106
|
+
'--danger': 'oklch(0.58 0.2 25)',
|
|
107
|
+
'--danger-soft':
|
|
108
|
+
'color-mix(in oklch, var(--danger) 14%, transparent)',
|
|
64
109
|
'--syntax-comment': 'oklch(0.55 0.02 250)',
|
|
65
|
-
'--syntax-keyword': '
|
|
66
|
-
'--syntax-string': '
|
|
67
|
-
'--syntax-tag': '
|
|
68
|
-
'--syntax-attr': '
|
|
110
|
+
'--syntax-keyword': 'var(--primary)',
|
|
111
|
+
'--syntax-string': 'var(--success)',
|
|
112
|
+
'--syntax-tag': 'var(--accent)',
|
|
113
|
+
'--syntax-attr': 'var(--warning)',
|
|
69
114
|
'--gradient-hero':
|
|
70
|
-
'radial-gradient(ellipse at top,
|
|
115
|
+
'radial-gradient(ellipse at top, color-mix(in oklch, var(--primary) 26%, transparent), transparent 60%)',
|
|
71
116
|
'--gradient-primary':
|
|
72
117
|
'linear-gradient(135deg, var(--primary), var(--primary-glow))',
|
|
73
118
|
'--gradient-text':
|
|
74
119
|
'linear-gradient(135deg, oklch(0.18 0.015 250), oklch(0.35 0.03 250))',
|
|
75
120
|
'--gradient-border':
|
|
76
|
-
'linear-gradient(135deg, oklch(
|
|
77
|
-
'--shadow-glow':
|
|
121
|
+
'linear-gradient(135deg, color-mix(in oklch, var(--primary) 45%, transparent), color-mix(in oklch, var(--accent) 25%, transparent))',
|
|
122
|
+
'--shadow-glow':
|
|
123
|
+
'0 0 60px -15px color-mix(in oklch, var(--primary) 35%, transparent)',
|
|
78
124
|
'--shadow-card':
|
|
79
125
|
'0 1px 0 0 oklch(1 0 0 / 0.75) inset, 0 20px 40px -20px oklch(0.18 0.015 250 / 0.18)',
|
|
80
126
|
},
|
|
81
127
|
dark: {
|
|
82
128
|
'--background': 'oklch(0.18 0.015 250)',
|
|
83
129
|
'--foreground': 'oklch(0.96 0.005 250)',
|
|
130
|
+
'--heading': 'var(--foreground)',
|
|
84
131
|
'--card': 'oklch(0.22 0.018 250)',
|
|
85
132
|
'--primary': 'oklch(0.74 0.18 45)',
|
|
86
133
|
'--primary-glow': 'oklch(0.78 0.19 50)',
|
|
87
134
|
'--primary-foreground': 'oklch(0.18 0.02 250)',
|
|
135
|
+
'--primary-soft':
|
|
136
|
+
'color-mix(in oklch, var(--primary) 12%, transparent)',
|
|
137
|
+
'--primary-softer':
|
|
138
|
+
'color-mix(in oklch, var(--primary) 6%, transparent)',
|
|
139
|
+
'--primary-border':
|
|
140
|
+
'color-mix(in oklch, var(--primary) 45%, transparent)',
|
|
88
141
|
'--secondary': 'oklch(0.27 0.02 250)',
|
|
89
142
|
'--muted': 'oklch(0.25 0.018 250)',
|
|
90
143
|
'--muted-foreground': 'oklch(0.68 0.02 250)',
|
|
91
144
|
'--accent': 'oklch(0.7 0.16 200)',
|
|
145
|
+
'--accent-soft':
|
|
146
|
+
'color-mix(in oklch, var(--accent) 12%, transparent)',
|
|
147
|
+
'--accent-softer':
|
|
148
|
+
'color-mix(in oklch, var(--accent) 6%, transparent)',
|
|
149
|
+
'--accent-border':
|
|
150
|
+
'color-mix(in oklch, var(--accent) 35%, transparent)',
|
|
92
151
|
'--border': 'oklch(0.3 0.02 250)',
|
|
93
152
|
'--ring': 'oklch(0.74 0.18 45)',
|
|
153
|
+
'--surface': 'color-mix(in oklch, var(--card) 40%, transparent)',
|
|
154
|
+
'--surface-muted':
|
|
155
|
+
'color-mix(in oklch, var(--card) 60%, transparent)',
|
|
156
|
+
'--surface-hover':
|
|
157
|
+
'color-mix(in oklch, var(--card) 70%, transparent)',
|
|
158
|
+
'--surface-border':
|
|
159
|
+
'color-mix(in oklch, var(--border) 65%, transparent)',
|
|
160
|
+
'--surface-border-strong':
|
|
161
|
+
'color-mix(in oklch, var(--foreground) 20%, transparent)',
|
|
162
|
+
'--header-bg':
|
|
163
|
+
'color-mix(in oklch, var(--background) 60%, transparent)',
|
|
164
|
+
'--footer-bg':
|
|
165
|
+
'color-mix(in oklch, var(--background) 88%, black 12%)',
|
|
166
|
+
'--grid-line':
|
|
167
|
+
'color-mix(in oklch, var(--foreground) 5%, transparent)',
|
|
168
|
+
'--inline-code-bg':
|
|
169
|
+
'color-mix(in oklch, var(--background) 82%, var(--foreground) 8%)',
|
|
94
170
|
'--code-bg': 'oklch(0.16 0.015 250)',
|
|
171
|
+
'--code-header-bg':
|
|
172
|
+
'color-mix(in oklch, var(--card) 60%, transparent)',
|
|
173
|
+
'--code-border': 'var(--surface-border)',
|
|
174
|
+
'--code-line-number':
|
|
175
|
+
'color-mix(in oklch, var(--muted-foreground) 65%, transparent)',
|
|
176
|
+
'--success': 'oklch(0.78 0.15 145)',
|
|
177
|
+
'--success-soft':
|
|
178
|
+
'color-mix(in oklch, var(--success) 14%, transparent)',
|
|
179
|
+
'--warning': 'oklch(0.78 0.14 90)',
|
|
180
|
+
'--warning-soft':
|
|
181
|
+
'color-mix(in oklch, var(--warning) 14%, transparent)',
|
|
182
|
+
'--danger': 'oklch(0.62 0.22 25)',
|
|
183
|
+
'--danger-soft':
|
|
184
|
+
'color-mix(in oklch, var(--danger) 14%, transparent)',
|
|
95
185
|
'--syntax-comment': 'oklch(0.55 0.02 250)',
|
|
96
|
-
'--syntax-keyword': '
|
|
97
|
-
'--syntax-string': '
|
|
98
|
-
'--syntax-tag': '
|
|
99
|
-
'--syntax-attr': '
|
|
186
|
+
'--syntax-keyword': 'var(--primary)',
|
|
187
|
+
'--syntax-string': 'var(--success)',
|
|
188
|
+
'--syntax-tag': 'var(--accent)',
|
|
189
|
+
'--syntax-attr': 'var(--warning)',
|
|
100
190
|
'--gradient-hero':
|
|
101
|
-
'radial-gradient(ellipse at top,
|
|
191
|
+
'radial-gradient(ellipse at top, color-mix(in oklch, var(--primary) 26%, transparent), transparent 60%)',
|
|
102
192
|
'--gradient-primary':
|
|
103
193
|
'linear-gradient(135deg, var(--primary), var(--primary-glow))',
|
|
104
194
|
'--gradient-text':
|
|
105
195
|
'linear-gradient(135deg, oklch(0.98 0.005 250), oklch(0.78 0.05 250))',
|
|
106
196
|
'--gradient-border':
|
|
107
|
-
'linear-gradient(135deg,
|
|
108
|
-
'--shadow-glow':
|
|
197
|
+
'linear-gradient(135deg, color-mix(in oklch, var(--primary) 50%, transparent), color-mix(in oklch, var(--accent) 30%, transparent))',
|
|
198
|
+
'--shadow-glow':
|
|
199
|
+
'0 0 60px -15px color-mix(in oklch, var(--primary) 50%, transparent)',
|
|
109
200
|
'--shadow-card':
|
|
110
201
|
'0 1px 0 0 oklch(1 0 0 / 0.05) inset, 0 20px 40px -20px oklch(0 0 0 / 0.5)',
|
|
111
202
|
},
|
package/dist/cjs/docs/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var
|
|
1
|
+
"use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var p=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of a(t))!g.call(e,r)&&r!==o&&i(e,r,{get:()=>t[r],enumerable:!(n=s(t,r))||n.enumerable});return e};var c=e=>p(i({},"__esModule",{value:!0}),e);var m={};module.exports=c(m);
|
package/dist/esm/docs/run.js
CHANGED
|
@@ -1,48 +1,50 @@
|
|
|
1
|
-
var ne=Object.defineProperty;var c=(e,t)=>ne(e,"name",{value:t,configurable:!0});import{Marked as
|
|
1
|
+
var ne=Object.defineProperty;var c=(e,t)=>ne(e,"name",{value:t,configurable:!0});import{Marked as ie}from"marked";import{cp as C,mkdir as v,readdir as le,readFile as j,writeFile as b}from"fs/promises";import o from"path";import ce from"front-matter";import me from"isomorphic-dompurify";import{markedHighlight as ue}from"marked-highlight";import Q from"highlight.js";import fe from"./templates/default.template.js";import pe from"./renderer/index.js";import{createMarkdownLayoutExtension as de}from"./markdown-layout/index.js";import he from"clean-css";import ge from"html-minifier";import*as X from"@putout/minify";import{fileURLToPath as ye,pathToFileURL as A}from"url";import u from"fs";let V,R="";const Y=new he({inline:["none"]}),W=new Map;W.set("default",fe);let _;const Z=c((e,t)=>t===!1?!1:t===void 0?e:e===!1||e===void 0?t:{...e,...t},"mergeThemeMode"),we=c((e,t)=>{if(!(!e&&!t))return{light:Z(e?.light,t?.light),dark:Z(e?.dark,t?.dark)}},"mergeTheme"),ve=c((e,t)=>({...e,...t,markdownLayouts:{...e.markdownLayouts,...t.markdownLayouts},scripts:{...e.scripts,...t.scripts},theme:we(e.theme,t.theme)}),"mergeTemplateConfig"),Se=c((e,t)=>{if(typeof e=="function")return!0;const{match:r}=e;return r?typeof r=="string"?t.includes(r):Array.isArray(r)?r.some(a=>t.includes(a)):r instanceof RegExp?r.test(t):r(t):!0},"scriptMatches"),De=c((e,t)=>e?Object.values(e).filter(r=>r!==!1).filter(r=>Se(r,t)).map(r=>typeof r=="function"?r():r.render()):[],"renderPageScripts"),G=c((e,t)=>{const r=Object.entries(t).filter(([a])=>a.startsWith("--")).map(([a,i])=>` ${a}: ${i};`).join(`
|
|
2
2
|
`);return r?`${e} {
|
|
3
3
|
${r}
|
|
4
|
-
}`:""},"renderThemeBlock"),
|
|
5
|
-
${G(" :root",
|
|
6
|
-
}`:"",
|
|
4
|
+
}`:""},"renderThemeBlock"),be=c(e=>{if(!e)return"";const t=e.light===!1,r=e.dark===!1,a=e.light===!1?void 0:e.light,i=r?void 0:e.dark,m=a||i;return m?[G(":root",m),i&&!t?`@media (prefers-color-scheme: dark) {
|
|
5
|
+
${G(" :root",i)}
|
|
6
|
+
}`:"",a?G('[data-theme="light"]',a):"",i?G('[data-theme="dark"]',i):"",t&&i?`.site-logo-light { display: none; }
|
|
7
|
+
.site-logo-dark { display: block; }`:"",r&&a?`.site-logo-light { display: block; }
|
|
8
|
+
.site-logo-dark { display: none; }`:""].filter(Boolean).join(`
|
|
7
9
|
|
|
8
|
-
`):""},"renderThemeStylesheet"),xe=c((e="")=>String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"escapeXML")
|
|
10
|
+
`):""},"renderThemeStylesheet"),xe=c((e="")=>String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),"escapeXML"),$e=c((e="")=>e.replace(/```[\s\S]*?```/g," ").replace(/`([^`]+)`/g,"$1").replace(/!\[[^\]]*]\([^)]*\)/g," ").replace(/\[([^\]]+)]\([^)]*\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^---+$/gm," ").replace(/[>*_~]/g,"").replace(/\s+/g," ").trim(),"stripMarkdown"),Pe=c(e=>e==="/index.html"?"/":e.replace(/\/index\.html$/,"/").replace(/\.html$/,"").replace(/\/+/g,"/"),"pagePathToUrlPath"),ee=c((e,t)=>e?`${e.replace(/\/$/,"")}${t==="/"?"/":t}`:t,"canonicalUrl"),ke=c(async(e,t)=>u.existsSync(e)?(await v(o.dirname(t),{recursive:!0}),await C(e,t),!0):!1,"copyIfExists"),Te=c(async e=>{const t=o.resolve(e,"logo.svg");u.existsSync(t)&&await Promise.all(["logo.light.svg","logo.dark.svg"].map(async r=>{const a=o.resolve(e,r);u.existsSync(a)||await C(t,a)}))},"ensureLogoModeAssets"),Me=c(e=>{const t={sitemap:!0,robots:!0,llms:!0,llmsFull:!0,netlify:!1};return e===!1?{sitemap:!1,robots:!1,llms:!1,llmsFull:!1,netlify:!1}:e===!0||e===void 0?t:{...t,...e}},"normalizeGeneratedFilesConfig"),Ce=c((e,t)=>{if(!t)return"";const r=new Date().toISOString().slice(0,10);return`<?xml version="1.0" encoding="UTF-8"?>
|
|
9
11
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
10
|
-
${e.map(
|
|
11
|
-
<loc>${xe(
|
|
12
|
+
${e.map(i=>{const m=i.urlPath==="/"?"1.0":"0.8";return` <url>
|
|
13
|
+
<loc>${xe(ee(t,i.urlPath))}</loc>
|
|
12
14
|
<lastmod>${r}</lastmod>
|
|
13
15
|
<changefreq>weekly</changefreq>
|
|
14
16
|
<priority>${m}</priority>
|
|
15
17
|
</url>`}).join(`
|
|
16
18
|
`)}
|
|
17
19
|
</urlset>
|
|
18
|
-
`},"generateSitemap"),
|
|
20
|
+
`},"generateSitemap"),je=c(e=>`User-agent: *
|
|
19
21
|
Allow: /
|
|
20
22
|
${e?`
|
|
21
23
|
Sitemap: ${e.replace(/\/$/,"")}/sitemap.xml
|
|
22
24
|
Host: ${e.replace(/\/$/,"")}
|
|
23
25
|
`:""}
|
|
24
|
-
`,"generateRobots"),
|
|
26
|
+
`,"generateRobots"),Fe=c(e=>`# Documentation
|
|
25
27
|
|
|
26
28
|
## Page index
|
|
27
29
|
|
|
28
30
|
${e.map(t=>`- ${t.name}: ${t.urlPath} - ${t.description}`).join(`
|
|
29
31
|
`)}
|
|
30
|
-
`,"generateLlms"),
|
|
32
|
+
`,"generateLlms"),Ge=c((e,t)=>`# Documentation for AI agents
|
|
31
33
|
|
|
32
34
|
This file is generated at build time from the Markdown documentation. Use it to choose the most relevant page before reading the canonical HTML documentation.
|
|
33
35
|
|
|
34
36
|
${e.map(r=>`## ${r.title}
|
|
35
37
|
|
|
36
|
-
URL: ${
|
|
38
|
+
URL: ${ee(t,r.urlPath)}
|
|
37
39
|
Source: docs/${r.sourcePath}
|
|
38
40
|
Description: ${r.description}
|
|
39
41
|
|
|
40
42
|
${r.summary||r.description}
|
|
41
43
|
`).join(`
|
|
42
44
|
`)}
|
|
43
|
-
`,"generateLlmsFull"),
|
|
45
|
+
`,"generateLlmsFull"),Le=c((e,t)=>{const r=["# Generated by @beforesemicolon/builder"];return[t.llms?"llms.txt":"",t.llmsFull?"llms-full.txt":"",t.sitemap?"sitemap.xml":"",t.robots?"robots.txt":""].filter(Boolean).forEach(i=>r.push(`/${i} /${i} 200`)),e.forEach(i=>{if(i.urlPath==="/")return;const m=i.urlPath.endsWith("/")?`${i.urlPath}index.html`:`${i.urlPath}.html`;r.push(`${i.urlPath} ${m} 200`),i.urlPath.endsWith("/")&&r.push(`${i.urlPath.replace(/\/$/,"")} ${m} 200`)}),`${[...new Set(r)].join(`
|
|
44
46
|
`)}
|
|
45
|
-
`},"generateNetlifyRedirects"),
|
|
47
|
+
`},"generateNetlifyRedirects"),Ee=c(e=>`[build]
|
|
46
48
|
command = "node build-docs.js"
|
|
47
49
|
publish = "${e||"website"}"
|
|
48
50
|
|
|
@@ -73,4 +75,4 @@ for = "/robots.txt"
|
|
|
73
75
|
[headers.values]
|
|
74
76
|
Content-Type = "text/plain; charset=utf-8"
|
|
75
77
|
Cache-Control = "public, max-age=0, must-revalidate"
|
|
76
|
-
`,"generateNetlifyToml"),
|
|
78
|
+
`,"generateNetlifyToml"),x=c(async(e,t,r,a)=>{if(await ke(e,t))return;const i=r();if(!i){a&&console.warn(a);return}await v(o.dirname(t),{recursive:!0}),await b(t,i)},"writeGeneratedFile"),Oe=c(async({docsDir:e,docsSiteDir:t,pages:r,siteUrl:a,publicDir:i,generatedFiles:m})=>{m.sitemap&&await x(o.resolve(e,"sitemap.xml"),o.resolve(t,"sitemap.xml"),()=>Ce(r,a),"Skipping generated sitemap.xml because buildDocs({ siteUrl }) is not set."),m.robots&&await x(o.resolve(e,"robots.txt"),o.resolve(t,"robots.txt"),()=>je(a)),m.llms&&await x(o.resolve(e,"llms.txt"),o.resolve(t,"llms.txt"),()=>Fe(r)),m.llmsFull&&await x(o.resolve(e,"llms-full.txt"),o.resolve(t,"llms-full.txt"),()=>Ge(r,a)),m.netlify&&(await x(o.resolve(e,"_redirects"),o.resolve(t,"_redirects"),()=>Le(r,m)),await x(o.resolve(e,"netlify.toml"),o.resolve(t,"netlify.toml"),()=>Ee(i&&o.basename(i))))},"writeGeneratedDocsFiles"),te=c((e={},t,r)=>{const a=new ie(ue({langPrefix:"hljs language-",highlight(i,m){const $=Q.getLanguage(m)?m:"plaintext";return Q.highlight(i,{language:$}).value}}));return a.use({renderer:pe}),a.use(de({marked:a,handlers:e.markdownLayouts,renderMarkdown:r})),e.markedOptions&&a.use(e.markedOptions),t&&a.use(t),a},"createBaseMarked"),Ae=c((e={},t)=>{const r=te(e,t),a=c(m=>r.parse(m),"renderMarkdown"),i=te(e,t,a);return i.use({hooks:{postprocess(m){const{layout:$="default",...g}=_.attributes,P=De(e.scripts,m);m=me.sanitize(m);const k=[...m.matchAll(/<h([0-6])\sid="[^"]+".*?>.*?<a\s+href="([^"]+)".*?>([^<]+)<\/a>/gm)].map(S=>({path:S[2],label:S[3],level:S[1]}));return W.get($)?.({...g,content:m,siteMap:_.siteMap,tableOfContent:k,projectMeta:V,renderMarkdown:a,scripts:P,themeStylesheet:e.theme?`/stylesheets/theme.css?v=${R}`:void 0,cacheKey:R})||m}}}),i},"createMarked"),y=c(async e=>{const t=await le(e),r=[];for(const a of t){const i=o.extname(a);/^[._]/.test(a)||(i?r.push(o.join(e,a)):/(stylesheets|assets|scripts)/.test(a)||r.push(...await y(o.join(e,a))))}return r},"traverseDirectory"),lt=c(async({srcDir:e,publicDir:t,markedOptions:r,template:a,siteUrl:i,generatedFiles:m}={})=>{R=Date.now().toString(36);try{const s=o.resolve(process.cwd(),"package.json");u.existsSync(s)&&(V=JSON.parse(await j(s,"utf-8")))}catch(s){console.warn("Failed to load project package.json metadata",s)}const $=c(()=>{try{return __dirname}catch{return o.dirname(ye(import.meta.url))}},"getDirname"),g=a?o.resolve($(),"templates",a):null,P=g?o.resolve(g,"assets"):null,k=g?o.resolve(g,"stylesheets"):null,S=g?o.resolve(g,"layouts"):null;let T={};if(g)try{let s=o.resolve(g,"template.config.js");if(u.existsSync(s)||(s=s.replace(/\.js$/,".ts")),u.existsSync(s)){const n=await import(A(s).href);T=n.default||n}}catch(s){console.error(`Failed to load template config for ${a}`,s)}const p=e??o.resolve(process.cwd(),"docs"),f=t??o.resolve(process.cwd(),"website"),se=Me(m),w=o.resolve(p,"_template"),B=o.resolve(w,"assets"),N=o.resolve(w,"stylesheets"),U=o.resolve(w,"scripts"),z=o.resolve(w,"layouts"),q=o.resolve(p,"_layouts"),F=o.resolve(p,"assets"),H=o.resolve(p,"stylesheets"),L=o.resolve(p,"scripts");try{let s=o.resolve(w,"template.config.js");if(u.existsSync(s)||(s=s.replace(/\.js$/,".ts")),u.existsSync(s)){const n=await import(A(s).href),l=n.default||n;T=ve(T,l)}}catch(s){console.error("Failed to load docs _template config",s)}const re=Ae(T,r);if(await v(f,{recursive:!0}),P&&u.existsSync(P))try{await C(P,F.replace(p,f),{recursive:!0})}catch(s){console.warn(s)}if(u.existsSync(F))try{await C(F,F.replace(p,f),{recursive:!0})}catch(s){console.warn(s)}if(u.existsSync(B))try{await C(B,o.resolve(f,"assets"),{recursive:!0})}catch(s){console.warn(s)}await Te(o.resolve(f,"assets"));try{const s=new Set;if(k&&u.existsSync(k)&&(await y(k)).forEach(l=>s.add(l)),u.existsSync(H)&&(await y(H)).forEach(l=>s.add(l)),u.existsSync(N)&&(await y(N)).forEach(l=>s.add(l)),s.size){await v(o.join(f,"stylesheets"),{recursive:!0});for(const l of s){const d=await j(l,"utf-8"),h=Y.minify(d);h.errors.length&&h.errors.forEach(console.error);const M=l.startsWith(w)?l.replace(w,f):l.startsWith(p)?l.replace(p,f):o.join(f,"stylesheets",o.basename(l));await b(M,h.styles??d)}}const n=be(T.theme);if(n){const l=Y.minify(n);l.errors.length&&l.errors.forEach(console.error),await v(o.join(f,"stylesheets"),{recursive:!0}),await b(o.join(f,"stylesheets","theme.css"),l.styles??n)}}catch(s){console.error(s)}if(u.existsSync(L))try{const s=await y(L);s.length&&await v(L.replace(p,f),{recursive:!0});for(const n of s)try{const l=await j(n,"utf-8");await b(n.replace(p,f),X.minify(l))}catch(l){console.error(l)}}catch(s){console.warn(s)}if(u.existsSync(U))try{const s=await y(U);s.length&&await v(o.join(f,"scripts"),{recursive:!0});for(const n of s)try{const l=await j(n,"utf-8");await b(n.replace(w,f),X.minify(l))}catch(l){console.error(l)}}catch(s){console.warn(s)}try{const s=new Map;S&&u.existsSync(S)&&(await y(S)).forEach(n=>{/\.(j|t)s$/.test(n)&&s.set(o.basename(n).replace(/\.(j|t)s$/,""),n)}),u.existsSync(q)&&(await y(q)).forEach(n=>{/\.(j|t)s$/.test(n)&&s.set(o.basename(n).replace(/\.(j|t)s$/,""),n)}),u.existsSync(z)&&(await y(z)).forEach(n=>{/\.(j|t)s$/.test(n)&&s.set(o.basename(n).replace(/\.(j|t)s$/,""),n)});for(const[n,l]of s.entries()){const d=await import(A(l).href);W.set(n,d.default)}}catch(s){console.error("Template import failed",s)}const oe=await y(p),I=new Map,J=(await Promise.all(oe.filter(s=>s.endsWith(".md")).map(async s=>{const n=await j(s,"utf-8");return{filePath:s,...ce(n)}}))).sort((s,n)=>(s.attributes.order??0)-(n.attributes.order??0)).map(({attributes:s,body:n,filePath:l})=>{const d=l.replace(p,"").replace(/\.md/,".html"),h=l.replace(p,f).replace(".md",".html"),M=h.replace(o.basename(h),""),E=o.basename(d)||"/",ae=d.replace(E,"").replace(/\/$/,"");let D=I;ae.split("/").filter(Boolean).forEach(O=>{D.has(O)||D.set(O,new Map),D=D.get(O)});const K={...s,path:d};return D.has(E)||D.set(E,K),{attributes:K,fileWebsitePath:h,fileDirWebsitePath:M,body:n,sourcePath:o.relative(p,l),siteMap:I}});for(const{attributes:s,body:n,fileDirWebsitePath:l,fileWebsitePath:d,siteMap:h}of J){_={attributes:s,siteMap:h};const M=await re.parse(n);await v(l,{recursive:!0}),await b(d,ge.minify(M,{includeAutoGeneratedTags:!0,removeAttributeQuotes:!0,removeComments:!0,removeRedundantAttributes:!0,removeScriptTypeAttributes:!0,removeStyleLinkTypeAttributes:!0,sortClassName:!0,useShortDoctype:!0,collapseWhitespace:!0,minifyJS:!0,minifyCSS:!0}))}await Oe({docsDir:p,docsSiteDir:f,pages:J.map(({attributes:s,body:n,sourcePath:l})=>{const d=Pe(String(s.path)),h=$e(n);return{sourcePath:l,urlPath:d,title:String(s.title||s.name||"").trim()||"Documentation",name:String(s.name||s.title||"").trim()||"Documentation",description:String(s.description||"").trim()||h.slice(0,156)||"Documentation page.",order:Number(s.order??999),summary:h.slice(0,320)}}),siteUrl:i,publicDir:f,generatedFiles:se})},"buildDocs");export{lt as buildDocs};
|
|
@@ -15,7 +15,7 @@ The template ships:
|
|
|
15
15
|
- Header, footer, metadata, and shared layout helpers.
|
|
16
16
|
- CSS for landing and documentation pages.
|
|
17
17
|
- A dark-first theme with light and dark variable maps.
|
|
18
|
-
- Default assets, including social icons, favicons,
|
|
18
|
+
- Default assets, including social icons, favicons, and default logo files.
|
|
19
19
|
|
|
20
20
|
Use it when you want a polished documentation site where most page content stays in Markdown and the template owns the HTML structure.
|
|
21
21
|
|
|
@@ -27,7 +27,6 @@ fading-citrus/
|
|
|
27
27
|
template.config.js
|
|
28
28
|
assets/
|
|
29
29
|
logo.svg
|
|
30
|
-
before-semicolon-logo.png
|
|
31
30
|
favicon/
|
|
32
31
|
...
|
|
33
32
|
layouts/
|
|
@@ -120,7 +119,7 @@ Override the logo by adding:
|
|
|
120
119
|
docs/_template/assets/logo.svg
|
|
121
120
|
```
|
|
122
121
|
|
|
123
|
-
The footer also uses social icons from `/assets/*.svg
|
|
122
|
+
The footer also uses social icons from `/assets/*.svg`.
|
|
124
123
|
|
|
125
124
|
The current header and footer still include Before Semicolon and Markup-oriented links and copy. If a site needs fully different navigation, footer link groups, or legal copy, override `_header.js`, `_footer.js`, or the full page layouts from `docs/_template/layouts`.
|
|
126
125
|
|
|
@@ -565,8 +564,9 @@ The template includes a default asset set. Not all assets are generic; several e
|
|
|
565
564
|
|
|
566
565
|
Generic or shared assets:
|
|
567
566
|
|
|
568
|
-
- `logo.svg`:
|
|
569
|
-
- `
|
|
567
|
+
- `logo.svg`: compatibility fallback for the main site logo.
|
|
568
|
+
- `logo.light.svg`: preferred logo on light backgrounds.
|
|
569
|
+
- `logo.dark.svg`: preferred logo on dark backgrounds.
|
|
570
570
|
- `favicon/*`: default favicons.
|
|
571
571
|
- social icons: `medium2.svg`, `facebook.svg`, `instagram.svg`, `reddit.svg`, `twitter.svg`, `youtube.svg`.
|
|
572
572
|
|
|
@@ -587,11 +587,13 @@ Override assets from a docs project by adding files at the same target path:
|
|
|
587
587
|
|
|
588
588
|
```txt
|
|
589
589
|
docs/_template/assets/logo.svg
|
|
590
|
+
docs/_template/assets/logo.light.svg
|
|
591
|
+
docs/_template/assets/logo.dark.svg
|
|
590
592
|
docs/_template/assets/favicon/favicon.ico
|
|
591
593
|
docs/_template/assets/markup-banner.jpg
|
|
592
594
|
```
|
|
593
595
|
|
|
594
|
-
Because `docs/_template/assets` is copied into `publicDir/assets` after template assets, source assets can replace template assets.
|
|
596
|
+
Because `docs/_template/assets` is copied into `publicDir/assets` after template assets, source assets can replace template assets. If only `logo.svg` is present, builder copies it to missing `logo.light.svg` and `logo.dark.svg` files in the generated site so the header and footer do not request missing assets. Projects that need correct contrast should provide explicit light and dark variants.
|
|
595
597
|
|
|
596
598
|
## Stylesheets
|
|
597
599
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 220 60" role="img" aria-label="Fading Citrus">
|
|
2
|
+
<g fill="none" fill-rule="evenodd">
|
|
3
|
+
<circle cx="30" cy="30" r="23" fill="#f97316" />
|
|
4
|
+
<path d="M30 7a23 23 0 0 1 23 23H30z" fill="#22d3ee" opacity=".9" />
|
|
5
|
+
<path d="M30 7a23 23 0 0 0 0 46 23 23 0 0 1 0-46z" fill="#fff7ed" opacity=".35" />
|
|
6
|
+
<text x="68" y="37" fill="#f8fafc" font-family="Inter, Arial, sans-serif" font-size="22" font-weight="700">Docs</text>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 220 60" role="img" aria-label="Fading Citrus">
|
|
2
|
+
<g fill="none" fill-rule="evenodd">
|
|
3
|
+
<circle cx="30" cy="30" r="23" fill="#f97316" />
|
|
4
|
+
<path d="M30 7a23 23 0 0 1 23 23H30z" fill="#0891b2" opacity=".9" />
|
|
5
|
+
<path d="M30 7a23 23 0 0 0 0 46 23 23 0 0 1 0-46z" fill="#fff7ed" opacity=".35" />
|
|
6
|
+
<text x="68" y="37" fill="#111827" font-family="Inter, Arial, sans-serif" font-size="22" font-weight="700">Docs</text>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|
|
@@ -34,12 +34,17 @@ const social = [
|
|
|
34
34
|
export default (props = {}) => {
|
|
35
35
|
const siteName =
|
|
36
36
|
props.projectMeta?.name || props.name || props.title || 'Documentation'
|
|
37
|
+
const logo = `
|
|
38
|
+
<span class="site-logo-pair">
|
|
39
|
+
<img class="site-logo site-logo-dark" src="/assets/logo.dark.svg" alt="${siteName} logo" width="100" height="30" />
|
|
40
|
+
<img class="site-logo site-logo-light" src="/assets/logo.light.svg" alt="" width="100" height="30" aria-hidden="true" />
|
|
41
|
+
</span>`
|
|
37
42
|
|
|
38
43
|
return `
|
|
39
44
|
<footer class="site-footer">
|
|
40
45
|
<div class="footer-inner wrapper">
|
|
41
46
|
<div class="footer-brand">
|
|
42
|
-
|
|
47
|
+
${logo}
|
|
43
48
|
<p>A reactive HTML templating system for building dynamic UIs with pure JavaScript. No build step. No virtual DOM.</p>
|
|
44
49
|
</div>
|
|
45
50
|
<ul class="footer-links">
|
|
@@ -59,14 +64,13 @@ export default (props = {}) => {
|
|
|
59
64
|
.map(
|
|
60
65
|
(s) => `
|
|
61
66
|
<a href="${s.link}" rel="noopener" target="_blank" aria-label="${s.name}">
|
|
62
|
-
<
|
|
67
|
+
<span class="footer-social-icon" style="--icon: url('/${s.icon}')" aria-hidden="true"></span>
|
|
63
68
|
</a>
|
|
64
69
|
`
|
|
65
70
|
)
|
|
66
71
|
.join('')}
|
|
67
72
|
</div>
|
|
68
73
|
<div class="footer-credit">
|
|
69
|
-
<img width="20" height="20" src="/assets/before-semicolon-logo.png" alt="Before Semicolon logo" />
|
|
70
74
|
<span>Copyright © ${new Date().getFullYear()} Before Semicolon. All rights reserved.</span>
|
|
71
75
|
</div>
|
|
72
76
|
</div>
|
|
@@ -131,7 +131,7 @@ const pageJson = ({ title, description, path, name }) => {
|
|
|
131
131
|
url: 'https://beforesemicolon.com',
|
|
132
132
|
logo: {
|
|
133
133
|
'@type': 'ImageObject',
|
|
134
|
-
url: `${siteUrl}/assets/
|
|
134
|
+
url: `${siteUrl}/assets/logo.svg`,
|
|
135
135
|
},
|
|
136
136
|
},
|
|
137
137
|
mainEntityOfPage: url,
|
|
@@ -164,6 +164,7 @@ export default (props = {}) => {
|
|
|
164
164
|
const url = absoluteUrl(props.path)
|
|
165
165
|
const canonical = escapeHTML(url)
|
|
166
166
|
const image = props.image || defaultImage
|
|
167
|
+
const cacheKey = props.cacheKey ? `?v=${escapeHTML(props.cacheKey)}` : ''
|
|
167
168
|
const type = canonicalPath(props.path).startsWith('/documentation')
|
|
168
169
|
? 'article'
|
|
169
170
|
: 'website'
|
|
@@ -211,7 +212,7 @@ export default (props = {}) => {
|
|
|
211
212
|
<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png" />
|
|
212
213
|
<link rel="manifest" href="/assets/favicon/site.webmanifest" />
|
|
213
214
|
<link rel="icon" type="image/x-icon" href="/assets/favicon/favicon.ico" />
|
|
214
|
-
<link rel="stylesheet" href="/stylesheets/github-dark.hightlighter.css">
|
|
215
|
+
<link rel="stylesheet" href="/stylesheets/github-dark.hightlighter.css${cacheKey}">
|
|
215
216
|
${jsonScript(pageJson({ ...props, title, description }))}
|
|
216
217
|
${jsonScript(breadcrumbJson({ title, path: props.path }))}
|
|
217
218
|
${
|
|
@@ -2,13 +2,18 @@ export default (props = {}) => {
|
|
|
2
2
|
const isDocs = props.path?.startsWith('/documentation')
|
|
3
3
|
const siteName =
|
|
4
4
|
props.projectMeta?.name || props.name || props.title || 'Documentation'
|
|
5
|
+
const logo = `
|
|
6
|
+
<span class="site-logo-pair">
|
|
7
|
+
<img class="site-logo site-logo-dark" src="/assets/logo.dark.svg" alt="${siteName} logo" width="90" height="27" />
|
|
8
|
+
<img class="site-logo site-logo-light" src="/assets/logo.light.svg" alt="" width="90" height="27" aria-hidden="true" />
|
|
9
|
+
</span>`
|
|
5
10
|
|
|
6
11
|
return `
|
|
7
12
|
<header class="site-header">
|
|
8
13
|
<div class="header-inner wrapper">
|
|
9
14
|
<h1>
|
|
10
15
|
<a href="/" aria-label="${siteName} home">
|
|
11
|
-
|
|
16
|
+
${logo}
|
|
12
17
|
</a>
|
|
13
18
|
</h1>
|
|
14
19
|
${
|
|
@@ -26,6 +26,7 @@ const navCategoryToHTML = (docs, currentPath) =>
|
|
|
26
26
|
export default (props) => {
|
|
27
27
|
const docs = props.siteMap.get('documentation')
|
|
28
28
|
const isDocsIndex = props.path === '/documentation/index.html'
|
|
29
|
+
const cacheKey = props.cacheKey ? `?v=${props.cacheKey}` : ''
|
|
29
30
|
const docsMenu = `<ul>${navCategoryToHTML(docs, props.path)}</ul>`
|
|
30
31
|
const pages = [...docs.values()].flatMap((page) =>
|
|
31
32
|
page instanceof Map ? [...page.values()] : [page]
|
|
@@ -45,7 +46,7 @@ export default (props) => {
|
|
|
45
46
|
<html lang="en">
|
|
46
47
|
<head>
|
|
47
48
|
${meta(props)}
|
|
48
|
-
<link rel="stylesheet" href="/stylesheets/documentation.css
|
|
49
|
+
<link rel="stylesheet" href="/stylesheets/documentation.css${cacheKey}">
|
|
49
50
|
${
|
|
50
51
|
props.themeStylesheet
|
|
51
52
|
? `<link rel="stylesheet" href="${props.themeStylesheet}">`
|
|
@@ -3,12 +3,14 @@ import header from './_header.js'
|
|
|
3
3
|
import footer from './_footer.js'
|
|
4
4
|
|
|
5
5
|
export default (props) => {
|
|
6
|
+
const cacheKey = props.cacheKey ? `?v=${props.cacheKey}` : ''
|
|
7
|
+
|
|
6
8
|
return `
|
|
7
9
|
<!doctype html>
|
|
8
10
|
<html lang="en">
|
|
9
11
|
<head>
|
|
10
12
|
${meta(props)}
|
|
11
|
-
<link rel="stylesheet" href="/stylesheets/landing.css
|
|
13
|
+
<link rel="stylesheet" href="/stylesheets/landing.css${cacheKey}">
|
|
12
14
|
${
|
|
13
15
|
props.themeStylesheet
|
|
14
16
|
? `<link rel="stylesheet" href="${props.themeStylesheet}">`
|