@zeropress/build-pages 0.6.2 → 0.6.3

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 CHANGED
@@ -85,7 +85,6 @@ jobs:
85
85
  uses: zeropress-app/zeropress-build-pages@v0
86
86
  with:
87
87
  source: ./docs
88
- public-dir: ./public
89
88
  destination: ./_site
90
89
  - name: Upload artifact
91
90
  uses: actions/upload-pages-artifact@v5
@@ -117,7 +116,6 @@ That is equivalent to:
117
116
  uses: zeropress-app/zeropress-build-pages@v0
118
117
  with:
119
118
  source: ./docs
120
- public-dir: ./docs
121
119
  destination: ./_site
122
120
  theme: docs
123
121
  skip-untitled-markdown: false
@@ -131,19 +129,30 @@ Custom input example:
131
129
  - name: Build ZeroPress Pages
132
130
  uses: zeropress-app/zeropress-build-pages@v0
133
131
  with:
134
- source: ./documents
132
+ source: ./docs
135
133
  public-dir: ./public
136
134
  destination: ./_site
137
135
  theme-path: ./theme-docs
138
- config: ./documents/.zeropress/config.json
136
+ config: ./docs/.zeropress/config.json
139
137
  site-url: https://example.com/docs
140
138
  copy-markdown-source: false
141
139
  ```
142
140
 
141
+ Separate public asset directory example:
142
+
143
+ ```yaml
144
+ - name: Build ZeroPress Pages
145
+ uses: zeropress-app/zeropress-build-pages@v0
146
+ with:
147
+ source: ./docs
148
+ public-dir: ./public
149
+ destination: ./_site
150
+ ```
151
+
143
152
  In the action inputs:
144
153
 
145
154
  - `source` is the directory that contains your Markdown pages and optional `.zeropress/config.json`. The default is `./docs`.
146
- - `public-dir` is the directory copied as public passthrough files. The default is `source`.
155
+ - `public-dir` is the directory copied as public passthrough files. The default is `source`. If you set it explicitly, the directory must exist.
147
156
  - `destination` is the directory where the generated static site is written. The default is `./_site`.
148
157
  - `theme` is the bundled theme name. The default is `docs`.
149
158
  - `theme-path` is a custom local ZeroPress theme directory. It takes precedence over `theme`.
@@ -151,7 +160,7 @@ In the action inputs:
151
160
  - `site-url` overrides the canonical site URL from config.
152
161
  - `skip-untitled-markdown` skips Markdown files without a page title instead of failing. The default is `false`.
153
162
  - `skip-link-check` skips internal link checking after build. The default is `false`; broken internal links are reported as warnings and do not fail the build.
154
- - `copy-markdown-source` copies original Markdown files to the generated output and enables `View this page as Markdown` links in the bundled docs theme. The default is `true`.
163
+ - `copy-markdown-source` copies original Markdown files to the generated output and enables `View this page as Markdown` links in the bundled docs theme. The default is `true`; when set to `false`, public `.md` passthrough files are also skipped.
155
164
 
156
165
  For GitHub Pages, the generated `destination` directory can be passed to `actions/upload-pages-artifact`. For Cloudflare Pages, Netlify, Vercel, or another static host, pass the same `destination` directory to that provider's deploy step.
157
166
 
@@ -169,12 +178,32 @@ with:
169
178
  theme-path: ./my-docs-theme/theme
170
179
  ```
171
180
 
181
+ ### Vercel
182
+
183
+ Use the `Other` framework preset and set the generated output directory as Vercel's Output Directory.
184
+
185
+ Project settings:
186
+
187
+ | Setting | Value |
188
+ | --- | --- |
189
+ | Framework Preset | `Other` |
190
+ | Build Command | `npx --yes @zeropress/build-pages --source ./docs --destination ./_site` |
191
+ | Output Directory | `_site` |
192
+
193
+ If your public assets live outside the source directory, include `--public-dir`:
194
+
195
+ ```bash
196
+ npx --yes @zeropress/build-pages --source ./docs --public-dir ./public --destination ./_site
197
+ ```
198
+
199
+ If your project uses a `package.json` script, set the Vercel Build Command to `npm run build` and keep the Output Directory as `_site`.
200
+
172
201
  ### npx
173
202
 
174
203
  Use `npx` when you want to run Build Pages without adding it to your project dependencies.
175
204
 
176
205
  ```bash
177
- npx @zeropress/build-pages --source ./documents --destination ./_site
206
+ npx @zeropress/build-pages --source ./docs --destination ./_site
178
207
  ```
179
208
 
180
209
  ### package.json script
@@ -188,7 +217,7 @@ npm install --save-dev @zeropress/build-pages
188
217
  ```json
189
218
  {
190
219
  "scripts": {
191
- "build": "zeropress-build-pages --source ./documents --destination ./_site"
220
+ "build": "zeropress-build-pages --source ./docs --destination ./_site"
192
221
  }
193
222
  }
194
223
  ```
@@ -204,15 +233,15 @@ The CLI requires explicit input and output paths. The GitHub Action keeps safe d
204
233
  | Option | Default | Purpose |
205
234
  | --- | --- | --- |
206
235
  | `--source <dir>` | required | Dedicated source directory containing Markdown and optional config |
207
- | `--public-dir <dir>` | source | Public passthrough directory |
236
+ | `--public-dir <dir>` | source | Public passthrough directory. Explicit paths must exist. |
208
237
  | `--destination <dir>` | required | Output directory |
209
- | `--theme docs` | `docs` | Bundled docs theme |
238
+ | `--theme <name>` | `docs` | Bundled theme name |
210
239
  | `--theme-path <dir>` | none | Custom ZeroPress theme directory |
211
240
  | `--config <path>` | `<source>/.zeropress/config.json` | Build Pages config |
212
241
  | `--site-url <url>` | config `site.url` | Canonical URL override |
213
242
  | `--skip-untitled-markdown` | `false` | Skip Markdown without a page title |
214
243
  | `--skip-link-check` | `false` | Skip warning-only internal link checking |
215
- | `--no-copy-markdown-source` | `false` | Do not copy original Markdown files to output |
244
+ | `--no-copy-markdown-source` | `false` | Do not copy source Markdown or public `.md` files to output |
216
245
 
217
246
  ## Source Tree
218
247
 
@@ -245,7 +274,7 @@ The source directory must not overlap the destination directory, the selected th
245
274
 
246
275
  If `public-dir` is inside `source`, Build Pages excludes that public subtree from Markdown page discovery.
247
276
 
248
- Ignored while staging and Markdown discovery:
277
+ Ignored while copying public passthrough files and discovering Markdown pages:
249
278
 
250
279
  - hidden paths such as `.git`, `.env`, and `.zeropress`
251
280
  - `node_modules`
@@ -272,7 +301,7 @@ Additional Markdown discovery ignores:
272
301
  - Other Markdown files map to extensionless routes, such as `cli/tool.md` -> `/cli/tool`.
273
302
  - Markdown links to other discovered `.md` files are rewritten to generated public URLs.
274
303
  - Original Markdown files remain available as public passthrough files by default.
275
- - Use `--no-copy-markdown-source` or Action input `copy-markdown-source: false` to keep source Markdown out of the generated output. This also hides bundled theme `View this page as Markdown` links.
304
+ - Use `--no-copy-markdown-source` or Action input `copy-markdown-source: false` to keep source Markdown and public `.md` passthrough files out of the generated output. This also hides bundled theme `View this page as Markdown` links.
276
305
 
277
306
  Optional YAML front matter is supported at the top of Markdown files:
278
307
 
@@ -332,6 +361,52 @@ Use `meta` for small scalar flags and metadata. Use `data` when a theme should i
332
361
  {{/for}}
333
362
  ```
334
363
 
364
+ ## Markdown Rendering
365
+
366
+ Build Pages renders Markdown through ZeroPress build-core before writing HTML.
367
+ This includes common Markdown extensions such as tables, strikethrough, task
368
+ lists, GitHub-style alerts, heading IDs, and fenced code blocks.
369
+
370
+ Fenced code blocks are highlighted at build time with `highlight.js`.
371
+
372
+ ````md
373
+ ```js
374
+ console.log("hello");
375
+ ```
376
+ ````
377
+
378
+ When a fenced code block has a language info string and `highlight.js`
379
+ recognizes it, ZeroPress uses that language. If the language is missing or not
380
+ recognized, ZeroPress falls back to automatic detection. The generated markup
381
+ keeps the `language-*` class and adds `hljs-*` token classes for highlighted
382
+ spans:
383
+
384
+ ```html
385
+ <pre><code class="language-js">...</code></pre>
386
+ ```
387
+
388
+ Themes only need CSS for the generated code markup. A client-side
389
+ `highlight.js` script is not required for Markdown rendered during the build.
390
+
391
+ ZeroPress build-core currently uses `highlight.js@11.11.1` and the built-in
392
+ languages returned by `hljs.listLanguages()`. In this release, that is 192
393
+ canonical language names, plus recognized aliases such as `js`, `ts`, `jsx`,
394
+ `sh`, and `zsh`. A language listed in the Highlight.js documentation with a
395
+ third-party package is not bundled by ZeroPress unless it is also present in
396
+ `hljs.listLanguages()`.
397
+
398
+ See the upstream
399
+ [`highlight.js@11.11.1` supported languages table](https://github.com/highlightjs/highlight.js/blob/11.11.1/SUPPORTED_LANGUAGES.md)
400
+ for language names, aliases, and third-party package notes. Common built-in
401
+ examples include `bash`, `shell`, `js`, `javascript`, `ts`, `typescript`,
402
+ `json`, `yaml`, `html`, `xml`, `css`, `scss`, `python`, `ruby`, `php`, `java`,
403
+ `go`, `rust`, `c`, `cpp`, `csharp`, `sql`, `graphql`, `dockerfile`, `nginx`,
404
+ `markdown`, and `diff`.
405
+
406
+ Mermaid is intentionally different: `mermaid` fences remain readable code
407
+ blocks such as `pre code.language-mermaid`. Diagram rendering is optional
408
+ progressive enhancement owned by the theme or site.
409
+
335
410
  ## Config
336
411
 
337
412
  Build Pages reads `<source>/.zeropress/config.json` when present. Missing config falls back to defaults.
@@ -340,18 +415,27 @@ See the public config reference at [zeropress.dev/build-pages-config](https://ze
340
415
 
341
416
  ```json
342
417
  {
343
- "$schema": "https://zeropress.dev/schemas/zeropress-build-pages.config.v0.1.schema.json",
418
+ "$schema": "https://schemas.zeropress.dev/build-pages-config/v0.1/schema.json",
344
419
  "version": "0.1",
345
420
  "site": {
346
421
  "title": "My Docs",
347
422
  "description": "Project documentation",
348
423
  "url": "https://example.github.io/project",
424
+ "logo": {
425
+ "src": "/logo.svg",
426
+ "alt": "My Docs"
427
+ },
428
+ "locale": "en-US",
349
429
  "expose_generator": true,
350
430
  "search": true,
351
431
  "indexing": true,
352
432
  "footer": {
353
433
  "copyright_text": "Copyright 2026 Example Corp.",
354
434
  "attribution": true
435
+ },
436
+ "meta": {
437
+ "issue": "Spring 2026",
438
+ "show_sponsor_banner": false
355
439
  }
356
440
  },
357
441
  "front_page": {
@@ -395,27 +479,36 @@ Menu item `meta` is optional scalar display metadata copied into generated previ
395
479
 
396
480
  The bundled docs theme shows `Published with ZeroPress.` by default. Set `site.footer.attribution` to `false` to hide it.
397
481
 
482
+ `site.logo` is optional theme-facing brand data. Use a root-relative public path for public logo files, or an absolute URL for media-hosted logos. Build Pages emits `media_base_url: ""`, so root-relative logo paths remain same-host public paths.
483
+
484
+ `site.locale` is optional language metadata copied into generated preview-data. It affects theme-facing `site.locale`, the common `language` render context value, generated HTML language metadata, and feed language. Missing `site.locale` defaults to `en-US`.
485
+
486
+ `site.meta` is an optional scalar extension map copied into generated preview-data. Use it for site-level theme conventions such as labels, feature flags, or issue names. Values must be strings, finite numbers, booleans, or null. Use first-class fields such as `site.logo.src` instead of ad hoc keys like `site.meta.logo_url`.
487
+
398
488
  `site.expose_generator` controls the HTML generator meta tag. Missing or `true` emits `<meta name="generator" content="ZeroPress">`; set it to `false` for white-label sites.
399
489
 
400
- `site.search` controls native ZeroPress search when the selected theme supports search UI. Missing or `true` enables native search for the bundled docs theme; `false` omits `/_zeropress/search.json`, `/_zeropress/search.js`, and `/_zeropress/search_pagefind.js` and hides the bundled search form.
490
+ `site.indexing` controls only the generated fallback `robots.txt`. Missing or `true` allows indexing; `false` writes `User-agent: *` / `Disallow: /`. If the public directory contains `robots.txt`, that file is copied as-is and takes priority over `site.indexing`. ZeroPress does not append a `Sitemap` directive to a public `robots.txt`; add `Sitemap: https://example.com/sitemap.xml` manually when needed.
491
+
492
+ Schemas:
493
+
494
+ - [ZeroPress Build Pages Config v0.1](https://schemas.zeropress.dev/build-pages-config/v0.1/schema.json)
495
+
496
+ ## Search
497
+
498
+ The bundled docs theme supports ZeroPress native search. `site.search` controls whether search artifacts and bundled search UI are enabled.
499
+
500
+ Missing or `true` enables native search for the bundled docs theme. Build Pages writes `/_zeropress/search.json`, `/_zeropress/search.js`, and `/_zeropress/search_pagefind.js`.
501
+
502
+ Set `site.search` to `false` to omit those search artifacts and hide the bundled search form.
401
503
 
402
504
  The bundled docs theme marks post/page body content with `data-pagefind-body`. If you run Pagefind after the ZeroPress build, keep the theme UI pointed at `/_zeropress/search.js` and replace the native adapter:
403
505
 
404
506
  ```bash
405
- npx pagefind@latest \
406
- --site ./_site \
407
- --output-subdir _zeropress/pagefind
408
-
507
+ npx pagefind@latest --site ./_site --output-subdir _zeropress/pagefind
409
508
  cp ./_site/_zeropress/search_pagefind.js ./_site/_zeropress/search.js
410
509
  rm ./_site/_zeropress/search.json
411
510
  ```
412
511
 
413
- `site.indexing` controls only the generated fallback `robots.txt`. Missing or `true` allows indexing; `false` writes `User-agent: *` / `Disallow: /`. If the public directory contains `robots.txt`, that file is copied as-is and takes priority over `site.indexing`. ZeroPress does not append a `Sitemap` directive to a public `robots.txt`; add `Sitemap: https://example.com/sitemap.xml` manually when needed.
414
-
415
- Schemas:
416
-
417
- - [ZeroPress Build Pages Config v0.1](https://zeropress.dev/schemas/zeropress-build-pages.config.v0.1.schema.json)
418
-
419
512
  ## Workspace Internal `.zeropress/` Files
420
513
 
421
514
  Build Pages reads optional site config from `<source>/.zeropress/config.json`. Separately, it writes internal working files to `.zeropress/` in the current working directory. These generated working files are not the final deploy output. The final static site is written to the `destination` directory.