Repository navigation
feat(website): publish the kit as a Starlight site on GitHub Pages #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e4f23ea
feat(website): add a Starlight site that renders the repository docs
DaniAkash c939910
feat(website): add a landing page and a five-minute quick start
DaniAkash df2d8b1
feat(website): render diagrams, validate links and add an unofficial …
DaniAkash 43396f3
feat(website): add an answer-first FAQ
DaniAkash e8b3704
feat(website): add sitemap lastmod, llms.txt and markdown page twins
DaniAkash 71c123e
feat(website): add social images and structured data
DaniAkash 3968636
ci(website): build on pull requests and deploy to GitHub Pages from main
DaniAkash 25a263b
docs: link the website and its quick start from the README
DaniAkash 7af4184
style(website): match the accent color to the logo and wrap the agent…
DaniAkash 56452d0
fix(website): show the quick start's verify output as errors
DaniAkash 5fe4d44
fix(website): meet WCAG AA contrast in file trees and clarify the age…
DaniAkash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| name: Pages | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - website/** | ||
| - docs/** | ||
| - AGENTS.md | ||
| - README.md | ||
| - Cargo.toml | ||
| - clippy.toml | ||
| - rustfmt.toml | ||
| - deny.toml | ||
| - rust-toolchain.toml | ||
| - .github/workflows/pages.yml | ||
| pull_request: | ||
| paths: | ||
| - website/** | ||
| - docs/** | ||
| - AGENTS.md | ||
| - README.md | ||
| - Cargo.toml | ||
| - clippy.toml | ||
| - rustfmt.toml | ||
| - deny.toml | ||
| - rust-toolchain.toml | ||
| - .github/workflows/pages.yml | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: pages-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build website | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v7 | ||
| with: | ||
| # Full history: page dates and sitemap <lastmod> come from git log. | ||
| fetch-depth: 0 | ||
| - uses: withastro/action@v6 | ||
| with: | ||
| path: website | ||
|
|
||
| deploy: | ||
| name: Deploy to GitHub Pages | ||
| if: github.event_name != 'pull_request' | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - id: deployment | ||
| uses: actions/deploy-pages@v5 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| dist/ | ||
| .astro/ | ||
| node_modules/ | ||
| src/content/docs/repo/ | ||
| public/files/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| import sitemap from '@astrojs/sitemap'; | ||
| import starlight from '@astrojs/starlight'; | ||
| import { defineConfig } from 'astro/config'; | ||
| import mermaid from 'astro-mermaid'; | ||
| import starlightLinksValidator from 'starlight-links-validator'; | ||
| import starlightLlmsTxt from 'starlight-llms-txt'; | ||
| import starlightPageActions from 'starlight-page-actions'; | ||
| import { lastModifiedBySlug, syncRepoContent } from './integrations/sync-repo-content'; | ||
| import { BASE, FILES_URL, GUIDE_URL, REPO_URL, SITE } from './site.config'; | ||
|
|
||
| export default defineConfig({ | ||
| site: SITE, | ||
| base: BASE, | ||
| trailingSlash: 'always', | ||
| integrations: [ | ||
| syncRepoContent(), | ||
| mermaid({ autoTheme: true }), | ||
| starlight({ | ||
| title: 'Google Rust Style Guide Kit', | ||
| description: | ||
| "Unofficial kit that enforces Google's Rust style guide with rustfmt, clippy, cargo-deny, AGENTS.md for coding agents, and a human review guide. Adopt it in 5 minutes.", | ||
| logo: { src: './src/assets/logo.svg' }, | ||
| social: [{ icon: 'github', label: 'GitHub', href: REPO_URL }], | ||
| lastUpdated: true, | ||
| components: { Footer: './src/components/Footer.astro' }, | ||
| routeMiddleware: './src/route-middleware.ts', | ||
| customCss: ['./src/styles/theme.css'], | ||
| plugins: [ | ||
| starlightLinksValidator({ | ||
| exclude: [`${BASE}/files/**`, `${BASE}/og/**`, `${BASE}/**/*.md`, `${BASE}/llms*.txt`, `${BASE}/_llms-txt/**`], | ||
| }), | ||
| // No baseUrl: with it, this plugin writes its own llms.txt over starlight-llms-txt's. | ||
| starlightPageActions({ | ||
| prompt: 'Read {url} and help me apply the Google Rust Style Guide kit to my Rust project.', | ||
| actions: { chatgpt: true, claude: true, perplexity: true, cursor: true, markdown: true }, | ||
| }), | ||
| starlightLlmsTxt({ | ||
| projectName: 'Google Rust Style Guide Kit (unofficial)', | ||
| description: | ||
| "Drop-in rustfmt, clippy and cargo-deny configuration plus AGENTS.md that enforces Google's Rust style guide. 32 of 62 in-scope rules are tool-enforced; the rest are covered by agent instructions and a human review guide.", | ||
| details: [ | ||
| `Not affiliated with Google. The guide itself: ${GUIDE_URL}`, | ||
| `Adopt: download rustfmt.toml, clippy.toml, deny.toml, rust-toolchain.toml and AGENTS.md from ${FILES_URL}/, append ${FILES_URL}/crate-lints.toml (single crate) or ${FILES_URL}/workspace-lints.toml (workspace root, then \`[lints] workspace = true\` in each member) to Cargo.toml, then run \`cargo +nightly fmt\`, \`cargo clippy --workspace --all-targets -- -D warnings\` and \`cargo deny check bans\`. Never edit the lint configuration to silence a warning; fix the code or add \`#[expect(lint, reason = "...")]\` where the guide allows an exception.`, | ||
| ].join('\n\n'), | ||
| promote: ['index*', 'quick-start', 'adopting', 'coverage', 'agents-md'], | ||
| demote: ['why-not', 'config/**'], | ||
| customSets: [ | ||
| { | ||
| label: 'For coding agents', | ||
| paths: ['quick-start', 'agents-md', 'adopting', 'config/**'], | ||
| description: 'Everything a coding agent needs to apply the kit to a repository.', | ||
| }, | ||
| { | ||
| label: 'For reviewers', | ||
| paths: ['human-review', 'coverage', 'why-not'], | ||
| description: 'What the tools enforce and what a human reviewer must judge.', | ||
| }, | ||
| ], | ||
| optionalLinks: [ | ||
| { label: 'Google Rust Style Guide (original)', url: GUIDE_URL }, | ||
| { label: 'Source repository', url: REPO_URL }, | ||
| ], | ||
| }), | ||
| ], | ||
| sidebar: [ | ||
| { | ||
| label: 'Start', | ||
| items: [{ slug: 'quick-start' }, { slug: 'adopting' }, { slug: 'faq' }], | ||
| }, | ||
| { | ||
| label: 'Concepts', | ||
| items: [{ slug: 'how-it-works' }, { slug: 'why' }, { slug: 'why-not' }], | ||
| }, | ||
| { | ||
| label: 'Reference', | ||
| items: [ | ||
| { slug: 'coverage' }, | ||
| { slug: 'agents-md' }, | ||
| { slug: 'config/cargo-lints' }, | ||
| { slug: 'config/clippy-toml' }, | ||
| { slug: 'config/rustfmt-toml' }, | ||
| { slug: 'config/deny-toml' }, | ||
| ], | ||
| }, | ||
| { | ||
| label: 'Review', | ||
| items: [{ slug: 'human-review' }], | ||
| }, | ||
| ], | ||
| }), | ||
| // Replaces Starlight's built-in sitemap so <lastmod> can come from git. | ||
| sitemap({ | ||
| serialize(item) { | ||
| const lastmod = lastModifiedBySlug(item.url); | ||
| return lastmod ? { ...item, lastmod } : item; | ||
| }, | ||
| }), | ||
| ], | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.