Skip to content

Commit af9e95d

Browse files
committed
docs: add VitePress docs site and GitHub Pages deploy
1 parent b9cbd06 commit af9e95d

6 files changed

Lines changed: 2653 additions & 0 deletions

File tree

.github/workflows/docs.yml

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

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
.vitepress/cache
3+
.vitepress/dist

docs/.vitepress/config.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { defineConfig } from 'vitepress';
2+
3+
export default defineConfig({
4+
title: 'SourceGen',
5+
description: 'A collection of C# Source Generators for compile-time code generation',
6+
base: '/SourceGen/',
7+
themeConfig: {
8+
nav: [
9+
{ text: 'Guide', link: '/Ioc/01_Overview' },
10+
{ text: 'GitHub', link: 'https://github.com/AndyElessar/SourceGen' }
11+
],
12+
sidebar: [
13+
{
14+
text: 'Guide',
15+
items: [
16+
{ text: 'Overview', link: '/Ioc/01_Overview' },
17+
{ text: 'Basic Usage', link: '/Ioc/02_Basic' },
18+
{ text: 'Default Settings', link: '/Ioc/03_Defaults' },
19+
{
20+
text: 'Field, Property & Method Injection',
21+
link: '/Ioc/04_Field_Property_Method_Injection'
22+
},
23+
{ text: 'Keyed Services', link: '/Ioc/05_Keyed' },
24+
{ text: 'Decorators', link: '/Ioc/06_Decorator' },
25+
{ text: 'Tags', link: '/Ioc/07_Tags' },
26+
{ text: 'Factory & Instance', link: '/Ioc/08_Factory_Instance' },
27+
{ text: 'Open Generic Types', link: '/Ioc/09_OpenGeneric' },
28+
{ text: 'Wrapper Types', link: '/Ioc/10_Wrapper' },
29+
{ text: 'CLI Tool', link: '/Ioc/11_CliTool' },
30+
{ text: 'Container Generation', link: '/Ioc/12_Container' },
31+
{ text: 'MSBuild Configuration', link: '/Ioc/13_MSBuild_Configuration' },
32+
{ text: 'Best Practices', link: '/Ioc/14_Best_Practices' }
33+
]
34+
}
35+
],
36+
socialLinks: [
37+
{ icon: 'github', link: 'https://github.com/AndyElessar/SourceGen' }
38+
],
39+
search: {
40+
provider: 'local'
41+
},
42+
footer: {
43+
message: 'Released under the MIT License.',
44+
copyright: 'Copyright © 2026 AndyElessar'
45+
}
46+
}
47+
});

docs/index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
layout: home
3+
hero:
4+
name: SourceGen
5+
text: C# Source Generators
6+
tagline: Compile-time code generation for .NET — Zero reflection, full AOT support
7+
actions:
8+
- theme: brand
9+
text: Get Started
10+
link: /Ioc/01_Overview
11+
- theme: alt
12+
text: View on GitHub
13+
link: https://github.com/AndyElessar/SourceGen
14+
features:
15+
- icon:
16+
title: Compile-Time Generation
17+
details: All code is generated at compile time with zero runtime reflection overhead
18+
- icon: 🎯
19+
title: Native AOT Compatible
20+
details: Fully compatible with .NET Native AOT publishing — no trimming warnings
21+
- icon: 🔧
22+
title: IoC / Dependency Injection
23+
details: Source-generated service registration replacing Microsoft.Extensions.DependencyInjection patterns
24+
---

0 commit comments

Comments
 (0)