Skip to content

Commit eedf4f5

Browse files
authored
Add bilingual Pages with a distinct etcd theme (#3)
* feat(docs): add statically rendered Chinese and English guides * style(docs): give etcd its own brand palette and official logo * feat(docs): add accessible command tabs and bilingual navigation * ci(pages): deploy bilingual documentation from trusted main * docs: link the website and document local building * docs(etcd): clarify failpoint source and build requirements
1 parent cfdef81 commit eedf4f5

13 files changed

Lines changed: 626 additions & 1 deletion

File tree

‎.github/workflows/pages.yaml‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ['website/**', '.github/workflows/pages.yaml', 'metadata.lua', 'README.md']
7+
pull_request:
8+
paths: ['website/**', '.github/workflows/pages.yaml', 'metadata.lua', 'README.md']
9+
workflow_dispatch:
10+
workflow_run:
11+
workflows: ['Plugin']
12+
types: [completed]
13+
# Tag releases report the tag as head_branch, so do not filter to main.
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: pages-${{ github.event_name == 'pull_request' && github.event.pull_request.number || 'deploy' }}
20+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21+
22+
jobs:
23+
build:
24+
if: github.event_name != 'workflow_run' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request')
25+
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
28+
pages: read
29+
steps:
30+
- uses: actions/checkout@v7
31+
with:
32+
# Releases create a version commit after their original triggering SHA.
33+
ref: ${{ github.event_name == 'workflow_run' && 'main' || github.sha }}
34+
- name: Read Pages configuration
35+
id: pages
36+
uses: actions/configure-pages@v6
37+
- name: Build both language routes
38+
env:
39+
SITE_URL: ${{ steps.pages.outputs.base_url }}
40+
run: python3 website/build.py --base-url "$SITE_URL"
41+
- uses: actions/upload-pages-artifact@v5
42+
with:
43+
path: _site
44+
45+
deploy:
46+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
47+
needs: build
48+
runs-on: ubuntu-latest
49+
permissions:
50+
pages: write
51+
id-token: write
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v5

‎.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
.idea
2-
.tool-versions
2+
.tool-versions
3+
_site/
4+
__pycache__/

‎README.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,9 @@ the tag. If publication fails, re-run the original failed job to resume it.
9797
The workflow follows the shared `@v1` release-tool version. Updating the tool does
9898
not release this plugin. See the [shared workflow documentation](https://github.com/version-fox/plugin-manifest-action)
9999
for the package contract and first-rollout requirements.
100+
101+
## Documentation website
102+
103+
[中文](https://version-fox.github.io/vfox-etcd/) · [English](https://version-fox.github.io/vfox-etcd/en/)
104+
105+
The bilingual site is maintained under `website/`. See [website/README.md](website/README.md) for local build and deployment instructions.

‎website/README.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Documentation site
2+
3+
Chinese: https://version-fox.github.io/vfox-etcd/
4+
English: https://version-fox.github.io/vfox-etcd/en/
5+
6+
Build with Python's standard library:
7+
8+
```sh
9+
python3 website/build.py --output /tmp/vfox-etcd-site
10+
python3 -m http.server 8080 --directory /tmp/vfox-etcd-site
11+
```
12+
13+
Open http://localhost:8080/ or /en/. A shared template and matching Chinese/English message files render both routes. site.json holds shared commands and canonical configuration. The builder reads plugin version and minimum vfox runtime from metadata.lua and rejects missing or unused template messages. Use --base-url for another deployment URL.
14+
15+
Pages builds PRs, deploys main, and refreshes from trusted main after successful publication, including tag releases. Official logos are stored without modification; see assets/LOGO-SOURCE.txt. Reading the guides, switching languages and opening FAQ entries work without JavaScript. JavaScript adds accessible command tabs and copying.

‎website/assets/LOGO-SOURCE.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Official project logo, copied without modification.
2+
Source: https://raw.githubusercontent.com/cncf/artwork/main/projects/etcd/icon/color/etcd-icon-color.svg
3+
Used to identify the runtime managed by this plugin, not to imply endorsement.

‎website/assets/logo.svg‎

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)