-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastro.config.mjs
More file actions
97 lines (93 loc) · 2.5 KB
/
astro.config.mjs
File metadata and controls
97 lines (93 loc) · 2.5 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// @ts-check
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
// https://astro.build/config
export default defineConfig({
site: 'https://docs.pymc.dev',
integrations: [
starlight({
title: 'pyMC Docs',
description: 'Documentation hub for pyMC Core, pyMC Repeater, and pyMC HA Integration',
favicon: '/favicon.png',
head: [
{
tag: 'script',
content: `(() => {
try {
if (typeof localStorage !== 'undefined' && !localStorage.getItem('starlight-theme')) {
localStorage.setItem('starlight-theme', 'dark');
}
} catch {}
})();`,
},
{
tag: 'script',
content: `(() => {
const markExternalLinks = () => {
document.querySelectorAll('a[href]').forEach((link) => {
const href = link.getAttribute('href');
if (!href || href.startsWith('#') || href.startsWith('/') || href.startsWith('mailto:') || href.startsWith('tel:') || href.startsWith('javascript:')) return;
try {
const url = new URL(href, window.location.href);
if (url.origin === window.location.origin) return;
link.target = '_blank';
const rel = new Set((link.getAttribute('rel') || '').split(/\\s+/).filter(Boolean));
rel.add('noopener');
rel.add('noreferrer');
link.setAttribute('rel', [...rel].join(' '));
} catch {}
});
};
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', markExternalLinks, { once: true });
} else {
markExternalLinks();
}
})();`,
},
],
components: {
SocialIcons: './src/components/SocialIcons.astro',
},
logo: {
light: './src/assets/pymc-logo.png',
dark: './src/assets/pymc-logo.png',
replacesTitle: false,
},
customCss: ['./src/styles/brand.css'],
social: [
{ icon: 'github', label: 'pyMC on GitHub', href: 'https://github.com/pymc-dev' },
],
editLink: {
baseUrl: 'https://github.com/pyMC-dev/pyMC_docs/edit/main/',
},
sidebar: [
{
label: 'Projects',
items: [
{
label: 'pyMC Core',
autogenerate: { directory: 'projects/pymc-core' },
},
{
label: 'pyMC Repeater',
autogenerate: { directory: 'projects/pymc-repeater' },
},
{
label: 'pyMC HA Integration',
autogenerate: { directory: 'projects/pymc-ha-integration' },
},
],
},
{
label: 'About this Documentation',
collapsed: true,
items: [
{ label: 'Overview', slug: '' },
{ label: 'Contributing', slug: 'contributing' },
],
},
],
}),
],
});