Skip to content

Commit a0d08b9

Browse files
committed
chore: migrate docs from vitepress to astro/starlight
1 parent ebcd8f6 commit a0d08b9

7 files changed

Lines changed: 6726 additions & 2638 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ cache/
44
coverage/
55
dist/
66
node_modules/
7+
8+
# Astro
9+
.astro/

astro.config.mjs

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
import { defineConfig } from 'astro/config';
2+
import starlight from '@astrojs/starlight';
3+
4+
export default defineConfig({
5+
srcDir: './docs',
6+
site: 'https://knowledgecode.github.io',
7+
base: '/date-and-time',
8+
trailingSlash: 'never',
9+
markdown: {
10+
shikiConfig: {
11+
themes: {
12+
light: 'github-light',
13+
dark: 'github-dark',
14+
},
15+
},
16+
},
17+
integrations: [
18+
starlight({
19+
title: 'date-and-time',
20+
description: 'The simplest, most intuitive date and time library',
21+
logo: {
22+
src: './public/logo.png',
23+
alt: 'date-and-time',
24+
},
25+
social: [
26+
{ icon: 'github', label: 'GitHub', href: 'https://github.com/knowledgecode/date-and-time' },
27+
{ icon: 'npm', label: 'npm', href: 'https://www.npmjs.com/package/date-and-time' },
28+
],
29+
sidebar: [
30+
{
31+
label: 'Getting Started',
32+
items: [
33+
{ label: 'Introduction', slug: 'guide/index' },
34+
{ label: 'Installation', slug: 'guide/installation' },
35+
{ label: 'Quick Start', slug: 'guide/quick-start' },
36+
],
37+
},
38+
{
39+
label: 'API Reference',
40+
collapsed: true,
41+
items: [
42+
{ label: 'Overview', slug: 'api/index' },
43+
{
44+
label: 'Core Functions',
45+
items: [
46+
{ label: 'format()', slug: 'api/format' },
47+
{ label: 'parse()', slug: 'api/parse' },
48+
{ label: 'compile()', slug: 'api/compile' },
49+
{ label: 'preparse()', slug: 'api/preparse' },
50+
{ label: 'isValid()', slug: 'api/isValid' },
51+
{ label: 'transform()', slug: 'api/transform' },
52+
{ label: 'addYears()', slug: 'api/addYears' },
53+
{ label: 'addMonths()', slug: 'api/addMonths' },
54+
{ label: 'addDays()', slug: 'api/addDays' },
55+
{ label: 'addHours()', slug: 'api/addHours' },
56+
{ label: 'addMinutes()', slug: 'api/addMinutes' },
57+
{ label: 'addSeconds()', slug: 'api/addSeconds' },
58+
{ label: 'addMilliseconds()', slug: 'api/addMilliseconds' },
59+
{ label: 'subtract()', slug: 'api/subtract' },
60+
],
61+
},
62+
{
63+
label: 'Utility Functions',
64+
items: [
65+
{ label: 'isLeapYear()', slug: 'api/utils/isLeapYear' },
66+
{ label: 'isSameDay()', slug: 'api/utils/isSameDay' },
67+
{ label: 'getDaysInMonth()', slug: 'api/utils/getDaysInMonth' },
68+
{ label: 'getISOWeekYear()', slug: 'api/utils/getISOWeekYear' },
69+
{ label: 'getISOWeek()', slug: 'api/utils/getISOWeek' },
70+
],
71+
},
72+
],
73+
},
74+
{ label: 'Locales', slug: 'locales' },
75+
{ label: 'Timezones', slug: 'timezones' },
76+
{ label: 'Plugins', slug: 'plugins' },
77+
{ label: 'Migration Guide', slug: 'migration' },
78+
],
79+
}),
80+
],
81+
});

docs/content.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { defineCollection } from 'astro:content';
2+
import { glob } from 'astro/loaders';
3+
import { docsSchema } from '@astrojs/starlight/schema';
4+
5+
export const collections = {
6+
docs: defineCollection({
7+
loader: glob({
8+
pattern: '**/*.{md,mdx}',
9+
base: './docs',
10+
}),
11+
schema: docsSchema(),
12+
}),
13+
};

docs/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/// <reference types="astro/client" />

0 commit comments

Comments
 (0)