@zeropress/build-pages 0.5.4 → 0.5.6
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 +74 -22
- package/action.yml +4 -0
- package/dist/action.js +676 -58
- package/dist/prebuild.js +23 -6
- package/package.json +2 -2
- package/schemas/zeropress-build-pages.config.v0.1.schema.json +9 -2
- package/src/action.js +5 -0
- package/src/index.js +13 -0
- package/src/prebuild.js +22 -4
- package/schemas/zeropress-build-pages.config.schema.json +0 -5
package/README.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# @zeropress/build-pages
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+
|
|
3
6
|
Build ZeroPress static output for modern hosting platforms.
|
|
4
7
|
|
|
5
|
-
`@zeropress/build-pages` turns a directory of Markdown files and public assets into a static ZeroPress site. It discovers Markdown pages, prepares the site data, stages public files, and runs `@zeropress/build
|
|
8
|
+
`@zeropress/build-pages` turns a directory of Markdown files and public assets into a static ZeroPress site. It discovers Markdown pages, prepares the site data, stages public files, and runs [`@zeropress/build`](https://github.com/zeropress-app/zeropress-build).
|
|
6
9
|
|
|
7
10
|
The generated output is plain static files that can be deployed to GitHub Pages, Cloudflare Pages, Netlify, Vercel, or any static hosting provider.
|
|
8
11
|
|
|
@@ -46,7 +49,7 @@ flowchart TD
|
|
|
46
49
|
output --> html["HTML pages"]
|
|
47
50
|
output --> assets["Theme assets"]
|
|
48
51
|
output --> copied["Copied public files"]
|
|
49
|
-
output --> special["sitemap.xml / robots.txt / feed.xml"]
|
|
52
|
+
output --> special["sitemap.xml / fallback robots.txt / feed.xml"]
|
|
50
53
|
```
|
|
51
54
|
|
|
52
55
|
## Usage
|
|
@@ -97,10 +100,52 @@ jobs:
|
|
|
97
100
|
|
|
98
101
|
The action `zeropress-build-pages` builds the static files only. Uploading and deploying are handled by your hosting provider's deployment action or CLI.
|
|
99
102
|
|
|
103
|
+
Minimal action usage:
|
|
104
|
+
|
|
105
|
+
```yaml
|
|
106
|
+
- name: Build ZeroPress Pages
|
|
107
|
+
uses: zeropress-app/zeropress-build-pages@v0
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
That is equivalent to:
|
|
111
|
+
|
|
112
|
+
```yaml
|
|
113
|
+
- name: Build ZeroPress Pages
|
|
114
|
+
uses: zeropress-app/zeropress-build-pages@v0
|
|
115
|
+
with:
|
|
116
|
+
source: ./docs
|
|
117
|
+
destination: ./_site
|
|
118
|
+
theme: docs
|
|
119
|
+
skip-untitled-markdown: false
|
|
120
|
+
skip-link-check: false
|
|
121
|
+
copy-markdown-source: true
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Custom input example:
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
- name: Build ZeroPress Pages
|
|
128
|
+
uses: zeropress-app/zeropress-build-pages@v0
|
|
129
|
+
with:
|
|
130
|
+
source: ./documents
|
|
131
|
+
destination: ./_site
|
|
132
|
+
theme-path: ./theme-docs
|
|
133
|
+
config: ./documents/.zeropress/config.json
|
|
134
|
+
site-url: https://example.com/docs
|
|
135
|
+
copy-markdown-source: false
|
|
136
|
+
```
|
|
137
|
+
|
|
100
138
|
In the action inputs:
|
|
101
139
|
|
|
102
140
|
- `source` is the directory that contains your Markdown pages, public files, and optional `.zeropress/config.json`. The default is `./docs`.
|
|
103
141
|
- `destination` is the directory where the generated static site is written. The default is `./_site`.
|
|
142
|
+
- `theme` is the bundled theme name. The default is `docs`.
|
|
143
|
+
- `theme-path` is a custom local ZeroPress theme directory. It takes precedence over `theme`.
|
|
144
|
+
- `config` is the config file path. The default is `<source>/.zeropress/config.json`.
|
|
145
|
+
- `site-url` overrides the canonical site URL from config.
|
|
146
|
+
- `skip-untitled-markdown` skips Markdown files without a page title instead of failing. The default is `false`.
|
|
147
|
+
- `skip-link-check` skips internal link checking after build. The default is `false`.
|
|
148
|
+
- `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`.
|
|
104
149
|
|
|
105
150
|
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.
|
|
106
151
|
|
|
@@ -146,23 +191,29 @@ The CLI requires explicit input and output paths. The GitHub Action keeps safe d
|
|
|
146
191
|
| `--site-url <url>` | config `site.url` | Canonical URL override |
|
|
147
192
|
| `--skip-untitled-markdown` | `false` | Skip Markdown without a page title |
|
|
148
193
|
| `--skip-link-check` | `false` | Skip link checking |
|
|
194
|
+
| `--no-copy-markdown-source` | `false` | Do not copy original Markdown files to output |
|
|
149
195
|
|
|
150
196
|
## Source Tree
|
|
151
197
|
|
|
152
|
-
The source directory is both the Markdown source root and the public passthrough root. GitHub Action usage defaults to `./docs`; CLI usage requires `--source`.
|
|
198
|
+
The source directory is the folder that Build Pages reads. It is both the Markdown source root and the public passthrough root. GitHub Action usage defaults to `./docs`; CLI usage requires `--source`.
|
|
153
199
|
|
|
154
|
-
Use a dedicated content directory such as `docs/` or `documents/`. Repository root source (`--source ./`) is not supported
|
|
200
|
+
Use a dedicated content directory such as `docs/` or `documents/`. Repository root source (`--source ./`) is not supported.
|
|
155
201
|
|
|
156
202
|
```txt
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
203
|
+
my-site/
|
|
204
|
+
docs/ # source
|
|
205
|
+
index.md
|
|
206
|
+
guide.md
|
|
207
|
+
assets/
|
|
208
|
+
logo.png
|
|
209
|
+
.zeropress/
|
|
210
|
+
config.json
|
|
211
|
+
_site/ # destination, generated
|
|
163
212
|
```
|
|
164
213
|
|
|
165
|
-
Build Pages stages the source tree before calling `@zeropress/build
|
|
214
|
+
Build Pages stages the source tree before calling [`@zeropress/build`](https://github.com/zeropress-app/zeropress-build). Generated ZeroPress output wins over staged public files.
|
|
215
|
+
|
|
216
|
+
Root-level source favicon files named `favicon.ico`, `favicon.svg`, `favicon.png`, and `apple-touch-icon.png` are copied to the destination and auto-injected into generated HTML `<head>` output.
|
|
166
217
|
|
|
167
218
|
The source directory must not overlap the destination directory, the selected theme directory, or the internal `.zeropress/` working directory.
|
|
168
219
|
|
|
@@ -192,7 +243,8 @@ Additional Markdown discovery ignores:
|
|
|
192
243
|
- Nested `index.md` maps to a directory route, such as `cli/index.md` -> `/cli/`.
|
|
193
244
|
- Other Markdown files map to extensionless routes, such as `cli/tool.md` -> `/cli/tool`.
|
|
194
245
|
- Markdown links to other discovered `.md` files are rewritten to generated public URLs.
|
|
195
|
-
- Original Markdown files remain available as public passthrough files.
|
|
246
|
+
- Original Markdown files remain available as public passthrough files by default.
|
|
247
|
+
- 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.
|
|
196
248
|
|
|
197
249
|
Optional YAML front matter is supported at the top of Markdown files:
|
|
198
250
|
|
|
@@ -227,6 +279,8 @@ Unknown front matter fields are ignored to make migration from existing Markdown
|
|
|
227
279
|
|
|
228
280
|
Build Pages reads `<source>/.zeropress/config.json` when present. Missing config falls back to defaults.
|
|
229
281
|
|
|
282
|
+
See the public config reference at [zeropress.dev/build-pages-config](https://zeropress.dev/build-pages-config/).
|
|
283
|
+
|
|
230
284
|
```json
|
|
231
285
|
{
|
|
232
286
|
"$schema": "https://zeropress.dev/schemas/zeropress-build-pages.config.v0.1.schema.json",
|
|
@@ -235,6 +289,7 @@ Build Pages reads `<source>/.zeropress/config.json` when present. Missing config
|
|
|
235
289
|
"title": "My Docs",
|
|
236
290
|
"description": "Project documentation",
|
|
237
291
|
"url": "https://example.github.io/project",
|
|
292
|
+
"indexing": true,
|
|
238
293
|
"footer": {
|
|
239
294
|
"copyright_text": "Copyright 2026 Example Corp.",
|
|
240
295
|
"attribution": {
|
|
@@ -274,10 +329,11 @@ HTML front page and `custom_html` files must stay inside `.zeropress/`.
|
|
|
274
329
|
|
|
275
330
|
The bundled docs theme shows `Published with ZeroPress.` by default. Set `site.footer.attribution.enabled` to `false` to hide it.
|
|
276
331
|
|
|
332
|
+
`site.indexing` controls only the generated fallback `robots.txt`. Missing or `true` allows indexing; `false` writes `User-agent: *` / `Disallow: /`. If the source 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 source-provided `robots.txt`; add `Sitemap: https://example.com/sitemap.xml` manually when needed.
|
|
333
|
+
|
|
277
334
|
Schemas:
|
|
278
335
|
|
|
279
|
-
-
|
|
280
|
-
- `schemas/zeropress-build-pages.config.schema.json`
|
|
336
|
+
- [ZeroPress Build Pages Config v0.1](https://zeropress.dev/schemas/zeropress-build-pages.config.v0.1.schema.json)
|
|
281
337
|
|
|
282
338
|
## Internal `.zeropress/` Files
|
|
283
339
|
|
|
@@ -295,18 +351,14 @@ Build Pages writes internal working files to `.zeropress/` in the current workin
|
|
|
295
351
|
|
|
296
352
|
`preview-data.json` is an internal generated build input for the ZeroPress renderer. Most users do not need to edit or understand this file.
|
|
297
353
|
|
|
298
|
-
`build-report.json` records discovered Markdown counts, skipped Markdown files, front page resolution, and custom HTML slots.
|
|
354
|
+
`build-report.json` records discovered Markdown counts, skipped Markdown files, front page resolution, source Markdown copy policy, and custom HTML slots.
|
|
299
355
|
|
|
300
356
|
`public-assets/` is a temporary staged public root used before the final ZeroPress render.
|
|
301
357
|
|
|
302
358
|
## Destination Output
|
|
303
359
|
|
|
304
|
-
The `destination` directory contains the deployable static site. It includes generated ZeroPress HTML, copied public files, and original Markdown files unless
|
|
360
|
+
The `destination` directory contains the deployable static site. It includes generated ZeroPress HTML, copied public files, and original Markdown files unless Markdown source copy is disabled or files are excluded by the public passthrough rules. A source `robots.txt` is copied as a site-owned policy file; otherwise ZeroPress writes a fallback `robots.txt` with a sitemap directive when `site.url` is available. Root-level source favicon files are copied and represented as generated HTML head links.
|
|
305
361
|
|
|
306
|
-
##
|
|
362
|
+
## Demo
|
|
307
363
|
|
|
308
|
-
|
|
309
|
-
npm install
|
|
310
|
-
npm run build:action
|
|
311
|
-
npm test
|
|
312
|
-
```
|
|
364
|
+
- [zeropress.dev](https://github.com/zeropress-app/zeropress.dev) is built with `@zeropress/build-pages`.
|
package/action.yml
CHANGED
|
@@ -34,6 +34,10 @@ inputs:
|
|
|
34
34
|
description: Skip internal link checking after the site is built.
|
|
35
35
|
required: false
|
|
36
36
|
default: "false"
|
|
37
|
+
copy-markdown-source:
|
|
38
|
+
description: Copy original Markdown files to output and expose View this page as Markdown links.
|
|
39
|
+
required: false
|
|
40
|
+
default: "true"
|
|
37
41
|
runs:
|
|
38
42
|
using: node24
|
|
39
43
|
main: dist/action.js
|