diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-07 19:41:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-07 19:41:11 +0100 |
| commit | e08094210c15ee0114ae4f11142aa5f89d81c7aa (patch) | |
| tree | bfa129cae6a2b981d5b6dc5c3cc16cfb2bc5c95a /src/pages | |
| parent | 925f6de56ef43013583a48dbc49a350ee84cdb3e (diff) | |
| parent | 2fcbccfbd49c6eaf433272749e32589a6f490200 (diff) | |
Merge branch 'master' into master
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/[locale]/furthsettins/index.astro | 28 | ||||
| -rw-r--r-- | src/pages/[locale]/furthsettins/lallans/[issueNumber].astro | 32 | ||||
| -rw-r--r-- | src/pages/[locale]/furthsettins/lallans/index.astro | 22 | ||||
| -rw-r--r-- | src/pages/[locale]/staticPaths.ts | 10 |
4 files changed, 92 insertions, 0 deletions
diff --git a/src/pages/[locale]/furthsettins/index.astro b/src/pages/[locale]/furthsettins/index.astro new file mode 100644 index 0000000..44fa92c --- /dev/null +++ b/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); +--- + +<Layout locale={locale} title={ t(tFurthsettins, 'title') }> + <main id="main"> + <h1>Furthsettins</h1> + + <ul class="publications-gallery"> + <li> + <a href="furthsettins/lallans" class="link"> + <img src="/public/images/furthsettins/lallans.png" class="publications-gallery__image" /> + <p class="publications-gallery__title">{ t(tSite, 'lallans') }</p> + </a> + </li> + </ul> + </main> +</Layout>
\ No newline at end of file diff --git a/src/pages/[locale]/furthsettins/lallans/[issueNumber].astro b/src/pages/[locale]/furthsettins/lallans/[issueNumber].astro new file mode 100644 index 0000000..baed564 --- /dev/null +++ b/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](); +--- + +<Layout locale={locale} title={ t(tFurthsettins, 'title') }> + <main id="main"> + <h1>{ t(tSite, 'lallans') } { issueNumber }</h1> + <p>{ issue.description[locale] }</p> + </main> +</Layout>
\ No newline at end of file diff --git a/src/pages/[locale]/furthsettins/lallans/index.astro b/src/pages/[locale]/furthsettins/lallans/index.astro new file mode 100644 index 0000000..dd5b50c --- /dev/null +++ b/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); +--- + +<Layout locale={locale} title={ t(tFurthsettins, 'title') }> + <main id="main"> + <h1>Lallans</h1> + + <LallansIssuesGallery /> + </main> +</Layout>
\ No newline at end of file diff --git a/src/pages/[locale]/staticPaths.ts b/src/pages/[locale]/staticPaths.ts new file mode 100644 index 0000000..8423851 --- /dev/null +++ b/src/pages/[locale]/staticPaths.ts @@ -0,0 +1,10 @@ +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 } }[] = [ + { params: { locale: 'sco' } }, + { params: { locale: 'en-GB' } }, +] + +export default staticPaths;
\ No newline at end of file |
