File tree Expand file tree Collapse file tree 17 files changed +314
-9
lines changed
Expand file tree Collapse file tree 17 files changed +314
-9
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,26 @@ export default defineConfig({
1818 } ,
1919 sidebar : [
2020 {
21- label : 'Guides' ,
22- items : [
23- { label : 'Example Guide' , slug : 'guides/example' } ,
24- ] ,
21+ label : '1.x' ,
22+ autogenerate : { directory : '1.x' } ,
2523 } ,
2624 {
27- label : 'Reference' ,
28- autogenerate : { directory : 'reference' } ,
25+ label : '2.x' ,
26+ autogenerate : { directory : '2.x' } ,
27+ } ,
28+ {
29+ label : '3.x' ,
30+ autogenerate : { directory : '3.x' } ,
31+ } ,
32+ {
33+ label : '4.x' ,
34+ autogenerate : { directory : '4.x' } ,
2935 } ,
3036 ] ,
37+ components : {
38+ Footer : './docs/components/Footer.astro' ,
39+ Sidebar : './docs/components/Sidebar.astro' ,
40+ } ,
3141 customCss : [ './docs/tailwind.css' ] ,
3242 } ) ,
3343 tailwind ( {
Original file line number Diff line number Diff line change 1+ ---
2+ import EditLink from ' virtual:starlight/components/EditLink'
3+ ---
4+
5+ <footer class =" sl-flex" >
6+ <div class =" meta sl-flex" >
7+ <EditLink />
8+ </div >
9+ </footer >
10+
11+ <style >
12+ footer {
13+ flex-direction: column;
14+ gap: 1.5rem;
15+ }
16+
17+ .meta {
18+ gap: 0.75rem 3rem;
19+ justify-content: space-between;
20+ flex-wrap: wrap;
21+ margin-top: 3rem;
22+ font-size: var(--sl-text-sm);
23+ color: var(--sl-color-gray-3);
24+ }
25+
26+ .meta > :global(p:only-child) {
27+ margin-inline-start: auto;
28+ }
29+ </style >
Original file line number Diff line number Diff line change 1+ ---
2+ import MobileMenuFooter from ' virtual:starlight/components/MobileMenuFooter'
3+ import SidebarPersister from ' @astrojs/starlight/components/SidebarPersister.astro'
4+ import SidebarSublist from ' @astrojs/starlight/components/SidebarSublist.astro'
5+ import { getVersionFromId } from ' ../utilities/versioning'
6+
7+ const { id, sidebar } = Astro .locals .starlightRoute
8+
9+ const sublist = sidebar .find ((group ) => group .label === getVersionFromId (id ))?.entries ?? []
10+ ---
11+
12+ <SidebarPersister >
13+ <SidebarSublist sublist ={ sublist } />
14+ </SidebarPersister >
15+
16+ <div class =" md:sl-hidden" >
17+ <MobileMenuFooter />
18+ </div >
Original file line number Diff line number Diff line change 11import { defineCollection } from 'astro:content'
22import { docsLoader } from '@astrojs/starlight/loaders'
33import { docsSchema } from '@astrojs/starlight/schema'
4+ import { glob } from 'astro/loaders'
45
56export const collections = {
6- docs : defineCollection ( { loader : docsLoader ( ) , schema : docsSchema ( ) } ) ,
7+ docs : defineCollection ( { loader : glob ( {
8+ pattern : `**/[^_]*.{md,mdx}` ,
9+ base : './docs/content/docs' ,
10+ generateId : ( { entry } ) => entry . split ( '.' ) . slice ( 0 , - 1 ) . join ( '.' ) ,
11+ } ) , schema : docsSchema ( ) } ) ,
712}
File renamed without changes.
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ hero:
1515 </span>
1616 tagline : Congrats on setting up a new Starlight project!
1717 image :
18- file : ../../assets/houston.webp
18+ file : ../../../ assets/houston.webp
1919 actions :
2020 - text : Example Guide
21- link : /docs/guides/example/
21+ link : /docs/1.x/ guides/example
2222 icon : right-arrow
2323 - text : Read the Starlight docs
2424 link : https://starlight.astro.build
File renamed without changes.
Original file line number Diff line number Diff line change 1+ ---
2+ title : Example Guide
3+ description : A guide in my new Starlight docs site.
4+ ---
5+
6+ Guides lead a user through a specific task they want to accomplish, often with a sequence of steps.
7+ Writing a good guide requires thinking about what your users are trying to do.
8+
9+ ## Further reading
10+
11+ - Read [ about how-to guides] ( https://diataxis.fr/how-to-guides/ ) in the Diátaxis framework
Original file line number Diff line number Diff line change 1+ ---
2+ title : Welcome to Starlight
3+ description : Get started building your docs site with Starlight.
4+ template : splash
5+ hero :
6+ title : |
7+ Welcome to Starlight with
8+ <span
9+ class="font-black text-transparent
10+ bg-clip-text bg-gradient-to-b
11+ from-accent-700 to-accent-400
12+ dark:from-accent-500 dark:to-accent-200"
13+ >
14+ Tailwind
15+ </span>
16+ tagline : Congrats on setting up a new Starlight project!
17+ image :
18+ file : ../../../assets/houston.webp
19+ actions :
20+ - text : Example Guide
21+ link : /docs/2.x/guides/example
22+ icon : right-arrow
23+ - text : Read the Starlight docs
24+ link : https://starlight.astro.build
25+ icon : external
26+ variant : minimal
27+ ---
28+
29+ import { Card , CardGrid } from ' @astrojs/starlight/components'
30+
31+ ## Next steps
32+
33+ <CardGrid stagger >
34+ <Card
35+ title = " Update content"
36+ icon = " pencil"
37+ >
38+ Edit ` src/content/docs/index.mdx ` to see this page change.
39+ </Card >
40+ <Card
41+ title = " Add new content"
42+ icon = " add-document"
43+ >
44+ Add Markdown or MDX files to ` src/content/docs ` to create new pages.
45+ </Card >
46+ <Card
47+ title = " Configure your site"
48+ icon = " setting"
49+ >
50+ Edit your ` sidebar ` and other config in ` astro.config.mjs ` .
51+ </Card >
52+ <Card
53+ title = " Read the docs"
54+ icon = " open-book"
55+ >
56+ Learn more in [ the Starlight Docs] ( https://starlight.astro.build/ ) .
57+ </Card >
58+ </CardGrid >
Original file line number Diff line number Diff line change 1+ ---
2+ title : Example Reference
3+ description : A reference page in my new Starlight docs site.
4+ ---
5+
6+ Reference pages are ideal for outlining how things work in terse and clear terms.
7+ Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what your documenting.
8+
9+ ## Further reading
10+
11+ - Read [ about reference] ( https://diataxis.fr/reference/ ) in the Diátaxis framework
You can’t perform that action at this time.
0 commit comments