-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
45 lines (43 loc) · 1.47 KB
/
astro.config.mjs
File metadata and controls
45 lines (43 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import pagePlugin from '@pelagornis/page';
const owner = process.env.GITHUB_REPOSITORY_OWNER ?? process.env.GITHUB_ACTOR ?? 'your-github-id';
const repository = process.env.GITHUB_REPOSITORY?.split('/')[1] ?? 'simulation-primer';
const isUserSite = repository.toLowerCase() === `${owner.toLowerCase()}.github.io`;
const isGithubActions = process.env.GITHUB_ACTIONS === 'true';
const base = isGithubActions ? (isUserSite ? '/' : `/${repository}`) : '/';
export default defineConfig({
site: `https://${owner}.github.io`,
base,
trailingSlash: 'always',
integrations: [
starlight({
plugins: [pagePlugin()],
title: 'CosmoSim Primer',
logo: {
src: './src/assets/galaxy.svg',
},
description: 'Beginner-first guide to Arepo, Enzo, Gadget, Gizmo, and Ramses.',
pagination: false,
components: {
Head: '/src/components/StarlightHead.astro',
Header: '/src/components/PageHeader.astro',
TableOfContents: '/src/components/InstantTableOfContents.astro',
Footer: '/src/components/EmptyFooter.astro',
LanguageSelect: '/src/components/LanguageSelect.astro'
},
defaultLocale: 'en',
locales: {
en: {
label: 'English',
lang: 'en'
},
ko: {
label: '한국어',
lang: 'ko'
}
},
customCss: ['./src/styles/custom.css']
})
]
});