summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoe Carstairs <me@joeac.net>2024-10-13 17:33:23 +0100
committerJoe Carstairs <me@joeac.net>2024-10-13 17:37:01 +0100
commite56bbfb51f04c351108c89078c627937ebca7bef (patch)
treea20a08ef587edff15d59f126aaa87ebb4e0753ad /src
parentea64fd05f7f5ac4d053e6dc8dc544585981f19e9 (diff)
Refactors About and Contact pages
Diffstat (limited to 'src')
-rw-r--r--src/components/Navbar/NavLinks.astro7
-rw-r--r--src/i18n/translations/pages/contact.ts11
-rw-r--r--src/i18n/translations/pages/home.ts54
-rw-r--r--src/i18n/translations/pages/jyne.ts4
-rw-r--r--src/i18n/translations/pages/lallansGallery.ts4
-rw-r--r--src/i18n/translations/pages/submit.ts49
-rw-r--r--src/pages/[locale]/contact.astro25
-rw-r--r--src/pages/[locale]/furthsettins/lallans/index.astro2
-rw-r--r--src/pages/[locale]/index.astro35
-rw-r--r--src/pages/[locale]/submit.astro21
10 files changed, 116 insertions, 96 deletions
diff --git a/src/components/Navbar/NavLinks.astro b/src/components/Navbar/NavLinks.astro
index 36c7f6f..2343a42 100644
--- a/src/components/Navbar/NavLinks.astro
+++ b/src/components/Navbar/NavLinks.astro
@@ -1,10 +1,11 @@
---
import { getLocaleFromPathOrDefault } from '$lib/getLocaleFromPath';
import translate from '$i18n/translate';
+import tContact from '$i18n/translations/pages/contact';
import tNews from '$i18n/translations/pages/news';
import tFurthsettins from '$i18n/translations/pages/furthsettins';
-import tHame from '$i18n/translations/pages/home';
import tJyne from '$i18n/translations/pages/jyne';
+import tSubmit from '$i18n/translations/pages/submit';
const locale = getLocaleFromPathOrDefault(Astro.url.pathname);
const t = translate(locale);
@@ -15,7 +16,7 @@ const t = translate(locale);
<a class="btn" href={`/${locale}/news`}>{t(tNews, { key: 'title' })}</a>
</li>
<li>
- <a class="btn" href={`/${locale}/#about`}>{t(tHame, { key: 'about-us' })}</a>
+ <a class="btn" href={`/${locale}/submit`}>{t(tSubmit, { key: 'title' })}</a>
</li>
<li>
<a class="btn" href={`/${locale}/furthsettins`}>{t(tFurthsettins, { key: 'title' })}</a>
@@ -24,6 +25,6 @@ const t = translate(locale);
<a class="btn" href={`/${locale}/jyne`}>{t(tJyne, { key: 'title' })}</a>
</li>
<li>
- <a class="btn" href={`/${locale}/#contact`}>{t(tHame, { key: 'contact' })}</a>
+ <a class="btn" href={`/${locale}/contact`}>{t(tContact, { key: 'title' })}</a>
</li>
</ul>
diff --git a/src/i18n/translations/pages/contact.ts b/src/i18n/translations/pages/contact.ts
new file mode 100644
index 0000000..0599477
--- /dev/null
+++ b/src/i18n/translations/pages/contact.ts
@@ -0,0 +1,11 @@
+import type { TranslationsDictionary } from '$types/TranslationsDictionary';
+
+const tPage = {
+ title: {
+ sco: () => 'Contact',
+ 'en-GB': () => 'Contact',
+ },
+};
+
+type Raw = typeof tPage;
+export default tPage as TranslationsDictionary<Raw>;
diff --git a/src/i18n/translations/pages/home.ts b/src/i18n/translations/pages/home.ts
index 7e1a3bd..1189904 100644
--- a/src/i18n/translations/pages/home.ts
+++ b/src/i18n/translations/pages/home.ts
@@ -5,54 +5,6 @@ const tPage = {
sco: () => 'Hame',
'en-GB': () => 'Home',
},
- submit: {
- sco: () => 'Lallans 105 apen for sub\u00admeissions',
- 'en-GB': () => 'Lallans 105 open for sub\u00admissions',
- },
- 'submit-para-1': {
- sco: () => `
- We ar acceptin submeissions til Lallans 105.
- `,
- 'en-GB': () => `
- We are accepting submissions to Lallans 105.
- `,
- },
- 'submit-para-2': {
- sco: () => `
- Send us your cuttie tales, poesie and drama til
- <a href="mailto:lallans@hotmail.co.uk">lallans@hotmail.co.uk</a>.
- `,
- 'en-GB': () => `
- Send us your short stories, poetry and drama to
- <a href="mailto:lallans@hotmail.co.uk">lallans@hotmail.co.uk</a>.
- `,
- },
- 'submit-para-3': {
- sco: () => `
- We luik forrit tae haein your submeission, whither you’ve been submittin
- for years or you’re a first-time writer!
- `,
- 'en-GB': () => `
- We look forward to having your submission, whether you’ve been
- submitting for years or you’re a first-time writer!
- `,
- },
- 'sangschaw-closed': {
- sco: () => `
- This year’s Sangschaw competeition closed on the 31st o Januar 2024.
- `,
- 'en-GB': () => `
- This year’s Sangschaw competition closed on the 31st of January 2024.
- `,
- },
- news: {
- sco: () => 'Recent News',
- 'en-GB': () => 'Recent News',
- },
- 'aw-news': {
- sco: () => 'Aw news',
- 'en-GB': () => 'All news',
- },
'about-us': {
sco: () => 'Aboot us',
'en-GB': () => 'About us',
@@ -84,7 +36,7 @@ const tPage = {
`,
},
'about-us-para-3': {
- sco: () => `
+ sco: () => `
Mairfortaken, we hae annual Collogues, whaur we ingaither oor memmers
an hear talks on Scots-leid cultur an hear Sangschaw winners readin
their nain wark.
@@ -121,10 +73,6 @@ const tPage = {
sco: () => 'Aw furthsettins',
'en-GB': () => 'All publications',
},
- contact: {
- sco: () => 'Contact',
- 'en-GB': () => 'Contact',
- },
};
type Raw = typeof tPage;
diff --git a/src/i18n/translations/pages/jyne.ts b/src/i18n/translations/pages/jyne.ts
index d25db56..2ec8811 100644
--- a/src/i18n/translations/pages/jyne.ts
+++ b/src/i18n/translations/pages/jyne.ts
@@ -147,13 +147,13 @@ const tPage = {
'en-GB': () => 'Bank transfer',
},
'hou-pey-by-bank-transfer-para': {
- sco: ({ emailAddress }: { emailAddress: string }) => `
+ sco: () => `
To pay by bank transfer, please send £20 to the following bank details,
and include your name and the word 'STENT' in the reference. You may
need to shorten your name to fit in the reference. For example, 'J BLOGGS
STENT'.
`,
- 'en-GB': ({ emailAddress }: { emailAddress: string }) => `
+ 'en-GB': () => `
For tae pey by bank transfer, pleise send £20 til the follaein bank
details, and include your name and the wird 'STENT' in the reference. You
micht hae tae shorten your name for tae fit it intil the reference. For
diff --git a/src/i18n/translations/pages/lallansGallery.ts b/src/i18n/translations/pages/lallansGallery.ts
index a6be372..7979585 100644
--- a/src/i18n/translations/pages/lallansGallery.ts
+++ b/src/i18n/translations/pages/lallansGallery.ts
@@ -10,13 +10,13 @@ const tPage = {
Lallans is the foremaist leiterar journal dedicatit til new Scots-leid leiteratur.
We hae furthset it syne 1972 an pit two issues furth per year. We accep Scots
frae aw airts an in aw styles an dialects. Ye can finnd oot hoo tae submit til
- Lallans on the hame page.
+ Lallans on the <a href="/sco/submit">Submit</a> page.
`,
'en-GB': () => `
Lallans is the leading literary journal dedicated to new Scots-language
literature. We have published it since 1972 and publish biannually. We accept
Scots of all kinds and in all styles and dialects. You can find out how to
- submit to Lallans on the home page.
+ submit to Lallans on the <a href="/en-GB/submit">Submit</a> page.
`,
},
};
diff --git a/src/i18n/translations/pages/submit.ts b/src/i18n/translations/pages/submit.ts
new file mode 100644
index 0000000..0f7cf0c
--- /dev/null
+++ b/src/i18n/translations/pages/submit.ts
@@ -0,0 +1,49 @@
+import type { TranslationsDictionary } from '$types/TranslationsDictionary';
+
+const tPage = {
+ title: {
+ sco: () => 'Submit',
+ 'en-GB': () => 'Submit',
+ },
+ '105-submissions-full': {
+ sco: () => `
+ Lallans 105 is steikit fu, and we canna accept ony mair submeissions. We
+ will apen submeissions again ance Lallans 105 is out.
+ `,
+ 'en-GB': () => `
+ Lallans 105 is full to the brim, and we can’t accept any more
+ submissions. We will open submissions again once Lallans 105 is out.
+ `,
+ },
+ 'submit-para-1': {
+ sco: () => `
+ We ar acceptin submeissions til Lallans 105.
+ `,
+ 'en-GB': () => `
+ We are accepting submissions to Lallans 105.
+ `,
+ },
+ 'submit-para-2': {
+ sco: () => `
+ Send us your cuttie tales, poesie and drama til
+ <a href="mailto:lallans@hotmail.co.uk">lallans@hotmail.co.uk</a>.
+ `,
+ 'en-GB': () => `
+ Send us your short stories, poetry and drama to
+ <a href="mailto:lallans@hotmail.co.uk">lallans@hotmail.co.uk</a>.
+ `,
+ },
+ 'submit-para-3': {
+ sco: () => `
+ We luik forrit tae haein your submeission, whither you’ve been submittin
+ for years or you’re a first-time writer!
+ `,
+ 'en-GB': () => `
+ We look forward to having your submission, whether you’ve been
+ submitting for years or you’re a first-time writer!
+ `,
+ },
+};
+
+type Raw = typeof tPage;
+export default tPage as TranslationsDictionary<Raw>;
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);
+---
+
+<Page title={t(tPage, { key: 'title' })}>
+ <section>
+ <h1>{t(tPage, { key: 'title' })}</h1>
+ <a href={`${locale}/mailto:${contactDetails.generalEnquiries.emailAddress}`}>
+ {contactDetails.generalEnquiries.emailAddress}
+ </a>
+ <address set:html={contactDetails.generalEnquiries.address.join('<br />')} />
+ </section>
+</Page>
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);
<Page title={t(tPage, { key: 'title' })}>
<section>
<h1>{t(tPage, { key: 'title' })}</h1>
- <p>{t(tPage, { key: 'about-lallans' })}</p>
+ <p set:html={t(tPage, { key: 'about-lallans' })} />
<LallansIssuesGallery />
</section>
</Page>
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);
---
<Page title={t(tPage, { key: 'title' })}>
- <!--
- Lallans 105 is leukin fair full the nou. Ance Lallans 105 is out we'll
- stert encouragin submeissions for 106.
-
- <section>
- <h2 set:html={t(tPage, { key: 'submit' })} />
- <p set:html={t(tPage, { key: 'submit-para-1' })} />
- <p set:html={t(tPage, { key: 'submit-para-2' })} />
- <p set:html={t(tPage, { key: 'submit-para-3' })} />
- </section>
- -->
- <section>
- <h2 class="grid-span-6" set:html={t(tPage, { key: 'news' })} />
- <NewsIndex newsItems={mostRecentNewsItem ? [mostRecentNewsItem] : []} headingLevel="h3" />
- {
- mostRecentNewsItem && (
- <Button classNames="grid-span-3 grid-prose-end" href={`/${locale}/news`}>
- {t(tPage, { key: 'aw-news' })} ▶
- </Button>
- )
- }
- </section>
-
<section id="about">
<h2 set:html={t(tPage, { key: 'about-us' })} />
<p set:html={t(tPage, { key: 'about-us-para-1' })} />
@@ -59,12 +32,4 @@ const mostRecentNewsItem = await getMostRecentNewsItem(locale);
{t(tPage, { key: 'aw-furthsettins' })} ▶
</Button>
</section>
-
- <section id="contact">
- <h2 set:html={t(tPage, { key: 'contact' })} />
- <a href={`${locale}/mailto:${contactDetails.generalEnquiries.emailAddress}`}>
- {contactDetails.generalEnquiries.emailAddress}
- </a>
- <address set:html={contactDetails.generalEnquiries.address.join('<br />')} />
- </section>
</Page>
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);
+---
+
+<Page title={t(tPage, { key: 'title' })}>
+ <section>
+ <h2 set:html={t(tPage, { key: 'title' })} />
+ <p set:html={t(tPage, { key: '105-submissions-full' })} />
+ </section>
+</Page>