Skip to content

Commit 0dd536f

Browse files
Preparing multilingual docs
1 parent 388f104 commit 0dd536f

File tree

21 files changed

+694
-109
lines changed

21 files changed

+694
-109
lines changed

.github/workflows/deploy.yml

Lines changed: 0 additions & 109 deletions
This file was deleted.

.github/workflows/docs-ci.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: docs-ci
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
push:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
test-blocks:
15+
name: Test doc code blocks
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout docs repo
20+
uses: actions/checkout@v4
21+
22+
- name: Checkout multilingual source
23+
uses: actions/checkout@v4
24+
with:
25+
repository: johnsamuelwrites/multilingual
26+
path: multilingual-src
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.12"
32+
cache: pip
33+
cache-dependency-path: multilingual-src/pyproject.toml
34+
35+
- name: Install multilingual
36+
working-directory: multilingual-src
37+
run: pip install -e ".[dev]"
38+
39+
- name: Install pytest
40+
run: pip install pytest
41+
42+
- name: Run code-block tests
43+
run: pytest _tests/ -v --tb=short
44+
45+
validate-multilingual-docs:
46+
name: Validate multilingual metadata
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout docs repo
50+
uses: actions/checkout@v4
51+
52+
- name: Set up Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: "3.12"
56+
57+
- name: Install validator deps
58+
run: pip install pyyaml
59+
60+
- name: Run multilingual docs validation
61+
run: python scripts/validate_multilingual_docs.py --strict-freshness
62+
63+
build-preview:
64+
name: Build docs preview
65+
runs-on: ubuntu-latest
66+
needs:
67+
- test-blocks
68+
- validate-multilingual-docs
69+
70+
steps:
71+
- name: Checkout docs repo
72+
uses: actions/checkout@v4
73+
74+
- name: Set up Python
75+
uses: actions/setup-python@v5
76+
with:
77+
python-version: "3.12"
78+
79+
- name: Configure GitHub Pages
80+
id: pages
81+
uses: actions/configure-pages@v5
82+
83+
- name: Set up Ruby
84+
uses: ruby/setup-ruby@v1
85+
with:
86+
ruby-version: "3.3"
87+
bundler-cache: true
88+
89+
- name: Build Jekyll site
90+
env:
91+
JEKYLL_ENV: production
92+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
93+
94+
- name: Sanity-check Pages artifact
95+
run: python scripts/check_pages_artifact.py --site-dir _site --base-path "${{ steps.pages.outputs.base_path }}"
96+
97+
- name: Upload preview artifact
98+
uses: actions/upload-artifact@v4
99+
with:
100+
name: docs-preview-site
101+
path: _site/
102+
if-no-files-found: error
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: docs-deploy-pages
2+
3+
on:
4+
workflow_run:
5+
workflows: ["docs-ci"]
6+
types: [completed]
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages-main
15+
cancel-in-progress: true
16+
17+
jobs:
18+
deploy:
19+
name: Deploy docs to GitHub Pages
20+
if: >
21+
github.event.workflow_run.conclusion == 'success' &&
22+
github.event.workflow_run.head_branch == 'main'
23+
runs-on: ubuntu-latest
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deploy.outputs.page_url }}
27+
28+
steps:
29+
- name: Checkout docs repo at tested commit
30+
uses: actions/checkout@v4
31+
with:
32+
ref: ${{ github.event.workflow_run.head_sha }}
33+
34+
- name: Set up Python
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: "3.12"
38+
39+
- name: Configure GitHub Pages
40+
id: pages
41+
uses: actions/configure-pages@v5
42+
43+
- name: Set up Ruby
44+
uses: ruby/setup-ruby@v1
45+
with:
46+
ruby-version: "3.3"
47+
bundler-cache: true
48+
49+
- name: Build Jekyll site
50+
env:
51+
JEKYLL_ENV: production
52+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
53+
54+
- name: Sanity-check Pages artifact
55+
run: python scripts/check_pages_artifact.py --site-dir _site --base-path "${{ steps.pages.outputs.base_path }}"
56+
57+
- name: Upload Pages artifact
58+
uses: actions/upload-pages-artifact@v3
59+
with:
60+
path: _site/
61+
62+
- name: Deploy to GitHub Pages
63+
id: deploy
64+
uses: actions/deploy-pages@v4

404.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
layout: default
3+
permalink: /404.html
4+
title: "Page Not Found"
5+
---
6+
7+
<div class="page-layout">
8+
<main class="main-content" id="main-content" role="main">
9+
<article class="content-article">
10+
<header class="content-header">
11+
<h1 class="content-title">Page not found</h1>
12+
<p class="content-description">The page you requested does not exist.</p>
13+
</header>
14+
<div class="content-body">
15+
<p><a href="{{ '/' | relative_url }}">Return to the documentation home page</a>.</p>
16+
</div>
17+
</article>
18+
</main>
19+
</div>

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ bundle exec jekyll build
7070
3. Run `bundle exec jekyll serve` and verify pages render correctly.
7171
4. Submit a pull request.
7272

73+
For multilingual EN/FR documentation operations (metadata model, localized routing, snippets, CI checks, and Pages-safe deploy), see [contributing/multilingual-docs.md](contributing/multilingual-docs.md).
74+
7375
For language/runtime contribution workflow, see `contributing/` and the [main repository](https://github.com/johnsamuelwrites/multilingual).
7476

7577
## License

_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ nav:
130130
children:
131131
- title: "Development Guide"
132132
url: "/contributing/"
133+
- title: "Multilingual Docs Ops"
134+
url: "/contributing/multilingual-docs/"
133135

134136
# Collections
135137
collections:
@@ -160,3 +162,5 @@ exclude:
160162
- vendor/ruby/
161163
- ".sass-cache"
162164
- ".jekyll-cache"
165+
- "docs/"
166+
- "scripts/"

0 commit comments

Comments
 (0)