stack-site-builder 1.10.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +126 -0
- package/README.md +48 -1
- package/index.d.ts +10 -0
- package/index.mjs +63 -30
- package/markdown.mjs +24 -12
- package/package.json +9 -3
- package/src/components/ArticleLink.astro +2 -2
- package/src/components/ConceptDetail.astro +2 -2
- package/src/components/ConceptLink.astro +2 -2
- package/src/components/ConceptTools.astro +2 -2
- package/src/components/LanguageSwitcher.astro +7 -7
- package/src/components/PageDetail.astro +52 -0
- package/src/components/ProjectViewer.astro +2 -2
- package/src/components/SampleIndex.astro +2 -2
- package/src/components/SampleProject.astro +3 -3
- package/src/components/StackCard.astro +3 -3
- package/src/components/StackDetail.astro +3 -3
- package/src/components/ThemeToggle.astro +1 -3
- package/src/components/ToolMeta.astro +2 -2
- package/src/content.ts +29 -1
- package/src/i18n/ui.ts +70 -13
- package/src/layouts/BaseLayout.astro +128 -57
- package/src/lib/dates.ts +2 -2
- package/src/lib/facets.ts +2 -2
- package/src/lib/locales.ts +16 -0
- package/src/lib/pages.ts +24 -0
- package/src/lib/sections.ts +34 -0
- package/src/pages/[...lang]/[page].astro +30 -0
- package/src/pages/{ko → [...lang]}/article/[...id].astro +11 -5
- package/src/pages/[...lang]/article/category/[id].astro +25 -0
- package/src/pages/[...lang]/article/index.astro +18 -0
- package/src/pages/[...lang]/categories/[id].astro +28 -0
- package/src/pages/{ko → [...lang]}/concept/[...id].astro +11 -5
- package/src/pages/[...lang]/concept/category/[id].astro +25 -0
- package/src/pages/[...lang]/concept/index.astro +18 -0
- package/src/pages/[...lang]/glossary.astro +18 -0
- package/src/pages/[...lang]/index.astro +16 -0
- package/src/pages/[...lang]/sample/[folder].astro +25 -0
- package/src/pages/[...lang]/sample/index.astro +18 -0
- package/src/pages/[...lang]/slides/[deck].astro +22 -0
- package/src/pages/[...lang]/slides/index.astro +18 -0
- package/src/pages/{ko → [...lang]}/stack/[...id].astro +20 -13
- package/src/pages/[...lang]/tags/[tag].astro +24 -0
- package/src/pages/[...lang]/vendors/[vendor].astro +24 -0
- package/src/styles/global.css +7 -0
- package/src/pages/article/[...id].astro +0 -24
- package/src/pages/article/category/[id].astro +0 -17
- package/src/pages/article/index.astro +0 -12
- package/src/pages/categories/[id].astro +0 -25
- package/src/pages/concept/[...id].astro +0 -24
- package/src/pages/concept/category/[id].astro +0 -17
- package/src/pages/concept/index.astro +0 -12
- package/src/pages/glossary.astro +0 -12
- package/src/pages/index.astro +0 -9
- package/src/pages/ko/article/category/[id].astro +0 -17
- package/src/pages/ko/article/index.astro +0 -12
- package/src/pages/ko/categories/[id].astro +0 -24
- package/src/pages/ko/concept/category/[id].astro +0 -17
- package/src/pages/ko/concept/index.astro +0 -12
- package/src/pages/ko/glossary.astro +0 -12
- package/src/pages/ko/index.astro +0 -9
- package/src/pages/ko/sample/[folder].astro +0 -16
- package/src/pages/ko/sample/index.astro +0 -12
- package/src/pages/ko/slides/[deck].astro +0 -14
- package/src/pages/ko/slides/index.astro +0 -12
- package/src/pages/ko/tags/[tag].astro +0 -18
- package/src/pages/ko/vendors/[vendor].astro +0 -18
- package/src/pages/sample/[folder].astro +0 -16
- package/src/pages/sample/index.astro +0 -12
- package/src/pages/slides/[deck].astro +0 -14
- package/src/pages/slides/index.astro +0 -12
- package/src/pages/stack/[...id].astro +0 -51
- package/src/pages/tags/[tag].astro +0 -18
- package/src/pages/vendors/[vendor].astro +0 -18
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import type { GetStaticPaths } from 'astro';
|
|
4
|
-
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
|
-
import CategoryIndex from '../../../components/CategoryIndex.astro';
|
|
6
|
-
import { allCategoryIds, categoryMap } from '@aas-data/categories';
|
|
7
|
-
import { getStacksByCategory } from '../../../lib/stacks';
|
|
8
|
-
|
|
9
|
-
export const getStaticPaths = (async () => {
|
|
10
|
-
const paths = [];
|
|
11
|
-
for (const id of allCategoryIds) {
|
|
12
|
-
if ((await getStacksByCategory('ko', id)).length === 0) continue;
|
|
13
|
-
paths.push({ params: { id }, props: { id } });
|
|
14
|
-
}
|
|
15
|
-
return paths;
|
|
16
|
-
}) satisfies GetStaticPaths;
|
|
17
|
-
|
|
18
|
-
const { id } = Astro.props;
|
|
19
|
-
const node = categoryMap.get(id)!;
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
<BaseLayout title={`${node.label.ko} — ${site.name}`} lang="ko" path={`categories/${id}/`}>
|
|
23
|
-
<CategoryIndex lang="ko" id={id} />
|
|
24
|
-
</BaseLayout>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import type { GetStaticPaths } from 'astro';
|
|
4
|
-
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
|
5
|
-
import ConceptIndex from '../../../../components/ConceptIndex.astro';
|
|
6
|
-
import { conceptTree } from '@aas-data/concept-categories';
|
|
7
|
-
|
|
8
|
-
export const getStaticPaths = (() =>
|
|
9
|
-
conceptTree.allIds.map((id) => ({ params: { id }, props: { id } }))) satisfies GetStaticPaths;
|
|
10
|
-
|
|
11
|
-
const { id } = Astro.props as { id: string };
|
|
12
|
-
const node = conceptTree.map.get(id)!;
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
<BaseLayout title={`${node.label.ko} — ${site.name}`} lang="ko" path={`concept/category/${id}/`}>
|
|
16
|
-
<ConceptIndex lang="ko" categoryId={id} />
|
|
17
|
-
</BaseLayout>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
4
|
-
import ConceptIndex from '../../../components/ConceptIndex.astro';
|
|
5
|
-
import { useTranslations } from '../../../i18n/ui';
|
|
6
|
-
|
|
7
|
-
const t = useTranslations('ko');
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<BaseLayout title={`${t('concept.title')} — ${site.name}`} lang="ko" path="concept/">
|
|
11
|
-
<ConceptIndex lang="ko" />
|
|
12
|
-
</BaseLayout>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
4
|
-
import Glossary from '../../components/Glossary.astro';
|
|
5
|
-
import { useTranslations } from '../../i18n/ui';
|
|
6
|
-
|
|
7
|
-
const t = useTranslations('ko');
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<BaseLayout title={`${t('glossary.title')} — ${site.name}`} lang="ko" path="glossary/">
|
|
11
|
-
<Glossary lang="ko" />
|
|
12
|
-
</BaseLayout>
|
package/src/pages/ko/index.astro
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
4
|
-
import SamplePage from '../../../components/SamplePage.astro';
|
|
5
|
-
import { listSampleFolders } from '../../../lib/project';
|
|
6
|
-
|
|
7
|
-
export function getStaticPaths() {
|
|
8
|
-
return listSampleFolders().map((folder) => ({ params: { folder } }));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const { folder } = Astro.params;
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<BaseLayout title={`samples/${folder} — ${site.name}`} lang="ko" path={`sample/${folder}/`}>
|
|
15
|
-
<SamplePage lang="ko" folder={folder!} />
|
|
16
|
-
</BaseLayout>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
4
|
-
import SampleIndex from '../../../components/SampleIndex.astro';
|
|
5
|
-
import { useTranslations } from '../../../i18n/ui';
|
|
6
|
-
|
|
7
|
-
const t = useTranslations('ko');
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<BaseLayout title={`${t('sample.title')} — ${site.name}`} lang="ko" path="sample/">
|
|
11
|
-
<SampleIndex lang="ko" />
|
|
12
|
-
</BaseLayout>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { GetStaticPaths } from 'astro';
|
|
3
|
-
import DeckView from '../../../components/DeckView.astro';
|
|
4
|
-
import { getDecks, deckSlugOf } from '../../../lib/slides';
|
|
5
|
-
|
|
6
|
-
export const getStaticPaths = (async () => {
|
|
7
|
-
const decks = await getDecks('ko');
|
|
8
|
-
return decks.map((entry) => ({ params: { deck: deckSlugOf(entry) }, props: { entry } }));
|
|
9
|
-
}) satisfies GetStaticPaths;
|
|
10
|
-
|
|
11
|
-
const { entry } = Astro.props;
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<DeckView entry={entry} lang="ko" />
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
4
|
-
import SlidesIndex from '../../../components/SlidesIndex.astro';
|
|
5
|
-
import { useTranslations } from '../../../i18n/ui';
|
|
6
|
-
|
|
7
|
-
const t = useTranslations('ko');
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<BaseLayout title={`${t('slides.title')} — ${site.name}`} lang="ko" path="slides/">
|
|
11
|
-
<SlidesIndex lang="ko" />
|
|
12
|
-
</BaseLayout>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import type { GetStaticPaths } from 'astro';
|
|
4
|
-
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
|
-
import TagIndex from '../../../components/TagIndex.astro';
|
|
6
|
-
import { getAllTags } from '../../../lib/stacks';
|
|
7
|
-
|
|
8
|
-
export const getStaticPaths = (async () => {
|
|
9
|
-
const tags = await getAllTags('ko');
|
|
10
|
-
return tags.map((tag) => ({ params: { tag }, props: { tag } }));
|
|
11
|
-
}) satisfies GetStaticPaths;
|
|
12
|
-
|
|
13
|
-
const { tag } = Astro.props;
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
<BaseLayout title={`#${tag} — ${site.name}`} lang="ko" path={`tags/${tag}/`}>
|
|
17
|
-
<TagIndex lang="ko" tag={tag} />
|
|
18
|
-
</BaseLayout>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import type { GetStaticPaths } from 'astro';
|
|
4
|
-
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
|
-
import VendorIndex from '../../../components/VendorIndex.astro';
|
|
6
|
-
import { getAllVendors } from '../../../lib/stacks';
|
|
7
|
-
|
|
8
|
-
export const getStaticPaths = (async () => {
|
|
9
|
-
const vendors = await getAllVendors('ko');
|
|
10
|
-
return vendors.map((vendor) => ({ params: { vendor }, props: { vendor } }));
|
|
11
|
-
}) satisfies GetStaticPaths;
|
|
12
|
-
|
|
13
|
-
const { vendor } = Astro.props;
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
<BaseLayout title={`${vendor} — ${site.name}`} lang="ko" path={`vendors/${vendor}/`}>
|
|
17
|
-
<VendorIndex lang="ko" vendor={vendor} />
|
|
18
|
-
</BaseLayout>
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
4
|
-
import SamplePage from '../../components/SamplePage.astro';
|
|
5
|
-
import { listSampleFolders } from '../../lib/project';
|
|
6
|
-
|
|
7
|
-
export function getStaticPaths() {
|
|
8
|
-
return listSampleFolders().map((folder) => ({ params: { folder } }));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const { folder } = Astro.params;
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<BaseLayout title={`samples/${folder} — ${site.name}`} lang="en" path={`sample/${folder}/`}>
|
|
15
|
-
<SamplePage lang="en" folder={folder!} />
|
|
16
|
-
</BaseLayout>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
4
|
-
import SampleIndex from '../../components/SampleIndex.astro';
|
|
5
|
-
import { useTranslations } from '../../i18n/ui';
|
|
6
|
-
|
|
7
|
-
const t = useTranslations('en');
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<BaseLayout title={`${t('sample.title')} — ${site.name}`} lang="en" path="sample/">
|
|
11
|
-
<SampleIndex lang="en" />
|
|
12
|
-
</BaseLayout>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import type { GetStaticPaths } from 'astro';
|
|
3
|
-
import DeckView from '../../components/DeckView.astro';
|
|
4
|
-
import { getDecks, deckSlugOf } from '../../lib/slides';
|
|
5
|
-
|
|
6
|
-
export const getStaticPaths = (async () => {
|
|
7
|
-
const decks = await getDecks('en');
|
|
8
|
-
return decks.map((entry) => ({ params: { deck: deckSlugOf(entry) }, props: { entry } }));
|
|
9
|
-
}) satisfies GetStaticPaths;
|
|
10
|
-
|
|
11
|
-
const { entry } = Astro.props;
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
<DeckView entry={entry} lang="en" />
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
4
|
-
import SlidesIndex from '../../components/SlidesIndex.astro';
|
|
5
|
-
import { useTranslations } from '../../i18n/ui';
|
|
6
|
-
|
|
7
|
-
const t = useTranslations('en');
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
<BaseLayout title={`${t('slides.title')} — ${site.name}`} lang="en" path="slides/">
|
|
11
|
-
<SlidesIndex lang="en" />
|
|
12
|
-
</BaseLayout>
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import type { GetStaticPaths } from 'astro';
|
|
4
|
-
import { getRelativeLocaleUrl } from 'astro:i18n';
|
|
5
|
-
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
6
|
-
import StackDetail from '../../components/StackDetail.astro';
|
|
7
|
-
import { getStacks, getStackAliases, slugOf, type StackEntry } from '../../lib/stacks';
|
|
8
|
-
|
|
9
|
-
export const getStaticPaths = (async () => {
|
|
10
|
-
const entries = await getStacks('en');
|
|
11
|
-
const paths: Awaited<ReturnType<GetStaticPaths>> = entries.map((entry) => ({
|
|
12
|
-
params: { id: slugOf(entry) },
|
|
13
|
-
props: { entry, redirectTo: null },
|
|
14
|
-
}));
|
|
15
|
-
// Former-name aliases (e.g. /stack/roo-code/ → /stack/roomote/).
|
|
16
|
-
for (const { alias, target } of await getStackAliases('en')) {
|
|
17
|
-
paths.push({ params: { id: alias }, props: { entry: null, redirectTo: target } });
|
|
18
|
-
}
|
|
19
|
-
return paths;
|
|
20
|
-
}) satisfies GetStaticPaths;
|
|
21
|
-
|
|
22
|
-
const { entry, redirectTo } = Astro.props as { entry: StackEntry | null; redirectTo: string | null };
|
|
23
|
-
const target = redirectTo ? getRelativeLocaleUrl('en', `stack/${redirectTo}/`) : null;
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
target ? (
|
|
28
|
-
<html lang="en">
|
|
29
|
-
<head>
|
|
30
|
-
<meta charset="utf-8" />
|
|
31
|
-
<meta http-equiv="refresh" content={`0; url=${target}`} />
|
|
32
|
-
<link rel="canonical" href={target} />
|
|
33
|
-
<meta name="robots" content="noindex" />
|
|
34
|
-
<title>Redirecting…</title>
|
|
35
|
-
<script is:inline set:html={`location.replace(${JSON.stringify(target)})`} />
|
|
36
|
-
</head>
|
|
37
|
-
<body>
|
|
38
|
-
Redirecting to <a href={target}>{target}</a>…
|
|
39
|
-
</body>
|
|
40
|
-
</html>
|
|
41
|
-
) : (
|
|
42
|
-
<BaseLayout
|
|
43
|
-
title={`${entry!.data.name} — ${site.name}`}
|
|
44
|
-
description={entry!.data.description}
|
|
45
|
-
lang="en"
|
|
46
|
-
path={`stack/${slugOf(entry!)}/`}
|
|
47
|
-
>
|
|
48
|
-
<StackDetail entry={entry!} lang="en" />
|
|
49
|
-
</BaseLayout>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import type { GetStaticPaths } from 'astro';
|
|
4
|
-
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
5
|
-
import TagIndex from '../../components/TagIndex.astro';
|
|
6
|
-
import { getAllTags } from '../../lib/stacks';
|
|
7
|
-
|
|
8
|
-
export const getStaticPaths = (async () => {
|
|
9
|
-
const tags = await getAllTags('en');
|
|
10
|
-
return tags.map((tag) => ({ params: { tag }, props: { tag } }));
|
|
11
|
-
}) satisfies GetStaticPaths;
|
|
12
|
-
|
|
13
|
-
const { tag } = Astro.props;
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
<BaseLayout title={`#${tag} — ${site.name}`} lang="en" path={`tags/${tag}/`}>
|
|
17
|
-
<TagIndex lang="en" tag={tag} />
|
|
18
|
-
</BaseLayout>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
|
-
import type { GetStaticPaths } from 'astro';
|
|
4
|
-
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
5
|
-
import VendorIndex from '../../components/VendorIndex.astro';
|
|
6
|
-
import { getAllVendors } from '../../lib/stacks';
|
|
7
|
-
|
|
8
|
-
export const getStaticPaths = (async () => {
|
|
9
|
-
const vendors = await getAllVendors('en');
|
|
10
|
-
return vendors.map((vendor) => ({ params: { vendor }, props: { vendor } }));
|
|
11
|
-
}) satisfies GetStaticPaths;
|
|
12
|
-
|
|
13
|
-
const { vendor } = Astro.props;
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
<BaseLayout title={`${vendor} — ${site.name}`} lang="en" path={`vendors/${vendor}/`}>
|
|
17
|
-
<VendorIndex lang="en" vendor={vendor} />
|
|
18
|
-
</BaseLayout>
|