Skip to content

Commit 7d09048

Browse files
committed
move to astro + starlight
1 parent e65f5c2 commit 7d09048

File tree

282 files changed

+10515
-17275
lines changed

Some content is hidden

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

282 files changed

+10515
-17275
lines changed

.github/workflows/deploy.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout your repository using git
17+
uses: actions/checkout@v5
18+
- name: Install, build, and upload your site
19+
uses: withastro/action@v5
20+
with:
21+
node-version: 25
22+
23+
deploy:
24+
needs: build
25+
runs-on: ubuntu-latest
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
29+
steps:
30+
- name: Deploy to GitHub Pages
31+
id: deployment
32+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
# Dependencies
2-
/node_modules
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
35

4-
# Production
5-
/build
6-
7-
# Generated files
8-
.docusaurus
9-
.cache-loader
10-
/src/js/generatedVersionTable.mdx
11-
12-
# Misc
13-
.DS_Store
14-
.env.local
15-
.env.development.local
16-
.env.test.local
17-
.env.production.local
6+
# dependencies
7+
node_modules/
188

9+
# logs
1910
npm-debug.log*
2011
yarn-debug.log*
2112
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store

astro.config.mjs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
import starlightThemeBlack from 'starlight-theme-black';
5+
import fs from 'fs';
6+
import path from 'path';
7+
8+
const changelogsDir = path.join(process.cwd(), 'src', 'content', 'docs', 'changelog');
9+
const changelogFiles = fs
10+
.readdirSync(changelogsDir)
11+
.filter((f) => f.endsWith('.md') || f.endsWith('.mdx'))
12+
.map((f) => {
13+
const content = fs.readFileSync(path.join(changelogsDir, f), 'utf8');
14+
const title = content.match(/title:\s*(.+)/)?.[1]?.trim() || f.replace(/\.mdx?$/, '');
15+
const slug = f.replace(/\.mdx?$/, '');
16+
return { slug, title };
17+
})
18+
.sort((a, b) => {
19+
const regex = /(\d+)-(\d+)-(\d+)(p(\d+))?/;
20+
const matchA = a.slug.match(regex),
21+
matchB = b.slug.match(regex);
22+
if (!matchA || !matchB) return 0;
23+
const [, majA, minA, patA, , preA = '0'] = matchA;
24+
const [, majB, minB, patB, , preB = '0'] = matchB;
25+
if (majA !== majB) return +majA - +majB;
26+
if (minA !== minB) return +minA - +minB;
27+
if (patA !== patB) return +patA - +patB;
28+
if (+preA === 0 && +preB > 0) return 1;
29+
if (+preA > 0 && +preB === 0) return -1;
30+
return +preA - +preB;
31+
})
32+
.reverse()
33+
.map(({ slug, title }) => ({ label: title, link: `/changelog/${slug}` }));
34+
35+
// https://astro.build/config
36+
export default defineConfig({
37+
site: 'https://c1xtz.github.io/',
38+
base: '/csp-logs',
39+
integrations: [
40+
starlight({
41+
defaultLocale: 'en',
42+
title: 'CSP Version Archive',
43+
customCss: ['./src/styles/custom.css'],
44+
tableOfContents: { minHeadingLevel: 1 },
45+
components: {
46+
Header: './src/components/Header.astro', //adds Content Manager social icon
47+
},
48+
social: [
49+
{ icon: 'discord', label: 'Discord', href: 'https://discord.gg/nM4Xkrt' },
50+
{ icon: 'patreon', label: 'Patreon', href: 'https://www.patreon.com/x4fab' },
51+
{ icon: 'github', label: 'Github', href: 'https://github.com/ac-custom-shaders-patch' },
52+
],
53+
sidebar: [
54+
{ label: 'Version List', link: 'versions' },
55+
{ label: 'Changelogs', items: changelogFiles },
56+
],
57+
plugins: [
58+
starlightThemeBlack({
59+
footerText: 'This site is maintained by [C1XTZ](https://github.com/C1XTZ), a 3rd party unaffiated with Custom Shaders Patch. You can contriube [here.](https://github.com/C1XTZ/csp-logs)',
60+
}),
61+
],
62+
}),
63+
],
64+
});

babel.config.js

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

docs/changelog/0-1-46p12.md

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

docs/changelog/0-3-0p140.md

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

docs/intro.md

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

docs/versions.md

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

docusaurus.config.js

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

0 commit comments

Comments
 (0)