From e56bbfb51f04c351108c89078c627937ebca7bef Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Sun, 13 Oct 2024 17:33:23 +0100 Subject: Refactors About and Contact pages --- src/pages/[locale]/contact.astro | 25 ++++++++++++++++ .../[locale]/furthsettins/lallans/index.astro | 2 +- src/pages/[locale]/index.astro | 35 ---------------------- src/pages/[locale]/submit.astro | 21 +++++++++++++ 4 files changed, 47 insertions(+), 36 deletions(-) create mode 100644 src/pages/[locale]/contact.astro create mode 100644 src/pages/[locale]/submit.astro (limited to 'src/pages') diff --git a/src/pages/[locale]/contact.astro b/src/pages/[locale]/contact.astro new file mode 100644 index 0000000..c5ee07b --- /dev/null +++ b/src/pages/[locale]/contact.astro @@ -0,0 +1,25 @@ +--- +import Page from '$layouts/Page.astro'; +import localeStaticPaths from '$lib/localeStaticPaths'; +import translate from '$i18n/translate'; +import tPage from '$i18n/translations/pages/contact'; +import type Locale from '$types/Locale'; +import contactDetails from '$data/contactDetails'; + +export async function getStaticPaths() { + return localeStaticPaths; +} + +const locale = Astro.params.locale as Locale; +const t = translate(locale); +--- + + +
+

{t(tPage, { key: 'title' })}

+ + {contactDetails.generalEnquiries.emailAddress} + +
')} /> +
+
diff --git a/src/pages/[locale]/furthsettins/lallans/index.astro b/src/pages/[locale]/furthsettins/lallans/index.astro index 61f31ec..a4b6d70 100644 --- a/src/pages/[locale]/furthsettins/lallans/index.astro +++ b/src/pages/[locale]/furthsettins/lallans/index.astro @@ -17,7 +17,7 @@ const t = translate(locale);

{t(tPage, { key: 'title' })}

-

{t(tPage, { key: 'about-lallans' })}

+

diff --git a/src/pages/[locale]/index.astro b/src/pages/[locale]/index.astro index 9f994a2..796bf59 100644 --- a/src/pages/[locale]/index.astro +++ b/src/pages/[locale]/index.astro @@ -4,9 +4,6 @@ import localeStaticPaths from '$lib/localeStaticPaths'; import translate from '$i18n/translate'; import tPage from '$i18n/translations/pages/home'; import type Locale from '$types/Locale'; -import { getMostRecentNewsItem } from '$lib/newsUtils'; -import contactDetails from '$data/contactDetails'; -import NewsIndex from '$components/NewsIndex/NewsIndex.astro'; import Button from '$components/Button.astro'; import CommitteeList from '$components/CommitteeList/CommitteeList.astro'; @@ -16,33 +13,9 @@ export async function getStaticPaths() { const locale = Astro.params.locale as Locale; const t = translate(locale); -const mostRecentNewsItem = await getMostRecentNewsItem(locale); --- - -
-

- - { - mostRecentNewsItem && ( - - ) - } -

-

@@ -59,12 +32,4 @@ const mostRecentNewsItem = await getMostRecentNewsItem(locale); {t(tPage, { key: 'aw-furthsettins' })} ▶

- -
-

- - {contactDetails.generalEnquiries.emailAddress} - -
')} /> -

diff --git a/src/pages/[locale]/submit.astro b/src/pages/[locale]/submit.astro new file mode 100644 index 0000000..599b9b6 --- /dev/null +++ b/src/pages/[locale]/submit.astro @@ -0,0 +1,21 @@ +--- +import Page from '$layouts/Page.astro'; +import localeStaticPaths from '$lib/localeStaticPaths'; +import translate from '$i18n/translate'; +import tPage from '$i18n/translations/pages/submit'; +import type Locale from '$types/Locale'; + +export async function getStaticPaths() { + return localeStaticPaths; +} + +const locale = Astro.params.locale as Locale; +const t = translate(locale); +--- + + +
+

+

+

+
-- cgit v1.2.3