build: scaffold Incognito Starlight site
This commit is contained in:
parent
73a2259de2
commit
9c318959c8
10 changed files with 7914 additions and 0 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -1 +1,7 @@
|
||||||
.worktrees/
|
.worktrees/
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
.astro/
|
||||||
|
.DS_Store
|
||||||
|
.env*
|
||||||
|
!.env.example
|
||||||
|
|
|
||||||
1
.nvmrc
Normal file
1
.nvmrc
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
22.22.3
|
||||||
19
astro.config.mjs
Normal file
19
astro.config.mjs
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { defineConfig } from 'astro/config';
|
||||||
|
import starlight from '@astrojs/starlight';
|
||||||
|
import { sidebar } from './src/config/sidebar.mjs';
|
||||||
|
|
||||||
|
const site = process.env.SITE || 'http://localhost:4321';
|
||||||
|
const base = process.env.BASE || '/';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
site,
|
||||||
|
base,
|
||||||
|
integrations: [
|
||||||
|
starlight({
|
||||||
|
title: 'Incognito Wiki',
|
||||||
|
description: 'Academic knowledge and student resources maintained by MSV Incognito.',
|
||||||
|
lastUpdated: true,
|
||||||
|
sidebar,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
});
|
||||||
7830
package-lock.json
generated
Normal file
7830
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
23
package.json
Normal file
23
package.json
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"name": "incognito-wiki",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"engines": { "node": ">=22.12.0" },
|
||||||
|
"scripts": {
|
||||||
|
"dev": "astro dev",
|
||||||
|
"build": "astro build",
|
||||||
|
"preview": "astro preview",
|
||||||
|
"check": "astro check && node --test",
|
||||||
|
"test": "node --test"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@astrojs/starlight": "0.41.6",
|
||||||
|
"astro": "7.1.6",
|
||||||
|
"sharp": "0.35.3"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@astrojs/check": "0.9.10",
|
||||||
|
"typescript": "6.0.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
1
src/config/sidebar.mjs
Normal file
1
src/config/sidebar.mjs
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
export const sidebar = [{ label: 'Home', link: '/' }];
|
||||||
7
src/content.config.ts
Normal file
7
src/content.config.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
import { defineCollection } from 'astro:content';
|
||||||
|
import { docsLoader } from '@astrojs/starlight/loaders';
|
||||||
|
import { docsSchema } from '@astrojs/starlight/schema';
|
||||||
|
|
||||||
|
export const collections = {
|
||||||
|
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
|
||||||
|
};
|
||||||
6
src/content/docs/index.mdx
Normal file
6
src/content/docs/index.mdx
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
title: Home
|
||||||
|
description: Academic knowledge and student resources maintained by MSV Incognito.
|
||||||
|
---
|
||||||
|
|
||||||
|
Migration in progress.
|
||||||
18
tests/project-structure.test.mjs
Normal file
18
tests/project-structure.test.mjs
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
import assert from 'node:assert/strict';
|
||||||
|
import { readFile } from 'node:fs/promises';
|
||||||
|
import test from 'node:test';
|
||||||
|
|
||||||
|
test('package scripts expose the local workflow', async () => {
|
||||||
|
const pkg = JSON.parse(await readFile('package.json', 'utf8'));
|
||||||
|
assert.equal(pkg.scripts.dev, 'astro dev');
|
||||||
|
assert.equal(pkg.scripts.build, 'astro build');
|
||||||
|
assert.equal(pkg.scripts.check, 'astro check && node --test');
|
||||||
|
assert.equal(pkg.scripts.test, 'node --test');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Astro configuration is environment-portable', async () => {
|
||||||
|
const config = await readFile('astro.config.mjs', 'utf8');
|
||||||
|
assert.match(config, /process\.env\.SITE/);
|
||||||
|
assert.match(config, /process\.env\.BASE/);
|
||||||
|
assert.match(config, /starlight\(/);
|
||||||
|
});
|
||||||
3
tsconfig.json
Normal file
3
tsconfig.json
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"extends": "astro/tsconfigs/strict"
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue