stack-site-builder 1.23.2 → 1.25.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 +106 -0
- package/README.md +17 -2
- package/index.d.ts +8 -0
- package/index.mjs +6 -2
- package/markdown.mjs +61 -6
- package/package.json +4 -1
- package/src/components/CardsHome.astro +2 -2
- package/src/components/DeckView.astro +2 -3
- package/src/components/Home.astro +2 -2
- package/src/i18n/ui.ts +63 -12
- package/src/layouts/BaseLayout.astro +18 -6
- package/src/lib/articles.ts +3 -2
- package/src/lib/concepts.ts +3 -2
- package/src/lib/courses.ts +3 -2
- package/src/lib/locales.ts +30 -0
- package/src/lib/pages.ts +3 -2
- package/src/lib/papers.ts +3 -2
- package/src/lib/products.ts +3 -2
- package/src/lib/slides.ts +3 -2
- package/src/lib/stacks.ts +3 -2
- package/src/pages/[...lang]/[page].astro +2 -2
- package/src/pages/[...lang]/article/[...id].astro +2 -2
- package/src/pages/[...lang]/article/category/[id].astro +2 -2
- package/src/pages/[...lang]/article/index.astro +2 -3
- package/src/pages/[...lang]/categories/[id].astro +2 -2
- package/src/pages/[...lang]/concept/[...id].astro +2 -2
- package/src/pages/[...lang]/concept/category/[id].astro +2 -2
- package/src/pages/[...lang]/concept/index.astro +2 -3
- package/src/pages/[...lang]/course/[...id].astro +2 -2
- package/src/pages/[...lang]/course/category/[id].astro +2 -2
- package/src/pages/[...lang]/course/index.astro +2 -3
- package/src/pages/[...lang]/glossary.astro +2 -3
- package/src/pages/[...lang]/index.astro +2 -2
- package/src/pages/[...lang]/paper/[...id].astro +2 -2
- package/src/pages/[...lang]/paper/category/[id].astro +2 -2
- package/src/pages/[...lang]/paper/index.astro +2 -3
- package/src/pages/[...lang]/products/[...id].astro +2 -2
- package/src/pages/[...lang]/products/index.astro +2 -3
- package/src/pages/[...lang]/rss.xml.ts +2 -3
- package/src/pages/[...lang]/sample/[folder].astro +2 -2
- package/src/pages/[...lang]/sample/index.astro +2 -3
- package/src/pages/[...lang]/slides/index.astro +2 -3
- package/src/pages/[...lang]/stack/[...id].astro +2 -2
- package/src/pages/[...lang]/tags/[tag].astro +2 -2
- package/src/pages/[...lang]/vendors/[vendor].astro +2 -2
- package/src/styles/global.css +40 -0
package/src/lib/locales.ts
CHANGED
|
@@ -14,3 +14,33 @@ export const allLocales = Object.keys(languages) as Lang[];
|
|
|
14
14
|
/** The `[...lang]` param for a locale: `undefined` for the default, else the code. */
|
|
15
15
|
export const langParam = (lang: Lang): string | undefined =>
|
|
16
16
|
lang === defaultLang ? undefined : lang;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Content-id helpers. Every collection is locale-partitioned by folder
|
|
20
|
+
* (`stacks/<code>/<slug>.mdx`), so an entry's id carries a `<code>/` prefix
|
|
21
|
+
* that listings filter on and slugs strip.
|
|
22
|
+
*
|
|
23
|
+
* Two details make the prefix worth deriving instead of hardcoding: Astro's
|
|
24
|
+
* glob loader runs every path segment through github-slugger, which
|
|
25
|
+
* LOWERCASES it, so a `zh-CN` folder yields the id `zh-cn/…`; and a locale
|
|
26
|
+
* code isn't necessarily two bare letters (`zh-CN`, `pt-BR`). Both are handled
|
|
27
|
+
* here once, so adding such a locale stays a site-config change.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/** The `<locale>/` prefix an entry id carries for `lang`. */
|
|
31
|
+
export const contentPrefix = (lang: Lang): string => `${lang.toLowerCase()}/`;
|
|
32
|
+
|
|
33
|
+
/** Whether a content id belongs to `lang`. */
|
|
34
|
+
export const inLocale = (id: string, lang: Lang): boolean => id.startsWith(contentPrefix(lang));
|
|
35
|
+
|
|
36
|
+
const escapeRe = (s: string): string => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
37
|
+
// Longest code first, so `zh` can't shadow `zh-cn` on a site shipping both.
|
|
38
|
+
const localePrefixRe = new RegExp(
|
|
39
|
+
`^(?:${allLocales
|
|
40
|
+
.map((l) => escapeRe(l.toLowerCase()))
|
|
41
|
+
.sort((a, b) => b.length - a.length)
|
|
42
|
+
.join('|')})/`,
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
/** An entry id with its `<locale>/` prefix removed — the basis of every slug. */
|
|
46
|
+
export const stripLocale = (id: string): string => id.replace(localePrefixRe, '');
|
package/src/lib/pages.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { getCollection, type CollectionEntry } from 'astro:content';
|
|
2
2
|
import type { Lang } from '../i18n/ui';
|
|
3
|
+
import { inLocale, stripLocale } from './locales';
|
|
3
4
|
|
|
4
5
|
export type PageEntry = CollectionEntry<'pages'>;
|
|
5
6
|
|
|
6
7
|
/** The url slug of a page, i.e. its id with the `<lang>/` prefix removed. */
|
|
7
8
|
export function pageSlugOf(entry: PageEntry): string {
|
|
8
|
-
return entry.id
|
|
9
|
+
return stripLocale(entry.id);
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
/** Standalone pages for one locale, in `order` (then title) order. */
|
|
12
13
|
export async function getPages(lang: Lang): Promise<PageEntry[]> {
|
|
13
14
|
const all = await getCollection('pages');
|
|
14
15
|
return all
|
|
15
|
-
.filter((e) => e.id
|
|
16
|
+
.filter((e) => inLocale(e.id, lang) && !e.data.draft)
|
|
16
17
|
.sort(
|
|
17
18
|
(a, b) => a.data.order - b.data.order || a.data.title.localeCompare(b.data.title),
|
|
18
19
|
);
|
package/src/lib/papers.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { getCollection, type CollectionEntry } from 'astro:content';
|
|
2
2
|
import type { Lang } from '../i18n/ui';
|
|
3
|
+
import { inLocale, stripLocale } from './locales';
|
|
3
4
|
|
|
4
5
|
export type PaperEntry = CollectionEntry<'papers'>;
|
|
5
6
|
|
|
6
7
|
/** The url slug of a paper, i.e. its id with the `<lang>/` prefix removed. */
|
|
7
8
|
export function paperSlugOf(entry: PaperEntry): string {
|
|
8
|
-
return entry.id
|
|
9
|
+
return stripLocale(entry.id);
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
/** Published papers for one locale — newest publication year first, then title. */
|
|
12
13
|
export async function getPapers(lang: Lang): Promise<PaperEntry[]> {
|
|
13
14
|
const all = await getCollection('papers');
|
|
14
15
|
return all
|
|
15
|
-
.filter((e) => e.id
|
|
16
|
+
.filter((e) => inLocale(e.id, lang) && !e.data.draft)
|
|
16
17
|
.sort(
|
|
17
18
|
(a, b) => (b.data.year ?? 0) - (a.data.year ?? 0) || a.data.title.localeCompare(b.data.title),
|
|
18
19
|
);
|
package/src/lib/products.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getCollection, type CollectionEntry } from 'astro:content';
|
|
2
2
|
import type { Lang } from '../i18n/ui';
|
|
3
|
+
import { inLocale, stripLocale } from './locales';
|
|
3
4
|
|
|
4
5
|
export type ProductEntry = CollectionEntry<'products'>;
|
|
5
6
|
|
|
@@ -7,14 +8,14 @@ export type ProductEntry = CollectionEntry<'products'>;
|
|
|
7
8
|
* nested (`flowstate-ai/privacy`), which the catch-all route renders at the
|
|
8
9
|
* matching subpath. */
|
|
9
10
|
export function productSlugOf(entry: ProductEntry): string {
|
|
10
|
-
return entry.id
|
|
11
|
+
return stripLocale(entry.id);
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
/** Published product pages for one locale, in `order` (then title) order. */
|
|
14
15
|
export async function getProducts(lang: Lang): Promise<ProductEntry[]> {
|
|
15
16
|
const all = await getCollection('products');
|
|
16
17
|
return all
|
|
17
|
-
.filter((e) => e.id
|
|
18
|
+
.filter((e) => inLocale(e.id, lang) && !e.data.draft)
|
|
18
19
|
.sort((a, b) => a.data.order - b.data.order || a.data.title.localeCompare(b.data.title));
|
|
19
20
|
}
|
|
20
21
|
|
package/src/lib/slides.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getCollection, type CollectionEntry } from 'astro:content';
|
|
2
2
|
import type { Lang } from '../i18n/ui';
|
|
3
|
+
import { inLocale, stripLocale } from './locales';
|
|
3
4
|
|
|
4
5
|
export type SlideDeck = CollectionEntry<'slides'>;
|
|
5
6
|
|
|
@@ -9,14 +10,14 @@ export type SlideDeck = CollectionEntry<'slides'>;
|
|
|
9
10
|
* deck co-locates images) shares the same `<name>` slug as a flat `<name>.mdx`.
|
|
10
11
|
*/
|
|
11
12
|
export function deckSlugOf(entry: SlideDeck): string {
|
|
12
|
-
return entry.id
|
|
13
|
+
return stripLocale(entry.id).replace(/\/index$/, '');
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
/** Published slide decks for one locale, by `order` then title. */
|
|
16
17
|
export async function getDecks(lang: Lang): Promise<SlideDeck[]> {
|
|
17
18
|
const all = await getCollection('slides');
|
|
18
19
|
return all
|
|
19
|
-
.filter((e) => e.id
|
|
20
|
+
.filter((e) => inLocale(e.id, lang) && !e.data.draft)
|
|
20
21
|
.sort(
|
|
21
22
|
(a, b) =>
|
|
22
23
|
(a.data.order ?? 999) - (b.data.order ?? 999) ||
|
package/src/lib/stacks.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { getCollection, type CollectionEntry } from 'astro:content';
|
|
2
2
|
import type { Lang } from '../i18n/ui';
|
|
3
3
|
import { descendantIds } from '@aas-data/categories';
|
|
4
|
+
import { inLocale, stripLocale } from './locales';
|
|
4
5
|
|
|
5
6
|
export type StackEntry = CollectionEntry<'stacks'>;
|
|
6
7
|
|
|
7
8
|
/** The url slug of an entry, i.e. its id with the `<lang>/` prefix removed. */
|
|
8
9
|
export function slugOf(entry: StackEntry): string {
|
|
9
|
-
return entry.id
|
|
10
|
+
return stripLocale(entry.id);
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
/** A name → url-safe slug, e.g. "Roo Code" → "roo-code". */
|
|
@@ -43,7 +44,7 @@ export async function getStackAliases(lang: Lang): Promise<{ alias: string; targ
|
|
|
43
44
|
/** All stack entries for one locale (entries live in `stacks/<lang>/*.mdx`). */
|
|
44
45
|
export async function getStacks(lang: Lang): Promise<StackEntry[]> {
|
|
45
46
|
const all = await getCollection('stacks');
|
|
46
|
-
return all.filter((e) => e.id
|
|
47
|
+
return all.filter((e) => inLocale(e.id, lang));
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
/** Unique, sorted list of tags used by entries in a locale. */
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
5
4
|
import PageDetail from '../../components/PageDetail.astro';
|
|
6
5
|
import PrivateGate from '../../components/PrivateGate.astro';
|
|
7
6
|
import { getPages, pageSlugOf } from '../../lib/pages';
|
|
8
7
|
import { allLocales, langParam } from '../../lib/locales';
|
|
8
|
+
import { siteName } from '../../i18n/ui';
|
|
9
9
|
|
|
10
10
|
export const getStaticPaths = (async () => {
|
|
11
11
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -23,7 +23,7 @@ const priv = entry.data.private;
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
<BaseLayout
|
|
26
|
-
title={`${entry.data.title} — ${
|
|
26
|
+
title={`${entry.data.title} — ${siteName(lang)}`}
|
|
27
27
|
description={priv ? entry.data.teaser : entry.data.description}
|
|
28
28
|
lang={lang}
|
|
29
29
|
path={`${slug}/`}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import ArticleDetail from '../../../components/ArticleDetail.astro';
|
|
6
5
|
import PrivateGate from '../../../components/PrivateGate.astro';
|
|
7
6
|
import { getArticles, articleSlugOf } from '../../../lib/articles';
|
|
8
7
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
|
+
import { siteName } from '../../../i18n/ui';
|
|
9
9
|
|
|
10
10
|
export const getStaticPaths = (async () => {
|
|
11
11
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -23,7 +23,7 @@ const priv = entry.data.private;
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
<BaseLayout
|
|
26
|
-
title={`${entry.data.title} — ${
|
|
26
|
+
title={`${entry.data.title} — ${siteName(lang)}`}
|
|
27
27
|
description={priv ? entry.data.teaser : entry.data.description}
|
|
28
28
|
lang={lang}
|
|
29
29
|
path={`article/${slug}/`}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
|
5
4
|
import BlogIndex from '../../../../components/BlogIndex.astro';
|
|
6
5
|
import { articleTree } from '@aas-data/article-categories';
|
|
7
6
|
import { allLocales, langParam } from '../../../../lib/locales';
|
|
7
|
+
import { siteName } from '../../../../i18n/ui';
|
|
8
8
|
|
|
9
9
|
export const getStaticPaths = (() => {
|
|
10
10
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -20,6 +20,6 @@ const { lang, id } = Astro.props as { lang: string; id: string };
|
|
|
20
20
|
const node = articleTree.map.get(id)!;
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
<BaseLayout title={`${node.label[lang]} — ${
|
|
23
|
+
<BaseLayout title={`${node.label[lang]} — ${siteName(lang)}`} lang={lang} path={`article/category/${id}/`}>
|
|
24
24
|
<BlogIndex lang={lang} categoryId={id} />
|
|
25
25
|
</BaseLayout>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import BlogIndex from '../../../components/BlogIndex.astro';
|
|
6
|
-
import { useTranslations } from '../../../i18n/ui';
|
|
5
|
+
import { useTranslations, siteName } from '../../../i18n/ui';
|
|
7
6
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
7
|
|
|
9
8
|
export const getStaticPaths = (() =>
|
|
@@ -13,6 +12,6 @@ const { lang } = Astro.props;
|
|
|
13
12
|
const t = useTranslations(lang);
|
|
14
13
|
---
|
|
15
14
|
|
|
16
|
-
<BaseLayout title={`${t('blog.title')} — ${
|
|
15
|
+
<BaseLayout title={`${t('blog.title')} — ${siteName(lang)}`} lang={lang} path="article/">
|
|
17
16
|
<BlogIndex lang={lang} />
|
|
18
17
|
</BaseLayout>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import CategoryIndex from '../../../components/CategoryIndex.astro';
|
|
6
5
|
import { allCategoryIds, categoryMap } from '@aas-data/categories';
|
|
7
6
|
import { getStacksByCategory } from '../../../lib/stacks';
|
|
8
7
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
|
+
import { siteName } from '../../../i18n/ui';
|
|
9
9
|
|
|
10
10
|
export const getStaticPaths = (async () => {
|
|
11
11
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -23,6 +23,6 @@ const { lang, id } = Astro.props;
|
|
|
23
23
|
const node = categoryMap.get(id)!;
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
-
<BaseLayout title={`${node.label[lang]} — ${
|
|
26
|
+
<BaseLayout title={`${node.label[lang]} — ${siteName(lang)}`} lang={lang} path={`categories/${id}/`}>
|
|
27
27
|
<CategoryIndex lang={lang} id={id} />
|
|
28
28
|
</BaseLayout>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import ConceptDetail from '../../../components/ConceptDetail.astro';
|
|
6
5
|
import PrivateGate from '../../../components/PrivateGate.astro';
|
|
7
6
|
import { getConcepts, conceptSlugOf } from '../../../lib/concepts';
|
|
8
7
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
|
+
import { siteName } from '../../../i18n/ui';
|
|
9
9
|
|
|
10
10
|
export const getStaticPaths = (async () => {
|
|
11
11
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -23,7 +23,7 @@ const priv = entry.data.private;
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
<BaseLayout
|
|
26
|
-
title={`${entry.data.title} — ${
|
|
26
|
+
title={`${entry.data.title} — ${siteName(lang)}`}
|
|
27
27
|
description={priv ? entry.data.teaser : entry.data.description}
|
|
28
28
|
lang={lang}
|
|
29
29
|
path={`concept/${slug}/`}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
|
5
4
|
import ConceptIndex from '../../../../components/ConceptIndex.astro';
|
|
6
5
|
import { conceptTree } from '@aas-data/concept-categories';
|
|
7
6
|
import { allLocales, langParam } from '../../../../lib/locales';
|
|
7
|
+
import { siteName } from '../../../../i18n/ui';
|
|
8
8
|
|
|
9
9
|
export const getStaticPaths = (() => {
|
|
10
10
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -20,6 +20,6 @@ const { lang, id } = Astro.props as { lang: string; id: string };
|
|
|
20
20
|
const node = conceptTree.map.get(id)!;
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
<BaseLayout title={`${node.label[lang]} — ${
|
|
23
|
+
<BaseLayout title={`${node.label[lang]} — ${siteName(lang)}`} lang={lang} path={`concept/category/${id}/`}>
|
|
24
24
|
<ConceptIndex lang={lang} categoryId={id} />
|
|
25
25
|
</BaseLayout>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import ConceptIndex from '../../../components/ConceptIndex.astro';
|
|
6
|
-
import { useTranslations } from '../../../i18n/ui';
|
|
5
|
+
import { useTranslations, siteName } from '../../../i18n/ui';
|
|
7
6
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
7
|
|
|
9
8
|
export const getStaticPaths = (() =>
|
|
@@ -13,6 +12,6 @@ const { lang } = Astro.props;
|
|
|
13
12
|
const t = useTranslations(lang);
|
|
14
13
|
---
|
|
15
14
|
|
|
16
|
-
<BaseLayout title={`${t('concept.title')} — ${
|
|
15
|
+
<BaseLayout title={`${t('concept.title')} — ${siteName(lang)}`} lang={lang} path="concept/">
|
|
17
16
|
<ConceptIndex lang={lang} />
|
|
18
17
|
</BaseLayout>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import CourseDetail from '../../../components/CourseDetail.astro';
|
|
6
5
|
import PrivateGate from '../../../components/PrivateGate.astro';
|
|
7
6
|
import { getCourses, courseSlugOf } from '../../../lib/courses';
|
|
8
7
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
|
+
import { siteName } from '../../../i18n/ui';
|
|
9
9
|
|
|
10
10
|
export const getStaticPaths = (async () => {
|
|
11
11
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -23,7 +23,7 @@ const priv = entry.data.private;
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
<BaseLayout
|
|
26
|
-
title={`${entry.data.title} — ${
|
|
26
|
+
title={`${entry.data.title} — ${siteName(lang)}`}
|
|
27
27
|
description={priv ? entry.data.teaser : entry.data.description}
|
|
28
28
|
lang={lang}
|
|
29
29
|
path={`course/${slug}/`}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
|
5
4
|
import CourseIndex from '../../../../components/CourseIndex.astro';
|
|
6
5
|
import { courseTree } from '@aas-data/course-categories';
|
|
7
6
|
import { allLocales, langParam } from '../../../../lib/locales';
|
|
7
|
+
import { siteName } from '../../../../i18n/ui';
|
|
8
8
|
|
|
9
9
|
export const getStaticPaths = (() => {
|
|
10
10
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -20,6 +20,6 @@ const { lang, id } = Astro.props as { lang: string; id: string };
|
|
|
20
20
|
const node = courseTree.map.get(id)!;
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
<BaseLayout title={`${node.label[lang]} — ${
|
|
23
|
+
<BaseLayout title={`${node.label[lang]} — ${siteName(lang)}`} lang={lang} path={`course/category/${id}/`}>
|
|
24
24
|
<CourseIndex lang={lang} categoryId={id} />
|
|
25
25
|
</BaseLayout>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import CourseIndex from '../../../components/CourseIndex.astro';
|
|
6
|
-
import { useTranslations } from '../../../i18n/ui';
|
|
5
|
+
import { useTranslations, siteName } from '../../../i18n/ui';
|
|
7
6
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
7
|
|
|
9
8
|
export const getStaticPaths = (() =>
|
|
@@ -13,6 +12,6 @@ const { lang } = Astro.props;
|
|
|
13
12
|
const t = useTranslations(lang);
|
|
14
13
|
---
|
|
15
14
|
|
|
16
|
-
<BaseLayout title={`${t('course.title')} — ${
|
|
15
|
+
<BaseLayout title={`${t('course.title')} — ${siteName(lang)}`} lang={lang} path="course/">
|
|
17
16
|
<CourseIndex lang={lang} />
|
|
18
17
|
</BaseLayout>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
5
4
|
import Glossary from '../../components/Glossary.astro';
|
|
6
|
-
import { useTranslations } from '../../i18n/ui';
|
|
5
|
+
import { useTranslations, siteName } from '../../i18n/ui';
|
|
7
6
|
import { allLocales, langParam } from '../../lib/locales';
|
|
8
7
|
|
|
9
8
|
export const getStaticPaths = (() =>
|
|
@@ -13,6 +12,6 @@ const { lang } = Astro.props;
|
|
|
13
12
|
const t = useTranslations(lang);
|
|
14
13
|
---
|
|
15
14
|
|
|
16
|
-
<BaseLayout title={`${t('glossary.title')} — ${
|
|
15
|
+
<BaseLayout title={`${t('glossary.title')} — ${siteName(lang)}`} lang={lang} path="glossary/">
|
|
17
16
|
<Glossary lang={lang} />
|
|
18
17
|
</BaseLayout>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
5
4
|
import Home from '../../components/Home.astro';
|
|
6
5
|
import CardsHome from '../../components/CardsHome.astro';
|
|
7
6
|
import { homeTemplate } from '../../lib/home';
|
|
8
7
|
import { allLocales, langParam } from '../../lib/locales';
|
|
8
|
+
import { siteName } from '../../i18n/ui';
|
|
9
9
|
|
|
10
10
|
export const getStaticPaths = (() =>
|
|
11
11
|
allLocales.map((lang) => ({ params: { lang: langParam(lang) }, props: { lang } }))) satisfies GetStaticPaths;
|
|
@@ -13,6 +13,6 @@ export const getStaticPaths = (() =>
|
|
|
13
13
|
const { lang } = Astro.props;
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
<BaseLayout title={
|
|
16
|
+
<BaseLayout title={siteName(lang)} lang={lang} path="">
|
|
17
17
|
{homeTemplate === 'cards' ? <CardsHome lang={lang} /> : <Home lang={lang} />}
|
|
18
18
|
</BaseLayout>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import PaperDetail from '../../../components/PaperDetail.astro';
|
|
6
5
|
import PrivateGate from '../../../components/PrivateGate.astro';
|
|
7
6
|
import { getPapers, paperSlugOf } from '../../../lib/papers';
|
|
8
7
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
|
+
import { siteName } from '../../../i18n/ui';
|
|
9
9
|
|
|
10
10
|
export const getStaticPaths = (async () => {
|
|
11
11
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -23,7 +23,7 @@ const priv = entry.data.private;
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
<BaseLayout
|
|
26
|
-
title={`${entry.data.title} — ${
|
|
26
|
+
title={`${entry.data.title} — ${siteName(lang)}`}
|
|
27
27
|
description={priv ? entry.data.teaser : entry.data.description}
|
|
28
28
|
lang={lang}
|
|
29
29
|
path={`paper/${slug}/`}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../../layouts/BaseLayout.astro';
|
|
5
4
|
import PapersIndex from '../../../../components/PapersIndex.astro';
|
|
6
5
|
import { paperTree } from '@aas-data/paper-categories';
|
|
7
6
|
import { allLocales, langParam } from '../../../../lib/locales';
|
|
7
|
+
import { siteName } from '../../../../i18n/ui';
|
|
8
8
|
|
|
9
9
|
export const getStaticPaths = (() => {
|
|
10
10
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -20,6 +20,6 @@ const { lang, id } = Astro.props as { lang: string; id: string };
|
|
|
20
20
|
const node = paperTree.map.get(id)!;
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
<BaseLayout title={`${node.label[lang]} — ${
|
|
23
|
+
<BaseLayout title={`${node.label[lang]} — ${siteName(lang)}`} lang={lang} path={`paper/category/${id}/`}>
|
|
24
24
|
<PapersIndex lang={lang} categoryId={id} />
|
|
25
25
|
</BaseLayout>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import PapersIndex from '../../../components/PapersIndex.astro';
|
|
6
|
-
import { useTranslations } from '../../../i18n/ui';
|
|
5
|
+
import { useTranslations, siteName } from '../../../i18n/ui';
|
|
7
6
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
7
|
|
|
9
8
|
export const getStaticPaths = (() =>
|
|
@@ -13,6 +12,6 @@ const { lang } = Astro.props;
|
|
|
13
12
|
const t = useTranslations(lang);
|
|
14
13
|
---
|
|
15
14
|
|
|
16
|
-
<BaseLayout title={`${t('paper.title')} — ${
|
|
15
|
+
<BaseLayout title={`${t('paper.title')} — ${siteName(lang)}`} lang={lang} path="paper/">
|
|
17
16
|
<PapersIndex lang={lang} />
|
|
18
17
|
</BaseLayout>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import { render } from 'astro:content';
|
|
4
3
|
import type { GetStaticPaths } from 'astro';
|
|
5
4
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
@@ -10,6 +9,7 @@ import MermaidLoader from '../../../components/MermaidLoader.astro';
|
|
|
10
9
|
import { getProducts, productSlugOf } from '../../../lib/products';
|
|
11
10
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
12
11
|
import { inlineMd } from '../../../lib/inline-md';
|
|
12
|
+
import { siteName } from '../../../i18n/ui';
|
|
13
13
|
|
|
14
14
|
export const getStaticPaths = (async () => {
|
|
15
15
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -32,7 +32,7 @@ const bodyHasMermaid = (entry.body ?? '').includes('```mermaid');
|
|
|
32
32
|
---
|
|
33
33
|
|
|
34
34
|
<BaseLayout
|
|
35
|
-
title={`${entry.data.title} — ${
|
|
35
|
+
title={`${entry.data.title} — ${siteName(lang)}`}
|
|
36
36
|
description={priv ? entry.data.teaser : (entry.data.description ?? entry.data.subtitle)}
|
|
37
37
|
lang={lang}
|
|
38
38
|
path={`products/${slug}/`}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import ProductsIndex from '../../../components/ProductsIndex.astro';
|
|
6
|
-
import { useTranslations } from '../../../i18n/ui';
|
|
5
|
+
import { useTranslations, siteName } from '../../../i18n/ui';
|
|
7
6
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
7
|
|
|
9
8
|
export const getStaticPaths = (() =>
|
|
@@ -13,6 +12,6 @@ const { lang } = Astro.props;
|
|
|
13
12
|
const t = useTranslations(lang);
|
|
14
13
|
---
|
|
15
14
|
|
|
16
|
-
<BaseLayout title={`${t('products.title')} — ${
|
|
15
|
+
<BaseLayout title={`${t('products.title')} — ${siteName(lang)}`} lang={lang} path="products/">
|
|
17
16
|
<ProductsIndex lang={lang} />
|
|
18
17
|
</BaseLayout>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import rss from '@astrojs/rss';
|
|
2
2
|
import type { APIContext, GetStaticPaths } from 'astro';
|
|
3
3
|
import { getRelativeLocaleUrl } from 'astro:i18n';
|
|
4
|
-
import { site } from '@aas-data/site';
|
|
5
4
|
import { getArticles, articleSlugOf } from '../../lib/articles';
|
|
6
5
|
import { allLocales, langParam } from '../../lib/locales';
|
|
7
|
-
import { useTranslations } from '../../i18n/ui';
|
|
6
|
+
import { useTranslations, siteName } from '../../i18n/ui';
|
|
8
7
|
|
|
9
8
|
// Per-locale RSS feed of the articles collection: /rss.xml (default locale)
|
|
10
9
|
// and /<code>/rss.xml. Injected with the `articles` section, so a site that
|
|
@@ -25,7 +24,7 @@ export async function GET(context: APIContext) {
|
|
|
25
24
|
// mirroring the sitemap's private-page filter.
|
|
26
25
|
const articles = (await getArticles(lang)).filter((a) => !a.data.private);
|
|
27
26
|
return rss({
|
|
28
|
-
title: `${
|
|
27
|
+
title: `${siteName(lang)} — ${t('blog.title')}`,
|
|
29
28
|
description: t('blog.tagline'),
|
|
30
29
|
site: context.site,
|
|
31
30
|
customData: `<language>${lang}</language>`,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import SamplePage from '../../../components/SamplePage.astro';
|
|
6
5
|
import { listSampleFolders } from '../../../lib/project';
|
|
7
6
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
7
|
+
import { siteName } from '../../../i18n/ui';
|
|
8
8
|
|
|
9
9
|
export const getStaticPaths = (() => {
|
|
10
10
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -20,6 +20,6 @@ export const getStaticPaths = (() => {
|
|
|
20
20
|
const { lang, folder } = Astro.props;
|
|
21
21
|
---
|
|
22
22
|
|
|
23
|
-
<BaseLayout title={`samples/${folder} — ${
|
|
23
|
+
<BaseLayout title={`samples/${folder} — ${siteName(lang)}`} lang={lang} path={`sample/${folder}/`}>
|
|
24
24
|
<SamplePage lang={lang} folder={folder} />
|
|
25
25
|
</BaseLayout>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import SampleIndex from '../../../components/SampleIndex.astro';
|
|
6
|
-
import { useTranslations } from '../../../i18n/ui';
|
|
5
|
+
import { useTranslations, siteName } from '../../../i18n/ui';
|
|
7
6
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
7
|
|
|
9
8
|
export const getStaticPaths = (() =>
|
|
@@ -13,6 +12,6 @@ const { lang } = Astro.props;
|
|
|
13
12
|
const t = useTranslations(lang);
|
|
14
13
|
---
|
|
15
14
|
|
|
16
|
-
<BaseLayout title={`${t('sample.title')} — ${
|
|
15
|
+
<BaseLayout title={`${t('sample.title')} — ${siteName(lang)}`} lang={lang} path="sample/">
|
|
17
16
|
<SampleIndex lang={lang} />
|
|
18
17
|
</BaseLayout>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
4
|
import SlidesIndex from '../../../components/SlidesIndex.astro';
|
|
6
|
-
import { useTranslations } from '../../../i18n/ui';
|
|
5
|
+
import { useTranslations, siteName } from '../../../i18n/ui';
|
|
7
6
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
7
|
|
|
9
8
|
export const getStaticPaths = (() =>
|
|
@@ -13,6 +12,6 @@ const { lang } = Astro.props;
|
|
|
13
12
|
const t = useTranslations(lang);
|
|
14
13
|
---
|
|
15
14
|
|
|
16
|
-
<BaseLayout title={`${t('slides.title')} — ${
|
|
15
|
+
<BaseLayout title={`${t('slides.title')} — ${siteName(lang)}`} lang={lang} path="slides/">
|
|
17
16
|
<SlidesIndex lang={lang} />
|
|
18
17
|
</BaseLayout>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { site } from '@aas-data/site';
|
|
3
2
|
import type { GetStaticPaths } from 'astro';
|
|
4
3
|
import { getRelativeLocaleUrl } from 'astro:i18n';
|
|
5
4
|
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
@@ -7,6 +6,7 @@ import StackDetail from '../../../components/StackDetail.astro';
|
|
|
7
6
|
import PrivateGate from '../../../components/PrivateGate.astro';
|
|
8
7
|
import { getStacks, getStackAliases, slugOf, type StackEntry } from '../../../lib/stacks';
|
|
9
8
|
import { allLocales, langParam } from '../../../lib/locales';
|
|
9
|
+
import { siteName } from '../../../i18n/ui';
|
|
10
10
|
|
|
11
11
|
export const getStaticPaths = (async () => {
|
|
12
12
|
const paths: Awaited<ReturnType<GetStaticPaths>> = [];
|
|
@@ -49,7 +49,7 @@ const priv = entry?.data.private ?? false;
|
|
|
49
49
|
</html>
|
|
50
50
|
) : (
|
|
51
51
|
<BaseLayout
|
|
52
|
-
title={`${entry!.data.name} — ${
|
|
52
|
+
title={`${entry!.data.name} — ${siteName(lang)}`}
|
|
53
53
|
description={priv ? entry!.data.teaser : entry!.data.description}
|
|
54
54
|
lang={lang}
|
|
55
55
|
path={`stack/${slugOf(entry!)}/`}
|