@zeropress/build-pages 0.6.2 → 0.6.4

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
@@ -19,7 +19,7 @@ public directory
19
19
  |
20
20
  v
21
21
  @zeropress/build-pages
22
- generates .zeropress/preview-data.json
22
+ generates .zeropress-build-page/preview-data.json
23
23
  stages public files
24
24
  |
25
25
  v
@@ -40,7 +40,7 @@ flowchart TD
40
40
  config --> buildPages
41
41
  publicFiles --> buildPages
42
42
 
43
- buildPages --> previewData[".zeropress/preview-data.json<br/>internal generated build input"]
43
+ buildPages --> previewData[".zeropress-build-page/preview-data.json<br/>internal generated build input"]
44
44
  buildPages --> stagedPublic["Staged public files"]
45
45
 
46
46
  previewData --> build["@zeropress/build"]
@@ -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,27 +129,38 @@ 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
- - `theme` is the bundled theme name. The default is `docs`.
157
+ - `theme` is the bundled theme name. The default is `docs`; `docs1` is an alias for `docs`.
149
158
  - `theme-path` is a custom local ZeroPress theme directory. It takes precedence over `theme`.
150
159
  - `config` is the config file path. The default is `<source>/.zeropress/config.json`.
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. `docs1` aliases `docs`. |
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
 
@@ -241,11 +270,11 @@ Root-level public files named `favicon.ico`, `favicon.svg`, `favicon.png`, and `
241
270
 
242
271
  A root-level public `sitemap.xsl` is copied to the destination. When ZeroPress generates `sitemap.xml`, it auto-discovers that file and adds an XML stylesheet processing instruction for `/sitemap.xsl`.
243
272
 
244
- The source directory must not overlap the destination directory, the selected theme directory, or the internal `.zeropress/` working directory. An explicit public directory must be an existing dedicated directory and must not be a file, symlink, repository root, destination directory, selected theme directory, or internal `.zeropress/` working directory.
273
+ The source directory must not overlap the destination directory, the selected theme directory, or the internal `.zeropress-build-page/` working directory. An explicit public directory must be an existing dedicated directory and must not be a file, symlink, repository root, destination directory, selected theme directory, or internal `.zeropress-build-page/` working directory.
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
 
@@ -283,6 +312,7 @@ description: Build a static docs site from Markdown.
283
312
  path: guides/install
284
313
  status: published
285
314
  discoverability: default
315
+ last_updated: none
286
316
  meta:
287
317
  source: docs
288
318
  data:
@@ -308,6 +338,7 @@ Supported front matter fields:
308
338
  | `path` | Generated route path, such as `guides/install` for `/guides/install`. |
309
339
  | `status` | `published` includes the page. `draft` skips the page. Other values warn and skip. |
310
340
  | `discoverability` | `default`, `noindex`, or `delist`. Missing is `default`. |
341
+ | `last_updated` | `none` or `git`. Overrides config `markdown.last_updated` for this page. |
311
342
  | `meta` | Optional scalar/null metadata copied to the generated page. |
312
343
  | `data` | Optional structured JSON-style data for theme-facing lists, facts, galleries, timelines, or swatches. |
313
344
 
@@ -323,6 +354,8 @@ Unknown front matter fields are ignored to make migration from existing Markdown
323
354
 
324
355
  `delist` is not a security or permission feature. Direct links, explicit menus, explicit collections, and body links can still expose the page.
325
356
 
357
+ `last_updated` controls optional Git-based page metadata. If config uses `markdown.last_updated: "git"`, set `last_updated: none` on landing, index, or promotional pages that should not show an update date. If config uses `none`, set `last_updated: git` on a specific information page to opt in.
358
+
326
359
  Use `meta` for small scalar flags and metadata. Use `data` when a theme should iterate structured content:
327
360
 
328
361
  ```html
@@ -332,28 +365,86 @@ Use `meta` for small scalar flags and metadata. Use `data` when a theme should i
332
365
  {{/for}}
333
366
  ```
334
367
 
368
+ ## Markdown Rendering
369
+
370
+ Build Pages renders Markdown through ZeroPress build-core before writing HTML.
371
+ This includes common Markdown extensions such as tables, strikethrough, task
372
+ lists, GitHub-style alerts, heading IDs, and fenced code blocks.
373
+
374
+ Fenced code blocks are highlighted at build time with `highlight.js`.
375
+
376
+ ````md
377
+ ```js
378
+ console.log("hello");
379
+ ```
380
+ ````
381
+
382
+ When a fenced code block has a language info string and `highlight.js`
383
+ recognizes it, ZeroPress uses that language. If the language is missing or not
384
+ recognized, ZeroPress falls back to automatic detection. The generated markup
385
+ keeps the `language-*` class and adds `hljs-*` token classes for highlighted
386
+ spans:
387
+
388
+ ```html
389
+ <pre><code class="language-js">...</code></pre>
390
+ ```
391
+
392
+ Themes only need CSS for the generated code markup. A client-side
393
+ `highlight.js` script is not required for Markdown rendered during the build.
394
+
395
+ ZeroPress build-core currently uses `highlight.js@11.11.1` and the built-in
396
+ languages returned by `hljs.listLanguages()`. In this release, that is 192
397
+ canonical language names, plus recognized aliases such as `js`, `ts`, `jsx`,
398
+ `sh`, and `zsh`. A language listed in the Highlight.js documentation with a
399
+ third-party package is not bundled by ZeroPress unless it is also present in
400
+ `hljs.listLanguages()`.
401
+
402
+ See the upstream
403
+ [`highlight.js@11.11.1` supported languages table](https://github.com/highlightjs/highlight.js/blob/11.11.1/SUPPORTED_LANGUAGES.md)
404
+ for language names, aliases, and third-party package notes. Common built-in
405
+ examples include `bash`, `shell`, `js`, `javascript`, `ts`, `typescript`,
406
+ `json`, `yaml`, `html`, `xml`, `css`, `scss`, `python`, `ruby`, `php`, `java`,
407
+ `go`, `rust`, `c`, `cpp`, `csharp`, `sql`, `graphql`, `dockerfile`, `nginx`,
408
+ `markdown`, and `diff`.
409
+
410
+ Mermaid is intentionally different: `mermaid` fences remain readable code
411
+ blocks such as `pre code.language-mermaid`. Diagram rendering is optional
412
+ progressive enhancement owned by the theme or site.
413
+
335
414
  ## Config
336
415
 
337
416
  Build Pages reads `<source>/.zeropress/config.json` when present. Missing config falls back to defaults.
338
417
 
339
- See the public config reference at [zeropress.dev/build-pages-config](https://zeropress.dev/build-pages-config/).
418
+ See the public config reference at [zeropress.dev/build-pages-config](https://zeropress.dev/build-pages/config/).
340
419
 
341
420
  ```json
342
421
  {
343
- "$schema": "https://zeropress.dev/schemas/zeropress-build-pages.config.v0.1.schema.json",
422
+ "$schema": "https://schemas.zeropress.dev/build-pages-config/v0.1/schema.json",
344
423
  "version": "0.1",
345
424
  "site": {
346
425
  "title": "My Docs",
347
426
  "description": "Project documentation",
348
427
  "url": "https://example.github.io/project",
428
+ "logo": {
429
+ "src": "/logo.svg",
430
+ "alt": "My Docs"
431
+ },
432
+ "locale": "en-US",
349
433
  "expose_generator": true,
350
434
  "search": true,
351
435
  "indexing": true,
352
436
  "footer": {
353
437
  "copyright_text": "Copyright 2026 Example Corp.",
354
438
  "attribution": true
439
+ },
440
+ "meta": {
441
+ "issue": "Spring 2026",
442
+ "show_sponsor_banner": false
355
443
  }
356
444
  },
445
+ "markdown": {
446
+ "last_updated": "git"
447
+ },
357
448
  "front_page": {
358
449
  "type": "markdown"
359
450
  },
@@ -373,6 +464,15 @@ See the public config reference at [zeropress.dev/build-pages-config](https://ze
373
464
  ]
374
465
  }
375
466
  },
467
+ "collections": {
468
+ "guides": {
469
+ "title": "Guides",
470
+ "items": [
471
+ "getting-started/index.md",
472
+ "deployment/index.md"
473
+ ]
474
+ }
475
+ },
376
476
  "custom_html": {
377
477
  "head_end": { "file": ".zeropress/head-end.html" },
378
478
  "body_end": { "file": ".zeropress/body-end.html" }
@@ -391,37 +491,62 @@ HTML front page and `custom_html` files must stay inside `.zeropress/`.
391
491
 
392
492
  Menu item `meta` is optional scalar display metadata copied into generated preview-data for themes that manually iterate menus. Use it for small values such as `icon`, `badge`, or `accent`; arrays and objects are not accepted.
393
493
 
494
+ `collections` defines group-level reading order from Markdown source paths. Build Pages converts each source-relative `.md` path into preview-data collection items such as `{ "type": "page", "slug": "deployment" }`. Collection prev/next cursors stop at collection boundaries, so the last item in `collections.guides` does not continue into another collection.
495
+
496
+ `markdown.last_updated` is optional and accepts `none` or `git`. Missing or `none` keeps current behavior and generates no update date. `git` reads each Markdown file's latest Git commit date and adds `page.meta.last_updated_iso` plus `page.meta.last_updated` to generated preview-data when the page does not already define those meta keys. `last_updated_iso` keeps the Git ISO timestamp; `last_updated` is a stable `YYYY-MM-DD` fallback display string. For accurate history in GitHub Actions, configure checkout with `fetch-depth: 0`.
497
+
498
+ Themes can render the generated value with normal escaped interpolation:
499
+
500
+ ```html
501
+ {{#if page.meta.last_updated_iso}}
502
+ <time datetime="{{page.meta.last_updated_iso}}" data-zp-local-date>
503
+ {{page.meta.last_updated}}
504
+ </time>
505
+ {{/if}}
506
+ ```
507
+
508
+ Client-side progressive enhancement may replace the fallback text with a localized date. The fallback remains useful when JavaScript is unavailable.
509
+
394
510
  `site.footer.copyright_text` is rendered by the bundled docs theme when present. If it is omitted, the bundled docs theme falls back to `site.title`. ZeroPress does not add a copyright symbol automatically.
395
511
 
396
512
  The bundled docs theme shows `Published with ZeroPress.` by default. Set `site.footer.attribution` to `false` to hide it.
397
513
 
514
+ `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.
515
+
516
+ `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`.
517
+
518
+ `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`.
519
+
398
520
  `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
521
 
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.
522
+ `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.
523
+
524
+ Schemas:
525
+
526
+ - [ZeroPress Build Pages Config v0.1](https://schemas.zeropress.dev/build-pages-config/v0.1/schema.json)
527
+
528
+ ## Search
529
+
530
+ The bundled docs theme supports ZeroPress native search. `site.search` controls whether search artifacts and bundled search UI are enabled.
531
+
532
+ 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`.
533
+
534
+ Set `site.search` to `false` to omit those search artifacts and hide the bundled search form.
401
535
 
402
536
  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
537
 
404
538
  ```bash
405
- npx pagefind@latest \
406
- --site ./_site \
407
- --output-subdir _zeropress/pagefind
408
-
539
+ npx pagefind@latest --site ./_site --output-subdir _zeropress/pagefind
409
540
  cp ./_site/_zeropress/search_pagefind.js ./_site/_zeropress/search.js
410
541
  rm ./_site/_zeropress/search.json
411
542
  ```
412
543
 
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
- ## Workspace Internal `.zeropress/` Files
544
+ ## Workspace Internal `.zeropress-build-page/` Files
420
545
 
421
- 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.
546
+ Build Pages reads optional user-authored site config from `<source>/.zeropress/config.json`. Separately, it writes generated internal working files to `.zeropress-build-page/` 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.
422
547
 
423
548
  ```txt
424
- .zeropress/
549
+ .zeropress-build-page/
425
550
  build-pages-config.json
426
551
  preview-data.json
427
552
  build-report.json
package/action.yml CHANGED
@@ -17,7 +17,7 @@ inputs:
17
17
  required: false
18
18
  default: ./_site
19
19
  theme:
20
- description: Bundled theme name. Currently supports "docs".
20
+ description: Bundled theme name. Supports "docs" and alias "docs1".
21
21
  required: false
22
22
  default: docs
23
23
  theme-path: