stack-site-builder 1.17.5 → 1.19.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 +38 -0
- package/README.md +17 -5
- package/index.d.ts +1 -0
- package/index.mjs +12 -1
- package/package.json +1 -1
- package/src/components/BlogIndex.astro +2 -1
- package/src/components/CategoryIndex.astro +9 -3
- package/src/components/ConceptIndex.astro +2 -1
- package/src/components/CourseIndex.astro +2 -1
- package/src/components/Home.astro +2 -1
- package/src/components/PaperCard.astro +85 -0
- package/src/components/PaperDetail.astro +123 -0
- package/src/components/PapersIndex.astro +144 -0
- package/src/components/ProductsIndex.astro +2 -1
- package/src/components/RelatedPapers.astro +59 -0
- package/src/components/SlidesIndex.astro +2 -1
- package/src/components/TagIndex.astro +2 -1
- package/src/components/VendorIndex.astro +2 -1
- package/src/content.ts +87 -1
- package/src/i18n/ui.ts +26 -0
- package/src/layouts/BaseLayout.astro +117 -6
- package/src/lib/listing.ts +9 -0
- package/src/lib/papers.ts +25 -0
- package/src/lib/private-client.ts +45 -1
- package/src/lib/sections.ts +2 -0
- package/src/pages/[...lang]/paper/[...id].astro +35 -0
- package/src/pages/[...lang]/paper/category/[id].astro +25 -0
- package/src/pages/[...lang]/paper/index.astro +18 -0
- package/src/pages/aas-auth.json.ts +22 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { site } from '@aas-data/site';
|
|
3
|
+
import type { GetStaticPaths } from 'astro';
|
|
4
|
+
import BaseLayout from '../../../layouts/BaseLayout.astro';
|
|
5
|
+
import PapersIndex from '../../../components/PapersIndex.astro';
|
|
6
|
+
import { useTranslations } from '../../../i18n/ui';
|
|
7
|
+
import { allLocales, langParam } from '../../../lib/locales';
|
|
8
|
+
|
|
9
|
+
export const getStaticPaths = (() =>
|
|
10
|
+
allLocales.map((lang) => ({ params: { lang: langParam(lang) }, props: { lang } }))) satisfies GetStaticPaths;
|
|
11
|
+
|
|
12
|
+
const { lang } = Astro.props;
|
|
13
|
+
const t = useTranslations(lang);
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<BaseLayout title={`${t('paper.title')} — ${site.name}`} lang={lang} path="paper/">
|
|
17
|
+
<PapersIndex lang={lang} />
|
|
18
|
+
</BaseLayout>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { APIRoute } from 'astro';
|
|
2
|
+
import { privateClientData } from '../lib/private';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The site's login user table (salted id hashes + per-user wrapped keys —
|
|
6
|
+
* the same data every private page already embeds in its gate payload, so
|
|
7
|
+
* this exposes nothing new). Powers the header login control on sites with
|
|
8
|
+
* private content; sites without the AAS_PRIVATE_* env render
|
|
9
|
+
* `{ enabled: false }` and the control stays hidden.
|
|
10
|
+
*/
|
|
11
|
+
export const GET: APIRoute = () => {
|
|
12
|
+
try {
|
|
13
|
+
const data = privateClientData();
|
|
14
|
+
return new Response(JSON.stringify({ enabled: true, ...data }), {
|
|
15
|
+
headers: { 'Content-Type': 'application/json' },
|
|
16
|
+
});
|
|
17
|
+
} catch {
|
|
18
|
+
return new Response(JSON.stringify({ enabled: false }), {
|
|
19
|
+
headers: { 'Content-Type': 'application/json' },
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|