From d494739e4823424bb54d81e21b57e4725544eb07 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Fri, 4 Aug 2023 21:12:12 +0100 Subject: WIP tidy up later --- .../src/pages/[locale]/furthsettins/index.astro | 28 +++++++++++++++++++ .../furthsettins/lallans/[issueNumber].astro | 32 ++++++++++++++++++++++ .../[locale]/furthsettins/lallans/index.astro | 22 +++++++++++++++ frontend/src/pages/[locale]/staticPaths.ts | 2 +- 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 frontend/src/pages/[locale]/furthsettins/index.astro create mode 100644 frontend/src/pages/[locale]/furthsettins/lallans/[issueNumber].astro create mode 100644 frontend/src/pages/[locale]/furthsettins/lallans/index.astro (limited to 'frontend/src/pages') diff --git a/frontend/src/pages/[locale]/furthsettins/index.astro b/frontend/src/pages/[locale]/furthsettins/index.astro new file mode 100644 index 0000000..44fa92c --- /dev/null +++ b/frontend/src/pages/[locale]/furthsettins/index.astro @@ -0,0 +1,28 @@ +--- +import Layout from '../../../layouts/Layout.astro'; +import staticPaths from '../staticPaths'; +import translate from '../../../i18n/translate'; +import tFurthsettins from '../../../i18n/translations/pages/furthsettins'; +import tSite from '../../../i18n/translations/site'; +import type Locale from '../../../types/Locale'; + +export async function getStaticPaths() { return staticPaths; } + +const locale = Astro.params.locale as Locale; +const t = translate(locale); +--- + + +
+

Furthsettins

+ + +
+
\ No newline at end of file diff --git a/frontend/src/pages/[locale]/furthsettins/lallans/[issueNumber].astro b/frontend/src/pages/[locale]/furthsettins/lallans/[issueNumber].astro new file mode 100644 index 0000000..baed564 --- /dev/null +++ b/frontend/src/pages/[locale]/furthsettins/lallans/[issueNumber].astro @@ -0,0 +1,32 @@ +--- +import Layout from '../../../../layouts/Layout.astro'; +import localeStaticPaths from '../../staticPaths'; +import translate from '../../../../i18n/translate'; +import tFurthsettins from '../../../../i18n/translations/pages/furthsettins'; +import tSite from '../../../../i18n/translations/site'; +import type Locale from '../../../../types/Locale'; +import LallansIssuesGallery from '../../../../components/LallansIssuesGallery.astro'; +import { getLallansIssue } from '../../../../data/lallans'; +import type LallansIssueNumber from '../../../../types/LallansIssueNumber'; + +export async function getStaticPaths() { + const lallansIssueNumbers = Object.keys(getLallansIssue) as `${LallansIssueNumber}`[]; + return lallansIssueNumbers.flatMap(n => ( + localeStaticPaths.map(p => ( + { ...p, params: { ...p.params, issueNumber: n } } + )) + )); +} + +const locale = Astro.params.locale as Locale; +const t = translate(locale); +const issueNumber = new Number(Astro.params.issueNumber).valueOf() as LallansIssueNumber; +const issue = await getLallansIssue[issueNumber](); +--- + + +
+

{ t(tSite, 'lallans') } { issueNumber }

+

{ issue.description[locale] }

+
+
\ No newline at end of file diff --git a/frontend/src/pages/[locale]/furthsettins/lallans/index.astro b/frontend/src/pages/[locale]/furthsettins/lallans/index.astro new file mode 100644 index 0000000..dd5b50c --- /dev/null +++ b/frontend/src/pages/[locale]/furthsettins/lallans/index.astro @@ -0,0 +1,22 @@ +--- +import Layout from '../../../../layouts/Layout.astro'; +import staticPaths from '../../staticPaths'; +import translate from '../../../../i18n/translate'; +import tFurthsettins from '../../../../i18n/translations/pages/furthsettins'; +import tSite from '../../../../i18n/translations/site'; +import type Locale from '../../../../types/Locale'; +import LallansIssuesGallery from '../../../../components/LallansIssuesGallery.astro'; + +export async function getStaticPaths() { return staticPaths; } + +const locale = Astro.params.locale as Locale; +const t = translate(locale); +--- + + +
+

Lallans

+ + +
+
\ No newline at end of file diff --git a/frontend/src/pages/[locale]/staticPaths.ts b/frontend/src/pages/[locale]/staticPaths.ts index 266ad2c..8423851 100644 --- a/frontend/src/pages/[locale]/staticPaths.ts +++ b/frontend/src/pages/[locale]/staticPaths.ts @@ -2,7 +2,7 @@ import type Locale from '../../types/Locale'; // Defines what values to insert into the [locale] URL path parameter // when generating a static site -const staticPaths: { params: { locale: Locale} }[] = [ +const staticPaths: { params: { locale: Locale } }[] = [ { params: { locale: 'sco' } }, { params: { locale: 'en-GB' } }, ] -- cgit v1.2.3