Skip to content

Commit 62f4002

Browse files
Add documentation website with GitHub Pages deployment (#145)
# TLDR; Adds an Eleventy-based documentation website with automated GitHub Pages deployment on every push. # Details - **GitHub Actions workflow** (`deploy-website.yml`) - Builds and deploys the website to GitHub Pages on all pushes - **Eleventy static site** - Documentation, blog, examples, and API reference - **Chinese translations** - Full i18n support for zh locale - **Playwright tests** - Homepage, docs, blog, API, SEO, visual QA, and syntax highlighting tests - **API docs generator** - Script to auto-generate API documentation from source # How Do The Tests Prove The Changes Work? The Playwright tests validate: - All pages render correctly (homepage, docs, blog, examples) - Navigation and links work - Chinese translations load properly - Syntax highlighting applies to code blocks - SEO meta tags are present - Visual elements display as expected
1 parent ceefff8 commit 62f4002

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+14895
-3
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"rollForward": false
1818
},
1919
"dotnet-stryker": {
20-
"version": "4.8.1",
20+
"version": "4.11.0",
2121
"commands": [
2222
"dotnet-stryker"
2323
],

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# TLDR;
22

3-
# Summary
4-
53
# Details
4+
5+
# How Do The Tests Prove The Changes Work?
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy Website to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: "20"
28+
cache: "npm"
29+
cache-dependency-path: Website/package-lock.json
30+
31+
- name: Install dependencies
32+
working-directory: Website
33+
run: npm ci
34+
35+
- name: Build website
36+
working-directory: Website
37+
run: npm run build
38+
39+
- name: Setup Pages
40+
uses: actions/configure-pages@v5
41+
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: Website/_site
46+
47+
deploy:
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
runs-on: ubuntu-latest
52+
needs: build
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ coverage.cobertura.xml
1515
final-check/
1616
test-output-final
1717
nupkgs/
18+
19+
# Website
20+
Website/node_modules/
21+
Website/_site/
22+
Website/package-lock.json
23+
Website/playwright-report/
24+
Website/test-results/
25+
Website/src/api/

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ RestClient.Net is a functional HTTP client library using Result types for error
5959

6060
5. **ProgressReportingHttpContent** - Custom `HttpContent` supporting upload/download progress callbacks.
6161

62+
### PRs
63+
64+
- Compare the current branch to main branch. Base title and comments solely on diff. IGNORE commit messages
65+
- Use the template at .github/pull_request_template.md
66+
- Keep the documentation tight.
67+
6268
### Code Generation
6369

6470
**RestClient.Net.OpenApiGenerator** - Generates C# extension methods from OpenAPI 3.x specs:

Website/eleventy.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import techdoc from "eleventy-plugin-techdoc";
2+
3+
export default function(eleventyConfig) {
4+
eleventyConfig.addPlugin(techdoc, {
5+
site: {
6+
name: "RestClient.Net",
7+
url: "https://restclient.net",
8+
description: "The safest way to make REST calls in C#. Built with functional programming, type safety, and modern .NET patterns.",
9+
},
10+
features: {
11+
blog: true,
12+
docs: true,
13+
darkMode: true,
14+
i18n: true,
15+
},
16+
i18n: {
17+
defaultLanguage: 'en',
18+
languages: ['en', 'zh'],
19+
},
20+
});
21+
22+
eleventyConfig.addPassthroughCopy("src/assets");
23+
24+
return {
25+
dir: { input: "src", output: "_site" },
26+
markdownTemplateEngine: "njk",
27+
};
28+
}

Website/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "restclient-net-website",
3+
"version": "1.0.0",
4+
"description": "RestClient.Net documentation website",
5+
"type": "module",
6+
"scripts": {
7+
"generate-api": "node scripts/generate-api-docs.js",
8+
"dev": "lsof -ti:8080 | xargs kill -9 2>/dev/null; npx @11ty/eleventy --serve --port=8080",
9+
"build": "npm run generate-api && npx @11ty/eleventy",
10+
"test": "playwright test"
11+
},
12+
"dependencies": {
13+
"eleventy-plugin-techdoc": "^0.1.0"
14+
},
15+
"devDependencies": {
16+
"@11ty/eleventy": "^3.1.2",
17+
"@playwright/test": "^1.40.0"
18+
}
19+
}

Website/playwright.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { defineConfig } from '@playwright/test';
2+
3+
export default defineConfig({
4+
testDir: './tests',
5+
fullyParallel: true,
6+
forbidOnly: !!process.env.CI,
7+
retries: process.env.CI ? 2 : 0,
8+
workers: process.env.CI ? 1 : undefined,
9+
reporter: 'list',
10+
use: {
11+
baseURL: 'http://localhost:8080',
12+
trace: 'on-first-retry',
13+
},
14+
webServer: {
15+
command: 'npx @11ty/eleventy --serve --port=8080',
16+
url: 'http://localhost:8080',
17+
reuseExistingServer: !process.env.CI,
18+
timeout: 120000,
19+
},
20+
});

0 commit comments

Comments
 (0)