edgepress 2026.9.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.
Files changed (80) hide show
  1. package/README.md +70 -0
  2. package/config.yml +146 -0
  3. package/content/pages/home/en.md +84 -0
  4. package/content/pages/home/zh-cn.md +84 -0
  5. package/content/pages/plugin-development/en.md +108 -0
  6. package/content/pages/plugin-development/zh-cn.md +108 -0
  7. package/content/pages/privacy-policy/en.md +73 -0
  8. package/content/pages/privacy-policy/zh-cn.md +73 -0
  9. package/content/pages/project-introduction/en.md +88 -0
  10. package/content/pages/project-introduction/zh-cn.md +88 -0
  11. package/content/pages/quick-start/en.md +147 -0
  12. package/content/pages/quick-start/zh-cn.md +147 -0
  13. package/content/pages/theme-development/en.md +106 -0
  14. package/content/pages/theme-development/zh-cn.md +106 -0
  15. package/content/posts/2026-09-23-edgepress-on-the-edge/en.md +169 -0
  16. package/content/posts/2026-09-23-edgepress-on-the-edge/zh-cn.md +169 -0
  17. package/content/posts/2026-09-24-edgepress-release-2026-9-1/en.md +30 -0
  18. package/content/posts/2026-09-24-edgepress-release-2026-9-1/zh-cn.md +30 -0
  19. package/content/posts/2026-09-25-edgepress-release-2026-9-2/en.md +28 -0
  20. package/content/posts/2026-09-25-edgepress-release-2026-9-2/zh-cn.md +28 -0
  21. package/content/posts/2026-09-25-edgepress-release-2026-9-3/en.md +39 -0
  22. package/content/posts/2026-09-25-edgepress-release-2026-9-3/zh-cn.md +39 -0
  23. package/edgepress.config.mjs +18 -0
  24. package/languages/base/en.json +55 -0
  25. package/languages/packs/zh-CN.json +55 -0
  26. package/package.json +59 -0
  27. package/plugins/consent/index.js +40 -0
  28. package/project-compatibility.json +48 -0
  29. package/src/assets.js +181 -0
  30. package/src/build.js +277 -0
  31. package/src/cli.js +344 -0
  32. package/src/concurrency.js +26 -0
  33. package/src/config.js +396 -0
  34. package/src/content.js +160 -0
  35. package/src/generators.js +263 -0
  36. package/src/i18n.js +64 -0
  37. package/src/maintenance.js +122 -0
  38. package/src/markdown.js +65 -0
  39. package/src/page-blocks.js +350 -0
  40. package/src/page-check.js +416 -0
  41. package/src/plugin-api.js +75 -0
  42. package/src/preview.js +167 -0
  43. package/src/report-visuals.js +480 -0
  44. package/src/theme.js +161 -0
  45. package/src/worker.js +139 -0
  46. package/static/.gitkeep +0 -0
  47. package/static/edgepress/language-select.js +5 -0
  48. package/static/edgepress/plugins/advertising/google-adsense.js +26 -0
  49. package/static/edgepress/plugins/captcha/cloudflare-turnstile.js +28 -0
  50. package/static/edgepress/plugins/captcha/google-recaptcha.js +27 -0
  51. package/static/edgepress/plugins/captcha/hcaptcha.js +27 -0
  52. package/static/edgepress/plugins/consent/manager.js +180 -0
  53. package/static/edgepress/plugins/statistics/baidu-tongji.js +8 -0
  54. package/static/edgepress/plugins/statistics/cloudflare-web-analytics.js +9 -0
  55. package/static/edgepress/plugins/statistics/google-analytics.js +13 -0
  56. package/static/edgepress/plugins/tracking/google-tag-manager.js +10 -0
  57. package/static/edgepress/plugins/tracking/meta-pixel.js +18 -0
  58. package/static/edgepress/search.js +84 -0
  59. package/static/edgepress-markdown-guide.svg +21 -0
  60. package/templates/gitignore +6 -0
  61. package/templates/site-readme.md +20 -0
  62. package/themes/atelier/assets/style.css +120 -0
  63. package/themes/atelier/layouts/layout.html +17 -0
  64. package/themes/atelier/layouts/partials/footer.html +4 -0
  65. package/themes/atelier/layouts/partials/head.html +17 -0
  66. package/themes/atelier/layouts/partials/header.html +5 -0
  67. package/themes/atelier/theme.json +6 -0
  68. package/themes/default/assets/style.css +157 -0
  69. package/themes/default/layouts/layout.html +12 -0
  70. package/themes/default/layouts/partials/footer.html +4 -0
  71. package/themes/default/layouts/partials/head.html +19 -0
  72. package/themes/default/layouts/partials/header.html +5 -0
  73. package/themes/default/theme.json +6 -0
  74. package/themes/signal/assets/style.css +113 -0
  75. package/themes/signal/layouts/layout.html +12 -0
  76. package/themes/signal/layouts/partials/footer.html +4 -0
  77. package/themes/signal/layouts/partials/head.html +17 -0
  78. package/themes/signal/layouts/partials/header.html +5 -0
  79. package/themes/signal/theme.json +6 -0
  80. package/wrangler.jsonc +13 -0
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # EdgePress
2
+
3
+ [![Deploy to Cloudflare](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/jsw-teams/edgepress)
4
+
5
+ The button deploys this repository's demo site to your Cloudflare account. To create a new site, follow the npm quick start below.
6
+
7
+ EdgePress builds static websites for Cloudflare Workers. Write posts in Markdown, compose pages from editable rows and elements, choose a shared theme, and build the site into dist/.
8
+
9
+ ## Quick start
10
+
11
+ Install EdgePress from npm and initialize a new project directory:
12
+
13
+ mkdir my-edgepress-site
14
+ cd my-edgepress-site
15
+ npm install edgepress
16
+ edgepress init
17
+ npm install
18
+ edgepress server
19
+
20
+ Use Node.js 22.12 or newer. Set the real site URL and operator contact in config.yml before publishing. Deploy with edgepress deploy. When developing EdgePress itself, use `npm ci`, then `npm link` to expose the local CLI.
21
+
22
+ Run `edgepress init` in a new project directory to scaffold a site pinned to the installed EdgePress release. The initializer keeps the existing package name and scripts.
23
+
24
+ ## Page editing
25
+
26
+ Each page has a folder under content/pages/ and one lowercase locale Markdown file per language. Keep the file body empty after its YAML front matter. Edit the ordered blocks there:
27
+
28
+ - Choose a row column count first.
29
+ - Add one cell per column.
30
+ - Choose element types inside each cell.
31
+ - Edit each element's copy, media, links, and presentation options in that page file.
32
+
33
+ Posts under content/posts/ use the Markdown renderer. Themes own shared head, navigation, footer, error-page layout, and their CSS color palettes.
34
+
35
+ ## Project files
36
+
37
+ - content/posts/<post-id>/: Markdown articles with one file per locale.
38
+ - content/pages/<page-id>/: page layouts and all page element content.
39
+ - themes/default/, themes/atelier/, themes/signal/: shared HTML layouts, partials, and theme styles. Themes installed from npm or created as a blank scaffold live here too.
40
+ - config.yml: site metadata, navigation, privacy settings, and consent-gated browser services.
41
+ - edgepress.config.mjs: paths, permalink, locales, and trusted build-time plugins.
42
+ - languages/base/ and languages/packs/: interface dictionaries.
43
+ - src/: CLI, builder, Markdown renderer, element renderer, page auditor, and Worker entry.
44
+ - dist/: generated output. Never edit generated files by hand.
45
+
46
+ ## Commands
47
+
48
+ - edgepress init: scaffold a new site in a project directory.
49
+ - edgepress new "Article title": create a Markdown post.
50
+ - edgepress build and edgepress generate: run the same generator and write static files to dist/ for Cloudflare Workers or static hosting.
51
+ - edgepress server: start live local preview, rebuild on source changes, and refresh the audit report.
52
+ - edgepress check: build, generate accessibility, agent-friendliness, and Markdown rendering findings, capture post/page desktop and mobile screenshots, and write the PDF report under tools/.
53
+ - edgepress doctor: inspect runtime and Worker compatibility.
54
+ - edgepress theme list and edgepress theme use <name>: inspect or select an installed theme.
55
+ - edgepress theme install <npm-package>[@version]: install a theme package from npm without running its install scripts.
56
+ - edgepress theme create <name>: make an empty, accessible HTML theme skeleton with editable partials and a blank stylesheet.
57
+ - edgepress secret put BACKEND_TOKEN: store the backend token in Wrangler.
58
+ - edgepress deploy: build and deploy to Cloudflare Workers.
59
+ - Connect a GitHub repository to Cloudflare Workers Builds to deploy on pushes to main. The build and deploy scripts are detected from package.json.
60
+ - edgepress clean: remove generated site and report files.
61
+ - edgepress iterate: create a report-only maintenance plan.
62
+ - edgepress security: check dependency advisories.
63
+
64
+ The generated report is written to tools/page-check.md and tools/page-check.json. The accessible HTML source is tools/page-check-visual.html; the tagged PDF report is tools/page-check.pdf, with desktop and mobile post/page screenshots in tools/page-check-screenshots/. The mobile entries include their measured viewport and document widths. These automated checks do not replace manual accessibility or legal review.
65
+
66
+ The header search page filters Markdown posts from the generated local search index; it does not send search queries to an external service. The first post, “EdgePress and Markdown: a complete writing guide,” documents and verifies the supported Markdown syntax in English and Chinese.
67
+
68
+ Project guides are published from content/pages/: project introduction, quick start, theme development, plugin development, and privacy policy. The privacy policy intentionally reports that the starter site still needs a real site URL, operator name, and privacy contact before publication.
69
+
70
+ Version 2026.9.3 records the third requested release update for September 2026. It is available as the `edgepress` npm package. See the [request 1 notes](content/posts/2026-09-24-edgepress-release-2026-9-1/), [request 2 notes](content/posts/2026-09-25-edgepress-release-2026-9-2/), and [request 3 notes](content/posts/2026-09-25-edgepress-release-2026-9-3/).
package/config.yml ADDED
@@ -0,0 +1,146 @@
1
+ # Site owner settings. Replace the example URL before publishing.
2
+ site:
3
+ title: EdgePress
4
+ description: A static website builder for Cloudflare Workers with editable pages, Markdown posts, themes, and plugins.
5
+ url: https://example.com
6
+ language: en
7
+ head:
8
+ titleSuffix: ""
9
+ titleSeparator: " · "
10
+ header:
11
+ showBrand: true
12
+ brandLabel: ""
13
+ components:
14
+ header: true
15
+ primaryNavigation: true
16
+ languageNavigation: true
17
+ footer: true
18
+ footerNavigation: true
19
+ navigation:
20
+ - key: home
21
+ url: "@home"
22
+ labels:
23
+ en: Home
24
+ zh-CN: 首页
25
+ - key: guides
26
+ url: /project-introduction/
27
+ labels:
28
+ en: Guides
29
+ zh-CN: 项目指南
30
+ - key: quick-start
31
+ url: /quick-start/
32
+ labels:
33
+ en: Quick start
34
+ zh-CN: 快速入门
35
+ - key: search
36
+ url: "@search"
37
+ labels:
38
+ en: Search
39
+ zh-CN: 搜索
40
+ footerNavigation:
41
+ - key: privacy
42
+ url: /privacy-policy/
43
+ labels:
44
+ en: Privacy policy
45
+ zh-CN: 隐私政策
46
+ - key: feed
47
+ url: "@feed"
48
+ labels:
49
+ en: Atom feed
50
+ zh-CN: Atom 订阅
51
+ footer: ""
52
+ seo:
53
+ author: EdgePress contributors
54
+ keywords:
55
+ - Markdown website builder
56
+ - Cloudflare Workers
57
+ - static site generator
58
+ image: ""
59
+ robots: index,follow
60
+ # GEO here means agent SEO: make authoritative project information easy to discover and interpret.
61
+ agentSeo:
62
+ enabled: true
63
+ summary: A static website builder for Cloudflare Workers, with row-based editable pages, Markdown posts, themes, plugins, and consent-gated integrations.
64
+ topics:
65
+ - Markdown website builder
66
+ - Cloudflare Workers
67
+ - composable page blocks
68
+ - plugin development
69
+ llmsTxt: true
70
+ agentCrawlers:
71
+ - GPTBot
72
+ - ClaudeBot
73
+ - PerplexityBot
74
+ privacy:
75
+ controller:
76
+ name: ""
77
+ contact: ""
78
+ policyUrl: /privacy-policy/
79
+ plugins:
80
+ consent:
81
+ enabled: true
82
+ version: "1"
83
+ expiresDays: 180
84
+ tracking:
85
+ enabled: true
86
+ services: []
87
+ # Example:
88
+ # - id: tag-manager
89
+ # provider: google-tag-manager
90
+ # purpose: Load consented campaign tags.
91
+ # retention: Set and disclose the applicable retention period.
92
+ # containerId: GTM-ABCD123
93
+ # - id: social-pixel
94
+ # provider: meta-pixel
95
+ # purpose: Measure consented campaign traffic.
96
+ # retention: Set and disclose the provider's retention period.
97
+ # pixelId: "123456789012345"
98
+ statistics:
99
+ enabled: true
100
+ services: []
101
+ # Examples use public provider IDs only.
102
+ # - id: primary-analytics
103
+ # provider: google-analytics
104
+ # purpose: Measure consented site visits.
105
+ # retention: Set and disclose the provider's retention period.
106
+ # measurementId: G-ABC12345
107
+ # - id: edge-analytics
108
+ # provider: cloudflare-web-analytics
109
+ # purpose: Measure consented site visits.
110
+ # retention: Set and disclose the applicable retention period.
111
+ # token: 01234567-89ab-cdef-0123-456789abcdef
112
+ # - id: baidu-analytics
113
+ # provider: baidu-tongji
114
+ # purpose: Measure consented site visits.
115
+ # retention: Set and disclose the provider's retention period.
116
+ # siteId: abcdef0123456789abcdef01
117
+ advertising:
118
+ enabled: true
119
+ services: []
120
+ # Example:
121
+ # - id: display-ads
122
+ # provider: google-adsense
123
+ # purpose: Display consented advertising.
124
+ # retention: Set and disclose the provider's retention period.
125
+ # clientId: ca-pub-1234567890123456
126
+ captcha:
127
+ enabled: true
128
+ services: []
129
+ # Choose a provider for each CAPTCHA block. Never add its secret key here.
130
+ # - id: contact-form-check
131
+ # provider: cloudflare-turnstile
132
+ # purpose: Reduce automated contact form submissions.
133
+ # retention: Configure and disclose the provider's retention period.
134
+ # siteKey: 0x4AAAAAAABBBBBBBBCCCCCCDDDD
135
+ # - id: signup-form-check
136
+ # provider: google-recaptcha
137
+ # purpose: Reduce automated signup submissions.
138
+ # retention: Configure and disclose the provider's retention period.
139
+ # siteKey: 6LcAbCdEfGhIjKlMnOpQrStUvWxYz0123456789a
140
+ # - id: support-form-check
141
+ # provider: hcaptcha
142
+ # purpose: Reduce automated support requests.
143
+ # retention: Configure and disclose the provider's retention period.
144
+ # siteKey: 0123456789abcdefghijklmnopqrstuvwx
145
+ # Add browser services under these groups after filling the real site operator details above.
146
+ # Every configured service waits for the visitor's explicit consent before its vendor code loads.
@@ -0,0 +1,84 @@
1
+ ---
2
+ title: EdgePress website builder
3
+ lang: en
4
+ slug: home
5
+ homepage: true
6
+ description: Build fast, secure websites on Cloudflare Workers with Markdown posts and editable page elements.
7
+ keywords:
8
+ - website builder
9
+ - Cloudflare Workers
10
+ - page elements
11
+ - website plugins
12
+ blocks:
13
+ - columns: 1
14
+ cells:
15
+ -
16
+ - type: hero
17
+ eyebrow: A project built for the edge
18
+ title: Build a fast website from clear, editable source files.
19
+ text: EdgePress turns Markdown posts, page layouts, themes, and consent-aware integrations into a static site served by Cloudflare Workers.
20
+ cta:
21
+ label: Start with the quick guide
22
+ url: /quick-start/
23
+ highlights:
24
+ - Editable pages in localized Markdown front matter
25
+ - Articles written in Markdown
26
+ - Shared layouts and theme-defined palettes
27
+ - columns: 1
28
+ cells:
29
+ -
30
+ - type: feature-grid
31
+ title: A clear place for each part of a site
32
+ items:
33
+ - title: Pages use editable elements
34
+ text: Set the number of columns first, then choose elements and edit their content in each page file.
35
+ url: /theme-development/
36
+ - title: Posts use Markdown
37
+ text: Write long-form articles in Markdown and let the built-in renderer sanitize and format them.
38
+ url: /project-introduction/
39
+ - title: Themes own the design
40
+ text: Build layouts with HTML partials and keep each theme's color palette in its stylesheet.
41
+ url: /theme-development/
42
+ - title: Integrations wait for consent
43
+ text: Add tracking, statistics, advertising, or CAPTCHA services with provider details in configuration.
44
+ url: /plugin-development/
45
+ - columns: 2
46
+ cells:
47
+ -
48
+ - type: section
49
+ title: Learn the project
50
+ tone: soft
51
+ blocks:
52
+ - type: text
53
+ paragraphs:
54
+ - Start with the project introduction and quick start. The guides cover the feature lifecycle, supported runtimes, and the recommended publishing workflow.
55
+ - type: link-list
56
+ title: Project guides
57
+ items:
58
+ - label: Project introduction
59
+ url: /project-introduction/
60
+ - label: Quick start
61
+ url: /quick-start/
62
+ -
63
+ - type: section
64
+ title: Extend the project
65
+ tone: soft
66
+ blocks:
67
+ - type: text
68
+ paragraphs:
69
+ - Use theme partials for shared head metadata, navigation, footer, and error-page layout. Page-specific rows and element content stay in localized page files.
70
+ - Build plugins run in Node. Browser services wait for explicit consent before requesting vendor code.
71
+ - type: link-list
72
+ title: Development guides
73
+ items:
74
+ - label: Theme development
75
+ url: /theme-development/
76
+ - label: Plugin development
77
+ url: /plugin-development/
78
+ - columns: 1
79
+ cells:
80
+ -
81
+ - type: latest-posts
82
+ title: Latest project updates
83
+ count: 3
84
+ ---
@@ -0,0 +1,84 @@
1
+ ---
2
+ title: EdgePress 网站构建器
3
+ lang: zh-CN
4
+ slug: home
5
+ homepage: true
6
+ description: 使用 Markdown 文章和可编辑页面元素,在 Cloudflare Workers 上构建快速、安全的网站。
7
+ keywords:
8
+ - 网站构建器
9
+ - Cloudflare Workers
10
+ - 页面元素
11
+ - 网站插件
12
+ blocks:
13
+ - columns: 1
14
+ cells:
15
+ -
16
+ - type: hero
17
+ eyebrow: 为边缘网络构建
18
+ title: 用清晰、可编辑的源文件构建快速网站。
19
+ text: EdgePress 将 Markdown 文章、页面布局、主题和遵循同意状态的集成构建为由 Cloudflare Workers 提供服务的静态网站。
20
+ cta:
21
+ label: 从快速入门开始
22
+ url: /quick-start/
23
+ highlights:
24
+ - 在本地化 Markdown 前置数据中编辑页面
25
+ - 使用 Markdown 撰写文章
26
+ - 复用布局,配色由主题定义
27
+ - columns: 1
28
+ cells:
29
+ -
30
+ - type: feature-grid
31
+ title: 网站各部分各有清晰位置
32
+ items:
33
+ - title: 页面使用可编辑元素
34
+ text: 先设置栏数,再选择元素类型,并在各页面文件中编辑对应内容。
35
+ url: /theme-development/
36
+ - title: 文章使用 Markdown
37
+ text: 使用 Markdown 撰写长文,由内置渲染器进行清理和排版。
38
+ url: /project-introduction/
39
+ - title: 主题负责视觉设计
40
+ text: 使用 HTML 局部模板构建布局,并将各主题的配色保留在样式表中。
41
+ url: /theme-development/
42
+ - title: 集成遵循用户同意
43
+ text: 配置跟踪、统计、广告或人机验证服务及其供应商信息。
44
+ url: /plugin-development/
45
+ - columns: 2
46
+ cells:
47
+ -
48
+ - type: section
49
+ title: 了解项目
50
+ tone: soft
51
+ blocks:
52
+ - type: text
53
+ paragraphs:
54
+ - 从项目介绍和快速入门开始。指南涵盖功能生命周期、支持的运行环境和建议的发布流程。
55
+ - type: link-list
56
+ title: 项目指南
57
+ items:
58
+ - label: 项目介绍
59
+ url: /project-introduction/
60
+ - label: 快速入门
61
+ url: /quick-start/
62
+ -
63
+ - type: section
64
+ title: 扩展项目
65
+ tone: soft
66
+ blocks:
67
+ - type: text
68
+ paragraphs:
69
+ - 使用主题局部模板复用 head 元数据、导航、页脚和错误页布局。每个页面的行布局和元素内容保存在本地化页面文件中。
70
+ - 构建插件在 Node 中运行。浏览器服务会等到访客明确同意后才请求供应商代码。
71
+ - type: link-list
72
+ title: 开发指南
73
+ items:
74
+ - label: 主题开发
75
+ url: /theme-development/
76
+ - label: 插件开发
77
+ url: /plugin-development/
78
+ - columns: 1
79
+ cells:
80
+ -
81
+ - type: latest-posts
82
+ title: 最新项目动态
83
+ count: 3
84
+ ---
@@ -0,0 +1,108 @@
1
+ ---
2
+ title: Plugin development
3
+ lang: en
4
+ slug: plugin-development
5
+ description: Extend EdgePress with trusted build plugins, consent-gated browser integrations, and private backend forwarding.
6
+ blocks:
7
+ - columns: 1
8
+ cells:
9
+ -
10
+ - type: hero
11
+ eyebrow: Extension guide
12
+ title: Connect trusted build code, browser providers, and backend services.
13
+ text: Build-time plugins run in Node. Browser integrations wait for visitor consent. Runtime backend requests stay behind the Worker.
14
+ - columns: 2
15
+ cells:
16
+ -
17
+ - type: section
18
+ title: Build-time plugins
19
+ tone: soft
20
+ blocks:
21
+ - type: text
22
+ paragraphs:
23
+ - Local JavaScript modules in plugins/ may transform source documents, register hooks or renderers, and generate routes. They execute with the build process permissions, so only load code reviewed by the project owner.
24
+ - The starter consent plugin adds a privacy panel after the shared page layout. Build plugins are trusted code and are not deployed as browser scripts.
25
+ - type: code
26
+ title: Register a route generator
27
+ language: js
28
+ code: |
29
+ export default function projectMeta(api) {
30
+ api.registerGenerator('project-meta', ({ site }) => ({
31
+ path: 'project-meta.json',
32
+ body: JSON.stringify({
33
+ title: site.config.site.title,
34
+ posts: site.posts.length
35
+ }),
36
+ contentType: 'application/json; charset=utf-8'
37
+ }));
38
+ }
39
+ -
40
+ - type: section
41
+ title: Tracking, statistics, advertising, and CAPTCHA
42
+ tone: soft
43
+ blocks:
44
+ - type: text
45
+ paragraphs:
46
+ - Add browser providers in config.yml under plugins.tracking, plugins.statistics, plugins.advertising, or plugins.captcha. Each entry needs a unique ID, purpose, retention description, and a public provider identifier.
47
+ - Available providers include Google Tag Manager and Meta Pixel; Cloudflare Web Analytics, Google Analytics, and Baidu Tongji; Google AdSense; and Cloudflare Turnstile, Google reCAPTCHA, and hCaptcha.
48
+ - Provider code is imported only after the visitor accepts that integration. Keep CAPTCHA secret keys out of config.yml and client code. The server must submit each CAPTCHA response to the provider verification API before accepting a form.
49
+ - type: notice
50
+ title: Operator details
51
+ text: Fill privacy.controller.name, privacy.controller.contact, and privacy.policyUrl before configuring any browser provider. The build rejects provider services when the controller name or contact is blank.
52
+ tone: warning
53
+ - columns: 1
54
+ cells:
55
+ -
56
+ - type: section
57
+ title: Forward requests to a URL and token backend
58
+ blocks:
59
+ - type: text
60
+ paragraphs:
61
+ - The Worker exposes /api/v1/* for GET, POST, PUT, PATCH, and DELETE. With BACKEND_URL and BACKEND_TOKEN configured, it appends the request path and query to the backend URL, sends a Bearer token, forwards a small allowlist of request headers, and marks responses no-store.
62
+ - BACKEND_URL must use HTTPS. Plain HTTP is accepted only for localhost development. Request bodies are limited to 1 MB. The backend still needs to authenticate the scoped token, validate user input, authorize every action, and enforce rate and size limits.
63
+ - Prefer a Cloudflare BACKEND Service Binding for private Worker-to-Worker calls. A browser must never receive BACKEND_TOKEN. This generic proxy does not create application accounts, forms, or data models by itself.
64
+ - type: steps
65
+ items:
66
+ - title: Set the backend base URL
67
+ text: Add vars.BACKEND_URL in wrangler.jsonc. Use an HTTPS base URL without credentials or a token in its URL.
68
+ - title: Store the secret
69
+ text: Wrangler prompts for the secret value. Use a narrowly scoped backend token and rotate it under the operator's process.
70
+ command: edgepress secret put BACKEND_TOKEN
71
+ - title: Configure and deploy
72
+ text: Confirm the backend accepts the forwarded path and Bearer token, then deploy the Worker.
73
+ command: edgepress deploy
74
+ - type: code
75
+ title: Local development
76
+ language: sh
77
+ code: |
78
+ # .dev.vars is local and must not be committed
79
+ BACKEND_URL=http://127.0.0.1:8788
80
+ BACKEND_TOKEN=replace-with-a-local-token
81
+ - type: text
82
+ text: The Worker returns 503 when no backend binding or URL and token are configured. It rejects unsupported methods and oversized request bodies.
83
+ - type: link-list
84
+ title: Provider validation reference
85
+ items:
86
+ - label: Cloudflare Turnstile Siteverify
87
+ url: https://developers.cloudflare.com/turnstile/get-started/server-side-validation/
88
+ - label: Consent guidelines from the EDPB
89
+ url: https://www.edpb.europa.eu/sites/default/files/files/file1/edpb_guidelines_202005_consent_en.pdf
90
+ - columns: 1
91
+ cells:
92
+ -
93
+ - type: section
94
+ title: Content security and maintenance
95
+ blocks:
96
+ - type: text
97
+ paragraphs:
98
+ - The built-in Markdown renderer sanitizes post output. Custom renderers, plugins, themes, and files in static/ are trusted project code; review changes before building or deploying. Do not put secrets in posts, themes, or public assets.
99
+ - edgepress iterate writes a report-only review plan under .edgepress/reports/. It does not edit source files, update dependencies, or deploy. edgepress security checks dependency advisories. Review the lockfile and generated page report before deployment, and keep a known-good deployment for rollback.
100
+ - type: code
101
+ title: Review project changes
102
+ language: sh
103
+ code: |
104
+ edgepress security
105
+ edgepress iterate
106
+ edgepress check
107
+ edgepress server
108
+ ---
@@ -0,0 +1,108 @@
1
+ ---
2
+ title: 插件开发
3
+ lang: zh-CN
4
+ slug: plugin-development
5
+ description: 使用可信构建插件、遵循同意设置的浏览器集成和私有后端转发扩展 EdgePress。
6
+ blocks:
7
+ - columns: 1
8
+ cells:
9
+ -
10
+ - type: hero
11
+ eyebrow: 扩展指南
12
+ title: 连接可信构建代码、浏览器供应商和后端服务。
13
+ text: 构建插件在 Node 中运行。浏览器集成需等待访客同意。运行时后端请求由 Worker 转发。
14
+ - columns: 2
15
+ cells:
16
+ -
17
+ - type: section
18
+ title: 构建插件
19
+ tone: soft
20
+ blocks:
21
+ - type: text
22
+ paragraphs:
23
+ - plugins/ 中的本地 JavaScript 模块可以转换源文档、注册钩子或渲染器,并生成路由。它们拥有构建进程的权限,因此只应加载项目负责人审查过的代码。
24
+ - 起始同意插件会在共享页面布局后添加隐私面板。构建插件属于可信代码,不会作为浏览器脚本发布。
25
+ - type: code
26
+ title: 注册路由生成器
27
+ language: js
28
+ code: |
29
+ export default function projectMeta(api) {
30
+ api.registerGenerator('project-meta', ({ site }) => ({
31
+ path: 'project-meta.json',
32
+ body: JSON.stringify({
33
+ title: site.config.site.title,
34
+ posts: site.posts.length
35
+ }),
36
+ contentType: 'application/json; charset=utf-8'
37
+ }));
38
+ }
39
+ -
40
+ - type: section
41
+ title: 跟踪、统计、广告和人机验证
42
+ tone: soft
43
+ blocks:
44
+ - type: text
45
+ paragraphs:
46
+ - 在 config.yml 的 plugins.tracking、plugins.statistics、plugins.advertising 或 plugins.captcha 下添加浏览器供应商。每项需要唯一 ID、用途、保留期限说明和公开供应商标识。
47
+ - 可用供应商包括 Google Tag Manager 和 Meta Pixel;Cloudflare Web Analytics、Google Analytics 和百度统计;Google AdSense;以及 Cloudflare Turnstile、Google reCAPTCHA 和 hCaptcha。
48
+ - 只有访客接受对应集成后才会导入供应商代码。不要把 CAPTCHA 密钥放入 config.yml 或客户端代码。服务器必须在接受表单前将每个 CAPTCHA 响应提交给供应商验证 API。
49
+ - type: notice
50
+ title: 运营者信息
51
+ text: 配置浏览器供应商前,请填写 privacy.controller.name、privacy.controller.contact 和 privacy.policyUrl。控制者名称或联系方式为空时,构建器会拒绝启用供应商服务。
52
+ tone: warning
53
+ - columns: 1
54
+ cells:
55
+ -
56
+ - type: section
57
+ title: 通过 URL 和令牌转发后端请求
58
+ blocks:
59
+ - type: text
60
+ paragraphs:
61
+ - Worker 为 GET、POST、PUT、PATCH 和 DELETE 提供 /api/v1/* 接口。配置 BACKEND_URL 和 BACKEND_TOKEN 后,Worker 会将请求路径及查询参数附加到后端 URL,发送 Bearer 令牌,转发有限的请求头,并为响应设置 no-store。
62
+ - BACKEND_URL 必须使用 HTTPS。只有 localhost 开发环境允许普通 HTTP。请求正文最大为 1 MB。后端仍需验证受限令牌、校验用户输入、授权每项操作,并执行自己的请求频率和大小限制。
63
+ - 私有 Worker 间调用优先使用 Cloudflare BACKEND Service Binding。浏览器绝不能获得 BACKEND_TOKEN。此通用代理本身不会创建应用账户、表单或数据模型。
64
+ - type: steps
65
+ items:
66
+ - title: 设置后端基础 URL
67
+ text: 在 wrangler.jsonc 中添加 vars.BACKEND_URL。基础 URL 应使用 HTTPS,且不能包含凭据或令牌。
68
+ - title: 保存密钥
69
+ text: Wrangler 会提示输入密钥值。请使用权限范围有限的后端令牌,并依照运营者流程定期轮换。
70
+ command: edgepress secret put BACKEND_TOKEN
71
+ - title: 配置并部署
72
+ text: 确认后端接受转发路径和 Bearer 令牌,再部署 Worker。
73
+ command: edgepress deploy
74
+ - type: code
75
+ title: 本地开发
76
+ language: sh
77
+ code: |
78
+ # .dev.vars 仅供本地使用,不要提交到版本库
79
+ BACKEND_URL=http://127.0.0.1:8788
80
+ BACKEND_TOKEN=replace-with-a-local-token
81
+ - type: text
82
+ text: 未配置后端绑定,或 URL 和令牌时,Worker 会返回 503。它会拒绝不支持的方法和过大的请求正文。
83
+ - type: link-list
84
+ title: 供应商验证参考
85
+ items:
86
+ - label: Cloudflare Turnstile Siteverify
87
+ url: https://developers.cloudflare.com/turnstile/get-started/server-side-validation/
88
+ - label: EDPB 同意指南
89
+ url: https://www.edpb.europa.eu/sites/default/files/files/file1/edpb_guidelines_202005_consent_en.pdf
90
+ - columns: 1
91
+ cells:
92
+ -
93
+ - type: section
94
+ title: 内容安全与维护
95
+ blocks:
96
+ - type: text
97
+ paragraphs:
98
+ - 内置 Markdown 渲染器会清理文章输出。自定义渲染器、插件、主题和 static/ 中的文件都属于可信项目代码;构建或部署前应审查变更。不要将密钥放在文章、主题或公开资源中。
99
+ - edgepress iterate 会在 .edgepress/reports/ 下生成只读维护计划,不会修改源文件、更新依赖或部署。edgepress security 检查依赖安全公告。部署前请审查锁文件和页面报告,并保留可用于回滚的已知稳定部署。
100
+ - type: code
101
+ title: 审查项目变更
102
+ language: sh
103
+ code: |
104
+ edgepress security
105
+ edgepress iterate
106
+ edgepress check
107
+ edgepress server
108
+ ---
@@ -0,0 +1,73 @@
1
+ ---
2
+ title: Privacy policy
3
+ lang: en
4
+ slug: privacy-policy
5
+ description: Current data handling, consent controls, configured integrations, and publication details for this EdgePress site.
6
+ blocks:
7
+ - columns: 1
8
+ cells:
9
+ -
10
+ - type: section
11
+ title: Site operator
12
+ tone: soft
13
+ blocks:
14
+ - type: privacy-controller
15
+ nameLabel: Controller
16
+ contactLabel: Privacy contact
17
+ missingTitle: Publication setup required
18
+ missingText: The current config.yml has no real operator name or privacy contact, and site.url still uses example.com. Replace these values before publishing this policy.
19
+ - columns: 2
20
+ cells:
21
+ -
22
+ - type: section
23
+ title: What this starter site does
24
+ blocks:
25
+ - type: text
26
+ paragraphs:
27
+ - This source build contains public pages, posts, search data, a sitemap, and an Atom feed. It does not include a visitor account system, comments, or a contact form.
28
+ - The Worker exposes an optional /api/v1/ proxy for a backend. It forwards requests only when the deployer configures a Service Binding or BACKEND_URL together with the BACKEND_TOKEN secret. This starter site does not submit page content to that API.
29
+ - Hosting and delivery providers may process connection and request data to operate the site. The operator must identify the providers and describe their applicable terms and retention before publication.
30
+ -
31
+ - type: section
32
+ title: Optional browser services
33
+ blocks:
34
+ - type: text
35
+ text: The current configuration has no tracking, statistics, advertising, or human-verification providers in its service lists. If the operator adds a service, the list below is generated from its configured provider, purpose, and retention description.
36
+ - type: privacy-services
37
+ emptyText: No optional third-party browser services are configured in this source build.
38
+ - columns: 1
39
+ cells:
40
+ -
41
+ - type: section
42
+ title: Consent preferences
43
+ tone: accent
44
+ blocks:
45
+ - type: text
46
+ paragraphs:
47
+ - Browser integrations are loaded only after the visitor accepts a configured service. The consent interface stores a first-party preference in local browser storage when a choice can be saved. It is not a server-side audit log.
48
+ - Visitors can reopen Privacy settings to change a choice. If they withdraw a previously active service, the page reloads so that the integration can stop running.
49
+ - type: privacy-consent
50
+ storageLabel: Browser storage key
51
+ expiryLabel: Preference expiry
52
+ versionLabel: Consent configuration version
53
+ expiryText: "{days} days after saving"
54
+ - columns: 1
55
+ cells:
56
+ -
57
+ - type: section
58
+ title: Provider and legal details
59
+ blocks:
60
+ - type: text
61
+ paragraphs:
62
+ - Before enabling a provider, the operator must document the information it receives, purposes, recipients, applicable retention, and any cross-border transfers. Public site identifiers may be configured in the browser; CAPTCHA secret keys must stay on a trusted server, which must verify each response token.
63
+ - This starter configuration cannot determine the operator's jurisdiction, legal bases, retention obligations, or the rights that apply to a particular deployment. Complete this policy for the actual site and seek qualified advice where needed.
64
+ - type: link-list
65
+ title: Primary legal references
66
+ items:
67
+ - label: GDPR text on EUR-Lex
68
+ url: https://eur-lex.europa.eu/eli/reg/2016/679
69
+ - label: UK ICO information notice guidance
70
+ url: https://ico.org.uk/for-organisations/advice-for-small-organisations/getting-started-with-gdpr/data-protection-self-assessment/what-information-you-must-supply-under-the-gdpr/
71
+ - label: China Personal Information Protection Law
72
+ url: https://www.miit.gov.cn/jgsj/zfs/fl/art/2022/art_515a4b20c12f430eab54bb4f56d89f56.html
73
+ ---