@beforesemicolon/builder 1.8.24 → 2.0.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 (184) hide show
  1. package/README.md +40 -915
  2. package/dist/cjs/build-modules.js +1 -1
  3. package/dist/cjs/index.js +1 -1
  4. package/dist/esm/build-modules.js +1 -1
  5. package/dist/esm/index.js +1 -1
  6. package/dist/types/build-modules.d.ts +2 -21
  7. package/dist/types/index.d.ts +0 -1
  8. package/package.json +5 -25
  9. package/dist/cjs/.declarations.d.js +0 -1
  10. package/dist/cjs/docs/markdown-layout/index.js +0 -1
  11. package/dist/cjs/docs/markdown-layout/marked-extension.js +0 -1
  12. package/dist/cjs/docs/markdown-layout/parser.js +0 -7
  13. package/dist/cjs/docs/markdown-layout/renderer.js +0 -1
  14. package/dist/cjs/docs/markdown-layout/types.js +0 -1
  15. package/dist/cjs/docs/renderer/code.js +0 -11
  16. package/dist/cjs/docs/renderer/heading.js +0 -1
  17. package/dist/cjs/docs/renderer/index.js +0 -1
  18. package/dist/cjs/docs/renderer/link.js +0 -1
  19. package/dist/cjs/docs/run.js +0 -78
  20. package/dist/cjs/docs/templates/default.template.js +0 -17
  21. package/dist/cjs/docs/templates/fading-citrus/README.md +0 -822
  22. package/dist/cjs/docs/templates/fading-citrus/assets/facebook.svg +0 -8
  23. package/dist/cjs/docs/templates/fading-citrus/assets/favicon/android-chrome-192x192.png +0 -0
  24. package/dist/cjs/docs/templates/fading-citrus/assets/favicon/android-chrome-512x512.png +0 -0
  25. package/dist/cjs/docs/templates/fading-citrus/assets/favicon/apple-touch-icon.png +0 -0
  26. package/dist/cjs/docs/templates/fading-citrus/assets/favicon/favicon-16x16.png +0 -0
  27. package/dist/cjs/docs/templates/fading-citrus/assets/favicon/favicon-32x32.png +0 -0
  28. package/dist/cjs/docs/templates/fading-citrus/assets/favicon/favicon.ico +0 -0
  29. package/dist/cjs/docs/templates/fading-citrus/assets/favicon/site.webmanifest +0 -19
  30. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Black.otf +0 -0
  31. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-BlackItalic.otf +0 -0
  32. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Bold.otf +0 -0
  33. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-BoldItalic.otf +0 -0
  34. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-ExtraBold.otf +0 -0
  35. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-ExtraBoldItalic.otf +0 -0
  36. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-ExtraLight.otf +0 -0
  37. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-ExtraLightItalic.otf +0 -0
  38. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Italic.otf +0 -0
  39. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Light.otf +0 -0
  40. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-LightItalic.otf +0 -0
  41. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Medium.otf +0 -0
  42. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-MediumItalic.otf +0 -0
  43. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Regular.otf +0 -0
  44. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-SemiBold.otf +0 -0
  45. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-SemiBoldItalic.otf +0 -0
  46. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Thin.otf +0 -0
  47. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-ThinItalic.otf +0 -0
  48. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/exo-2/SIL Open Font License.txt +0 -43
  49. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/Apache License.txt +0 -201
  50. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-Bold.ttf +0 -0
  51. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-BoldItalic.ttf +0 -0
  52. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-ExtraBold.ttf +0 -0
  53. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-ExtraBoldItalic.ttf +0 -0
  54. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-Italic.ttf +0 -0
  55. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-Light.ttf +0 -0
  56. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-LightItalic.ttf +0 -0
  57. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-Regular.ttf +0 -0
  58. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-Semibold.ttf +0 -0
  59. package/dist/cjs/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-SemiboldItalic.ttf +0 -0
  60. package/dist/cjs/docs/templates/fading-citrus/assets/instagram.svg +0 -28
  61. package/dist/cjs/docs/templates/fading-citrus/assets/logo.dark.svg +0 -8
  62. package/dist/cjs/docs/templates/fading-citrus/assets/logo.light.svg +0 -8
  63. package/dist/cjs/docs/templates/fading-citrus/assets/logo.svg +0 -8
  64. package/dist/cjs/docs/templates/fading-citrus/assets/medium2.svg +0 -18
  65. package/dist/cjs/docs/templates/fading-citrus/assets/reddit.svg +0 -16
  66. package/dist/cjs/docs/templates/fading-citrus/assets/twitter.svg +0 -11
  67. package/dist/cjs/docs/templates/fading-citrus/assets/youtube.svg +0 -10
  68. package/dist/cjs/docs/templates/fading-citrus/layouts/_code-snippet.js +0 -128
  69. package/dist/cjs/docs/templates/fading-citrus/layouts/_footer.js +0 -72
  70. package/dist/cjs/docs/templates/fading-citrus/layouts/_head-meta.js +0 -235
  71. package/dist/cjs/docs/templates/fading-citrus/layouts/_header.js +0 -91
  72. package/dist/cjs/docs/templates/fading-citrus/layouts/_layout-utils.js +0 -109
  73. package/dist/cjs/docs/templates/fading-citrus/layouts/document.js +0 -100
  74. package/dist/cjs/docs/templates/fading-citrus/layouts/landing-cta.js +0 -30
  75. package/dist/cjs/docs/templates/fading-citrus/layouts/landing-ecosystem.js +0 -51
  76. package/dist/cjs/docs/templates/fading-citrus/layouts/landing-features.js +0 -25
  77. package/dist/cjs/docs/templates/fading-citrus/layouts/landing-hero.js +0 -89
  78. package/dist/cjs/docs/templates/fading-citrus/layouts/landing-install.js +0 -116
  79. package/dist/cjs/docs/templates/fading-citrus/layouts/landing-showcase.js +0 -133
  80. package/dist/cjs/docs/templates/fading-citrus/layouts/landing.js +0 -29
  81. package/dist/cjs/docs/templates/fading-citrus/stylesheets/common.css +0 -900
  82. package/dist/cjs/docs/templates/fading-citrus/stylesheets/documentation.css +0 -562
  83. package/dist/cjs/docs/templates/fading-citrus/stylesheets/fonts.css +0 -1
  84. package/dist/cjs/docs/templates/fading-citrus/stylesheets/github-dark.hightlighter.css +0 -107
  85. package/dist/cjs/docs/templates/fading-citrus/stylesheets/github-light.hightlighter.css +0 -107
  86. package/dist/cjs/docs/templates/fading-citrus/stylesheets/hybrid.hightlighter.css +0 -102
  87. package/dist/cjs/docs/templates/fading-citrus/stylesheets/landing.css +0 -1563
  88. package/dist/cjs/docs/templates/fading-citrus/stylesheets/normalize.css +0 -351
  89. package/dist/cjs/docs/templates/fading-citrus/template.config.js +0 -233
  90. package/dist/cjs/docs/types.js +0 -1
  91. package/dist/esm/.declarations.d.js +0 -0
  92. package/dist/esm/docs/markdown-layout/index.js +0 -1
  93. package/dist/esm/docs/markdown-layout/marked-extension.js +0 -1
  94. package/dist/esm/docs/markdown-layout/parser.js +0 -7
  95. package/dist/esm/docs/markdown-layout/renderer.js +0 -1
  96. package/dist/esm/docs/markdown-layout/types.js +0 -0
  97. package/dist/esm/docs/renderer/code.js +0 -11
  98. package/dist/esm/docs/renderer/heading.js +0 -1
  99. package/dist/esm/docs/renderer/index.js +0 -1
  100. package/dist/esm/docs/renderer/link.js +0 -1
  101. package/dist/esm/docs/run.js +0 -78
  102. package/dist/esm/docs/templates/default.template.js +0 -17
  103. package/dist/esm/docs/templates/fading-citrus/README.md +0 -822
  104. package/dist/esm/docs/templates/fading-citrus/assets/facebook.svg +0 -8
  105. package/dist/esm/docs/templates/fading-citrus/assets/favicon/android-chrome-192x192.png +0 -0
  106. package/dist/esm/docs/templates/fading-citrus/assets/favicon/android-chrome-512x512.png +0 -0
  107. package/dist/esm/docs/templates/fading-citrus/assets/favicon/apple-touch-icon.png +0 -0
  108. package/dist/esm/docs/templates/fading-citrus/assets/favicon/favicon-16x16.png +0 -0
  109. package/dist/esm/docs/templates/fading-citrus/assets/favicon/favicon-32x32.png +0 -0
  110. package/dist/esm/docs/templates/fading-citrus/assets/favicon/favicon.ico +0 -0
  111. package/dist/esm/docs/templates/fading-citrus/assets/favicon/site.webmanifest +0 -19
  112. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Black.otf +0 -0
  113. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-BlackItalic.otf +0 -0
  114. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Bold.otf +0 -0
  115. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-BoldItalic.otf +0 -0
  116. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-ExtraBold.otf +0 -0
  117. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-ExtraBoldItalic.otf +0 -0
  118. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-ExtraLight.otf +0 -0
  119. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-ExtraLightItalic.otf +0 -0
  120. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Italic.otf +0 -0
  121. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Light.otf +0 -0
  122. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-LightItalic.otf +0 -0
  123. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Medium.otf +0 -0
  124. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-MediumItalic.otf +0 -0
  125. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Regular.otf +0 -0
  126. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-SemiBold.otf +0 -0
  127. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-SemiBoldItalic.otf +0 -0
  128. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-Thin.otf +0 -0
  129. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/Exo2.0-ThinItalic.otf +0 -0
  130. package/dist/esm/docs/templates/fading-citrus/assets/fonts/exo-2/SIL Open Font License.txt +0 -43
  131. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/Apache License.txt +0 -201
  132. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-Bold.ttf +0 -0
  133. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-BoldItalic.ttf +0 -0
  134. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-ExtraBold.ttf +0 -0
  135. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-ExtraBoldItalic.ttf +0 -0
  136. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-Italic.ttf +0 -0
  137. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-Light.ttf +0 -0
  138. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-LightItalic.ttf +0 -0
  139. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-Regular.ttf +0 -0
  140. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-Semibold.ttf +0 -0
  141. package/dist/esm/docs/templates/fading-citrus/assets/fonts/open-sans/OpenSans-SemiboldItalic.ttf +0 -0
  142. package/dist/esm/docs/templates/fading-citrus/assets/instagram.svg +0 -28
  143. package/dist/esm/docs/templates/fading-citrus/assets/logo.dark.svg +0 -8
  144. package/dist/esm/docs/templates/fading-citrus/assets/logo.light.svg +0 -8
  145. package/dist/esm/docs/templates/fading-citrus/assets/logo.svg +0 -8
  146. package/dist/esm/docs/templates/fading-citrus/assets/medium2.svg +0 -18
  147. package/dist/esm/docs/templates/fading-citrus/assets/reddit.svg +0 -16
  148. package/dist/esm/docs/templates/fading-citrus/assets/twitter.svg +0 -11
  149. package/dist/esm/docs/templates/fading-citrus/assets/youtube.svg +0 -10
  150. package/dist/esm/docs/templates/fading-citrus/layouts/_code-snippet.js +0 -128
  151. package/dist/esm/docs/templates/fading-citrus/layouts/_footer.js +0 -72
  152. package/dist/esm/docs/templates/fading-citrus/layouts/_head-meta.js +0 -235
  153. package/dist/esm/docs/templates/fading-citrus/layouts/_header.js +0 -91
  154. package/dist/esm/docs/templates/fading-citrus/layouts/_layout-utils.js +0 -109
  155. package/dist/esm/docs/templates/fading-citrus/layouts/document.js +0 -100
  156. package/dist/esm/docs/templates/fading-citrus/layouts/landing-cta.js +0 -30
  157. package/dist/esm/docs/templates/fading-citrus/layouts/landing-ecosystem.js +0 -51
  158. package/dist/esm/docs/templates/fading-citrus/layouts/landing-features.js +0 -25
  159. package/dist/esm/docs/templates/fading-citrus/layouts/landing-hero.js +0 -89
  160. package/dist/esm/docs/templates/fading-citrus/layouts/landing-install.js +0 -116
  161. package/dist/esm/docs/templates/fading-citrus/layouts/landing-showcase.js +0 -133
  162. package/dist/esm/docs/templates/fading-citrus/layouts/landing.js +0 -29
  163. package/dist/esm/docs/templates/fading-citrus/stylesheets/common.css +0 -900
  164. package/dist/esm/docs/templates/fading-citrus/stylesheets/documentation.css +0 -562
  165. package/dist/esm/docs/templates/fading-citrus/stylesheets/fonts.css +0 -1
  166. package/dist/esm/docs/templates/fading-citrus/stylesheets/github-dark.hightlighter.css +0 -107
  167. package/dist/esm/docs/templates/fading-citrus/stylesheets/github-light.hightlighter.css +0 -107
  168. package/dist/esm/docs/templates/fading-citrus/stylesheets/hybrid.hightlighter.css +0 -102
  169. package/dist/esm/docs/templates/fading-citrus/stylesheets/landing.css +0 -1563
  170. package/dist/esm/docs/templates/fading-citrus/stylesheets/normalize.css +0 -351
  171. package/dist/esm/docs/templates/fading-citrus/template.config.js +0 -233
  172. package/dist/esm/docs/types.js +0 -0
  173. package/dist/types/docs/markdown-layout/index.d.ts +0 -4
  174. package/dist/types/docs/markdown-layout/marked-extension.d.ts +0 -9
  175. package/dist/types/docs/markdown-layout/parser.d.ts +0 -12
  176. package/dist/types/docs/markdown-layout/renderer.d.ts +0 -3
  177. package/dist/types/docs/markdown-layout/types.d.ts +0 -36
  178. package/dist/types/docs/renderer/code.d.ts +0 -2
  179. package/dist/types/docs/renderer/heading.d.ts +0 -2
  180. package/dist/types/docs/renderer/index.d.ts +0 -3
  181. package/dist/types/docs/renderer/link.d.ts +0 -2
  182. package/dist/types/docs/run.d.ts +0 -19
  183. package/dist/types/docs/templates/default.template.d.ts +0 -3
  184. package/dist/types/docs/types.d.ts +0 -107
@@ -1,822 +0,0 @@
1
- # fading-citrus Template
2
-
3
- `fading-citrus` is a complete documentation-site template for `buildDocs({ template: 'fading-citrus' })`.
4
-
5
- This README only documents the template-specific surface area: layouts, Markdown layout parts, assets, scripts, theme variables, and the expected override points. General builder behavior is documented in the repository root README.
6
-
7
- ## What This Template Provides
8
-
9
- The template ships:
10
-
11
- - A landing page shell.
12
- - A documentation page shell.
13
- - Landing page section handlers for Markdown layout syntax.
14
- - A code snippet renderer with copy behavior.
15
- - Header, footer, metadata, and shared layout helpers.
16
- - CSS for landing and documentation pages.
17
- - A dark-first theme with light and dark variable maps.
18
- - Default assets, including social icons, favicons, and default logo files.
19
-
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
-
22
- ## Directory Surface
23
-
24
- ```txt
25
- fading-citrus/
26
- README.md
27
- template.config.js
28
- assets/
29
- logo.svg
30
- favicon/
31
- ...
32
- layouts/
33
- landing.js
34
- document.js
35
- _header.js
36
- _footer.js
37
- _head-meta.js
38
- _code-snippet.js
39
- _layout-utils.js
40
- landing-hero.js
41
- landing-ecosystem.js
42
- landing-features.js
43
- landing-showcase.js
44
- landing-install.js
45
- landing-cta.js
46
- stylesheets/
47
- common.css
48
- documentation.css
49
- fonts.css
50
- landing.css
51
- normalize.css
52
- *.hightlighter.css
53
- ```
54
-
55
- Files prefixed with `_` are private template helpers. A docs project can override them by providing a same-named file in `docs/_template/layouts`, but they are not intended to be Markdown layout names.
56
-
57
- ## Page Layouts
58
-
59
- ### `landing`
60
-
61
- Used by pages with:
62
-
63
- ```md
64
- ---
65
- layout: landing
66
- ---
67
- ```
68
-
69
- This layout renders:
70
-
71
- - metadata from `_head-meta.js`
72
- - `/stylesheets/landing.css`
73
- - optional generated `theme.css`
74
- - shared header
75
- - rendered Markdown content
76
- - shared footer
77
- - page scripts collected by the template config
78
-
79
- The landing layout intentionally does not hardcode landing content. It expects the page body to be composed with Markdown layout blocks such as `landing-hero`, `landing-features`, and `landing-install`.
80
-
81
- ### `document`
82
-
83
- Used by documentation pages with:
84
-
85
- ```md
86
- ---
87
- layout: document
88
- ---
89
- ```
90
-
91
- This layout renders:
92
-
93
- - metadata from `_head-meta.js`
94
- - `/stylesheets/documentation.css`
95
- - optional generated `theme.css`
96
- - shared header
97
- - documentation navigation from the generated site map
98
- - page article content
99
- - previous/next documentation links
100
- - edit-on-GitHub link
101
- - table of contents from Markdown headings
102
- - shared footer
103
- - page scripts collected by the template config
104
-
105
- The `document` layout currently expects documentation pages to live under `/documentation`. The generated left navigation is read from `props.siteMap.get('documentation')`.
106
-
107
- ## Header And Footer
108
-
109
- The header and footer are provided by:
110
-
111
- - `layouts/_header.js`
112
- - `layouts/_footer.js`
113
-
114
- They use `/assets/logo.svg` for the site logo. This is intentionally asset-based so a docs project can override the logo without replacing layout code.
115
-
116
- Override the logo by adding:
117
-
118
- ```txt
119
- docs/_template/assets/logo.svg
120
- ```
121
-
122
- The footer also uses social icons from `/assets/*.svg`.
123
-
124
- Header and footer links are driven by `site` config. Override `_header.js`, `_footer.js`, or the full page layouts only when the HTML structure itself needs to change.
125
-
126
- ## Metadata
127
-
128
- Metadata is generated by:
129
-
130
- ```txt
131
- layouts/_head-meta.js
132
- ```
133
-
134
- It emits:
135
-
136
- - title and meta description
137
- - canonical URL
138
- - Open Graph tags
139
- - Twitter card tags
140
- - keywords
141
- - robots metadata
142
- - favicon links
143
- - structured JSON-LD for web site, software application, breadcrumbs, and docs pages
144
-
145
- Important current behavior:
146
-
147
- - The helper reads defaults from `template.config.js` `meta`.
148
- - `meta.siteUrl` overrides the `buildDocs({ siteUrl })` value when needed.
149
- - `meta.siteName`, `meta.title`, and `meta.description` customize the fallback site identity.
150
- - `meta.image` customizes the default Open Graph and Twitter card image.
151
- - `meta.image` can be absolute, such as `https://example.com/card.jpg`, or site-relative, such as `/assets/site-image.jpg`.
152
- - If no image is configured, the fallback is `/assets/site-image.jpg`.
153
-
154
- For project-specific social images, add the file under `docs/_template/assets` and point `meta.image` at it:
155
-
156
- ```js
157
- // docs/_template/template.config.js
158
- export default {
159
- meta: {
160
- siteName: 'Example',
161
- title: 'Example by Before Semicolon',
162
- description: 'Documentation for Example.',
163
- image: '/assets/site-image.jpg',
164
- },
165
- }
166
- ```
167
-
168
- Override `_head-meta.js` in `docs/_template/layouts` only when the generated metadata shape itself needs to change.
169
-
170
- ## Site Identity And Links
171
-
172
- The template is generic. Product-specific labels, repository links, footer links, and edit links should live in `docs/_template/template.config.js` under `site`.
173
-
174
- ```js
175
- // docs/_template/template.config.js
176
- export default {
177
- site: {
178
- name: 'Example',
179
- packageName: '@example/project',
180
- repositoryUrl: 'https://github.com/example/project',
181
- repositoryLabel: 'Example GitHub repository',
182
- docsEditUrl: 'https://github.com/example/project/tree/main/docs',
183
- navLinks: [
184
- { label: 'Features', href: '/#features' },
185
- { label: 'Code', href: '/#code' },
186
- { label: 'Install', href: '/#install' },
187
- ],
188
- actionLinks: [
189
- {
190
- label: 'Documentation',
191
- href: '/documentation',
192
- className: 'btn-primary',
193
- },
194
- ],
195
- footerDescription: 'Documentation for Example.',
196
- footerGroups: [
197
- {
198
- title: 'Learning Resources',
199
- links: [{ label: 'Documentation', href: '/documentation' }],
200
- },
201
- ],
202
- socialLinks: [
203
- {
204
- name: 'GitHub',
205
- href: 'https://github.com/example',
206
- icon: '/assets/github.svg',
207
- },
208
- ],
209
- copyright: `Copyright © ${new Date().getFullYear()} Example.`,
210
- },
211
- }
212
- ```
213
-
214
- Relevant fields:
215
-
216
- - `repositoryUrl` powers the header GitHub links and the docs version badge.
217
- - `docsEditUrl` powers the “edit this doc” link. If omitted, that link is hidden.
218
- - `packageName` powers the default landing hero install command.
219
- - `navLinks`, `actionLinks`, `footerGroups`, and `socialLinks` replace the template defaults.
220
-
221
- ## Markdown Layout Handlers
222
-
223
- `template.config.js` registers these Markdown layout handlers:
224
-
225
- ```js
226
- markdownLayouts: {
227
- 'landing-hero': landingHero,
228
- 'landing-ecosystem': landingEcosystem,
229
- 'landing-features': landingFeatures,
230
- 'landing-showcase': landingShowcase,
231
- 'landing-install': landingInstall,
232
- 'landing-cta': landingCta,
233
- }
234
- ```
235
-
236
- Each handler receives parsed Markdown parts. Each part has already been rendered to HTML, so handlers inject `part.html`.
237
-
238
- ## `landing-hero`
239
-
240
- Purpose: first-screen landing section with headline, copy, stats, CTA buttons, and optional code panel.
241
-
242
- Syntax:
243
-
244
- ````md
245
- ::: layout landing-hero version=v1.0.0 title="Reactive DOM." title2="Zero build." primaryLabel="Get Started" secondaryLabel="npm i package-name"
246
-
247
- === copy
248
-
249
- A short landing intro.
250
-
251
- === stat
252
-
253
- ## 7.6KB
254
-
255
- CDN gzip
256
-
257
- === stat
258
-
259
- ## 0
260
-
261
- third-party deps
262
-
263
- === code filename=counter.js lang=javascript
264
-
265
- ```text
266
- console.log('hello')
267
- ```
268
- ````
269
-
270
- :::
271
-
272
- ````
273
-
274
- Supported layout options:
275
-
276
- - `version`: optional version badge text.
277
- - `title`: first headline line.
278
- - `title2`: second headline line.
279
- - `primaryHref`: primary CTA URL. Defaults to `/documentation/get-started`.
280
- - `primaryLabel`: primary CTA label. Defaults to `Get Started`.
281
- - `secondaryLabel`: secondary CTA label. Defaults to `site.landingHeroSecondaryLabel`, then `npm i ${site.packageName}`, then `Install`.
282
- - `versionHref`: version badge URL. Defaults to `site.landingHeroVersionHref`, then `site.repositoryUrl`.
283
-
284
- Supported parts:
285
-
286
- - `copy`: rendered as hero subtitle.
287
- - `stat`: can be repeated. Expects an `h2` value and paragraph label.
288
- - `code`: optional code block. Supports `filename` and `lang` options.
289
-
290
- Notes:
291
-
292
- - The secondary CTA currently points to `#install`.
293
- - The version badge links to `versionHref`, `site.landingHeroVersionHref`, or `site.repositoryUrl`.
294
-
295
- ## `landing-ecosystem`
296
-
297
- Purpose: product/ecosystem cards.
298
-
299
- Syntax:
300
-
301
- ```md
302
- ::: layout landing-ecosystem
303
-
304
- === header
305
-
306
- `// ecosystem`
307
-
308
- ## Built on top of the core.
309
-
310
- Short section description.
311
-
312
- === product title="Web Components" package=@scope/web-component color=orange icon=webComponents href=/documentation/web-component
313
-
314
- Product description.
315
-
316
- === product title=Router package=@scope/router color=cyan icon=router href=/documentation/router
317
-
318
- Product description.
319
-
320
- :::
321
- ````
322
-
323
- Supported parts:
324
-
325
- - `header`: section eyebrow, heading, and intro copy.
326
- - `product`: repeated cards.
327
-
328
- Product options:
329
-
330
- - `title`: card title.
331
- - `package`: package label.
332
- - `color`: card color modifier. Existing CSS supports the orange/cyan style used by the template.
333
- - `icon`: icon name from `_layout-utils.js`.
334
- - `href`: link target.
335
-
336
- ## `landing-features`
337
-
338
- Purpose: grid of feature cards.
339
-
340
- Syntax:
341
-
342
- ```md
343
- ::: layout landing-features
344
-
345
- === header
346
-
347
- `// why this`
348
-
349
- ## The platform is the framework.
350
-
351
- Short intro.
352
-
353
- === feature icon=reactive
354
-
355
- ### Reactive
356
-
357
- Feature copy.
358
-
359
- === feature icon=tiny
360
-
361
- ### Tiny
362
-
363
- Feature copy.
364
-
365
- :::
366
- ```
367
-
368
- Supported parts:
369
-
370
- - `header`: section eyebrow, heading, and intro copy.
371
- - `feature`: repeated feature cards.
372
-
373
- Feature options:
374
-
375
- - `icon`: icon name from `_layout-utils.js`.
376
-
377
- Available icon names include:
378
-
379
- - `reactive`
380
- - `tiny`
381
- - `standards`
382
- - `plug`
383
- - `webComponents`
384
- - `surgical`
385
- - `router`
386
- - `terminal`
387
- - `book`
388
- - `arrowRight`
389
- - `arrowUpRight`
390
- - `sparkles`
391
-
392
- Unknown icon names fall back to `reactive`.
393
-
394
- ## `landing-showcase`
395
-
396
- Purpose: interactive code example carousel.
397
-
398
- Syntax:
399
-
400
- ````md
401
- ::: layout landing-showcase
402
-
403
- === header
404
-
405
- `// see it in action`
406
-
407
- ## Looks like HTML.
408
-
409
- Short intro.
410
-
411
- === example label="Todos + localStorage" color=orange filename=todos.js lang=javascript
412
-
413
- ```javascript
414
- console.log('todo example')
415
- ```
416
- ````
417
-
418
- === example label="Router" color=cyan filename=app.html lang=html
419
-
420
- ```html
421
- <main></main>
422
- ```
423
-
424
- :::
425
-
426
- ````
427
-
428
- Supported parts:
429
-
430
- - `header`: carousel heading and intro.
431
- - `example`: repeated slides.
432
-
433
- Example options:
434
-
435
- - `label`: slide label.
436
- - `color`: label color modifier. The template uses orange/cyan.
437
- - `filename`: code snippet filename label.
438
- - `lang`: syntax label passed to the code snippet renderer.
439
-
440
- Scripts:
441
-
442
- - This layout emits markup with `data-fading-citrus-showcase`.
443
- - `template.config.js` includes the `showcase` script only on pages containing that marker.
444
- - The script handles previous/next buttons, dots, clones for looping, transition reset, and resize alignment.
445
-
446
- ## `landing-install`
447
-
448
- Purpose: install command tab set with copy buttons.
449
-
450
- Syntax:
451
-
452
- ```md
453
- ::: layout landing-install
454
-
455
- === header
456
-
457
- `// install`
458
-
459
- ## Start in seconds.
460
-
461
- Choose your package manager.
462
-
463
- === tab key=npm label=npm command="npm install package-name"
464
-
465
- npm install package-name
466
-
467
- === tab key=yarn label=yarn command="yarn add package-name"
468
-
469
- yarn add package-name
470
-
471
- :::
472
- ````
473
-
474
- Supported parts:
475
-
476
- - `header`: section heading and intro.
477
- - `tab`: repeated package manager tabs.
478
-
479
- Tab options:
480
-
481
- - `key`: tab id.
482
- - `label`: tab button label.
483
- - `command`: command copied to clipboard.
484
-
485
- Scripts:
486
-
487
- - This layout emits markup with `data-fading-citrus-install`.
488
- - `template.config.js` includes the `install` script only on pages containing that marker.
489
- - The script handles tab switching and command copy feedback.
490
-
491
- Current behavior:
492
-
493
- - The second tab is active by default.
494
- - Override `landing-install.js` if that default should be configurable.
495
-
496
- ## `landing-cta`
497
-
498
- Purpose: final landing call-to-action section.
499
-
500
- Syntax:
501
-
502
- ```md
503
- ::: layout landing-cta title="Build with the platform." title2="Ship less JavaScript."
504
-
505
- === copy
506
-
507
- Final CTA copy.
508
-
509
- :::
510
- ```
511
-
512
- Supported layout options:
513
-
514
- - `title`: first heading segment.
515
- - `title2`: second heading segment.
516
-
517
- Supported parts:
518
-
519
- - `copy`: CTA body copy.
520
-
521
- Current behavior:
522
-
523
- - The CTA buttons link to `/documentation/get-started` and `/documentation/index.html?v=20260621exact`.
524
- - Override `landing-cta.js` if those links need to be configurable.
525
-
526
- ## Code Snippets
527
-
528
- Code snippets are handled by:
529
-
530
- ```txt
531
- layouts/_code-snippet.js
532
- ```
533
-
534
- The template config overrides the default Markdown code renderer:
535
-
536
- ```js
537
- markedOptions: {
538
- renderer: {
539
- code({ lang, raw }) {
540
- return renderCodeBlock('', rawCode, lang)
541
- },
542
- },
543
- }
544
- ```
545
-
546
- This means fenced code blocks render with:
547
-
548
- - a framed code panel
549
- - mac-style dots
550
- - filename area
551
- - language label
552
- - line numbers
553
- - syntax token styling
554
- - copy button
555
-
556
- Scripts:
557
-
558
- - Code snippets emit `code-copy-btn`.
559
- - `template.config.js` includes the `code-copy` script only on pages containing that marker.
560
- - The script uses the nearest `.code-snippet` container and copies the `data-code` value.
561
-
562
- ## Theme Variables
563
-
564
- The template defines light and dark CSS variable maps in `template.config.js`.
565
-
566
- Primary variables:
567
-
568
- - `--background`
569
- - `--foreground`
570
- - `--card`
571
- - `--primary`
572
- - `--primary-glow`
573
- - `--primary-foreground`
574
- - `--secondary`
575
- - `--muted`
576
- - `--muted-foreground`
577
- - `--accent`
578
- - `--border`
579
- - `--ring`
580
- - `--code-bg`
581
-
582
- Syntax variables:
583
-
584
- - `--syntax-comment`
585
- - `--syntax-keyword`
586
- - `--syntax-string`
587
- - `--syntax-tag`
588
- - `--syntax-attr`
589
-
590
- Effect variables:
591
-
592
- - `--gradient-hero`
593
- - `--gradient-primary`
594
- - `--gradient-text`
595
- - `--gradient-border`
596
- - `--shadow-glow`
597
- - `--shadow-card`
598
-
599
- Override only values from a docs project:
600
-
601
- ```js
602
- export default {
603
- theme: {
604
- light: {
605
- '--primary': 'oklch(0.62 0.18 250)',
606
- },
607
- dark: {
608
- '--primary': 'oklch(0.78 0.16 250)',
609
- },
610
- },
611
- }
612
- ```
613
-
614
- Disable a mode by setting it to `false`:
615
-
616
- ```js
617
- export default {
618
- theme: {
619
- light: false,
620
- },
621
- }
622
- ```
623
-
624
- With `light: false`, the dark variables become the default `:root` theme for this template and light-mode selectors are not emitted. This is useful for docs sites that should stay dark-only.
625
-
626
- Place that in:
627
-
628
- ```txt
629
- docs/_template/template.config.js
630
- ```
631
-
632
- ## Assets
633
-
634
- The template includes only generic/shared assets. Product-specific logos, banners, screenshots, and icons should live in the docs source under `docs/_template/assets`.
635
-
636
- - `logo.svg`: compatibility fallback for the main site logo.
637
- - `logo.light.svg`: preferred logo on light backgrounds.
638
- - `logo.dark.svg`: preferred logo on dark backgrounds.
639
- - `favicon/*`: default favicons.
640
- - social icons: `medium2.svg`, `facebook.svg`, `instagram.svg`, `reddit.svg`, `twitter.svg`, `youtube.svg`.
641
-
642
- Override assets from a docs project by adding files at the same target path:
643
-
644
- ```txt
645
- docs/_template/assets/logo.svg
646
- docs/_template/assets/logo.light.svg
647
- docs/_template/assets/logo.dark.svg
648
- docs/_template/assets/favicon/favicon.ico
649
- docs/_template/assets/site-image.jpg
650
- ```
651
-
652
- 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.
653
-
654
- ## Stylesheets
655
-
656
- Stylesheets shipped by the template:
657
-
658
- - `normalize.css`: baseline reset.
659
- - `fonts.css`: bundled font-face declarations.
660
- - `common.css`: shared header, footer, buttons, variables, and document primitives.
661
- - `landing.css`: landing page sections and responsive behavior.
662
- - `documentation.css`: documentation layout, article content, side nav, and table of contents.
663
- - `github-dark.hightlighter.css`
664
- - `github-light.hightlighter.css`
665
- - `hybrid.hightlighter.css`
666
-
667
- The page layouts currently include:
668
-
669
- - `landing.css` for `layout: landing`
670
- - `documentation.css` for `layout: document`
671
- - `theme.css` when theme variables are configured
672
-
673
- The landing and documentation stylesheets import or rely on the shared styles as authored in this template. If you override styles, preserve required class names or override the corresponding layout handlers.
674
-
675
- ## Scripts
676
-
677
- Template scripts are registered by marker. The template renders `headScripts` inside `<head>` and `scripts` before `</body>`.
678
-
679
- ```js
680
- scripts: {
681
- 'code-copy': {
682
- match: 'code-copy-btn',
683
- render: renderCodeCopyScript,
684
- },
685
- showcase: {
686
- match: 'data-fading-citrus-showcase',
687
- render: renderShowcaseScript,
688
- },
689
- install: {
690
- match: 'data-fading-citrus-install',
691
- render: renderInstallScript,
692
- },
693
- }
694
- ```
695
-
696
- This keeps pages from receiving scripts for layout parts they do not use.
697
-
698
- Disable a script from a docs project:
699
-
700
- ```js
701
- export default {
702
- scripts: {
703
- showcase: false,
704
- },
705
- }
706
- ```
707
-
708
- Override a script:
709
-
710
- ```js
711
- export default {
712
- scripts: {
713
- showcase: {
714
- match: 'data-fading-citrus-showcase',
715
- render: () =>
716
- `<script type="application/javascript">/* custom */</script>`,
717
- },
718
- },
719
- }
720
- ```
721
-
722
- ## Extension Strategy
723
-
724
- Use the smallest override that solves the problem:
725
-
726
- 1. Override assets for logos, favicons, images, and icons.
727
- 2. Override `meta` fields for site identity and social card defaults.
728
- 3. Override theme variables for color and surface tuning.
729
- 4. Add Markdown layout handlers for new page sections.
730
- 5. Override existing Markdown layout handlers only when the section HTML needs to change.
731
- 6. Override `_header.js`, `_footer.js`, or `_head-meta.js` when navigation, footer copy, metadata shape, or brand assumptions need to change.
732
- 7. Override `landing.js` or `document.js` only when the full page shell changes.
733
-
734
- Example docs extension:
735
-
736
- ```txt
737
- docs/
738
- index.md
739
- _template/
740
- template.config.js
741
- assets/
742
- logo.svg
743
- layouts/
744
- pricing-cards.js
745
- ```
746
-
747
- ```js
748
- // docs/_template/template.config.js
749
- import pricingCards from './layouts/pricing-cards.js'
750
-
751
- export default {
752
- meta: {
753
- siteName: 'Example',
754
- title: 'Example by Before Semicolon',
755
- description: 'Documentation for Example.',
756
- image: '/assets/site-image.jpg',
757
- },
758
- markdownLayouts: {
759
- 'pricing-cards': pricingCards,
760
- },
761
- theme: {
762
- light: {
763
- '--primary': 'oklch(0.62 0.18 250)',
764
- },
765
- dark: {
766
- '--primary': 'oklch(0.78 0.16 250)',
767
- },
768
- },
769
- }
770
- ```
771
-
772
- ## Minimal Landing Page
773
-
774
- ````md
775
- ---
776
- title: Example
777
- description: Example documentation.
778
- layout: landing
779
- ---
780
-
781
- ::: layout landing-hero title="Example Docs." title2="Built fast." primaryLabel="Read Docs" secondaryLabel="npm i example"
782
-
783
- === copy
784
-
785
- Useful docs for a focused package.
786
-
787
- === stat
788
-
789
- ## Small
790
-
791
- runtime
792
-
793
- === code filename=example.js lang=javascript
794
-
795
- ```javascript
796
- import { example } from 'example'
797
-
798
- example()
799
- ```
800
- ````
801
-
802
- :::
803
-
804
- ````
805
-
806
- ## Minimal Documentation Page
807
-
808
- ```md
809
- ---
810
- name: Get Started
811
- title: Get Started
812
- description: Install and use the package.
813
- layout: document
814
- order: 1
815
- ---
816
-
817
- # Get Started
818
-
819
- Install the package and render your first example.
820
- ````
821
-
822
- For the default `document` layout, place documentation pages under `docs/documentation` so the side navigation can be generated from the `documentation` site map group.