summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-31 10:28:09 +0100
committerGitHub <noreply@github.com>2023-08-31 10:28:09 +0100
commit244fda8c63356bfcc19a0ea437edf36458e4bc9b (patch)
treea54fe436f4d71cd9d735f34b4f7b8829b1af4456 /src
parent73bbbe8307f9474e751236a44db2dcc6924c5035 (diff)
parent5bfb00f6cdbb369d834dbe27d213d80a821f8036 (diff)
Merge pull request #4 from Sycamost/dev
Changes site to scotsleidassocie.org
Diffstat (limited to 'src')
-rw-r--r--src/components/Button.astro10
-rw-r--r--src/components/Footer.astro13
-rw-r--r--src/i18n/translations/components/footer.ts15
-rw-r--r--src/i18n/translations/site.ts4
-rw-r--r--src/pages/[locale]/index.astro4
-rw-r--r--src/pages/robots.txt.ts11
6 files changed, 41 insertions, 16 deletions
diff --git a/src/components/Button.astro b/src/components/Button.astro
index 9cc3885..20b6087 100644
--- a/src/components/Button.astro
+++ b/src/components/Button.astro
@@ -1,17 +1,13 @@
---
-import type Digit from '$types/Digit';
-
-type LayoutClasses = `grid-span-${Digit}${'' | ' grid-end' | ' grid-prose-end'}`;
-
interface Props {
href: string;
- layoutClasses: LayoutClasses;
+ classNames: string;
}
-const { href, layoutClasses } = Astro.props;
+const { href, classNames } = Astro.props;
---
-<a class={`btn ${layoutClasses}`} href={href}>
+<a class={`btn ${classNames}`} href={href}>
<p>
<slot />
</p>
diff --git a/src/components/Footer.astro b/src/components/Footer.astro
index 62b3b82..40fdddb 100644
--- a/src/components/Footer.astro
+++ b/src/components/Footer.astro
@@ -1,6 +1,6 @@
---
import translate from '$i18n/translate';
-import tSite from '$i18n/translations/site';
+import tComponent from '$i18n/translations/components/footer';
import { getLocaleFromPathOrDefault } from '$lib/getLocaleFromPath';
import Button from './Button.astro';
@@ -9,7 +9,14 @@ const t = translate(locale);
---
<footer>
- <Button layoutClasses="grid-span-3 grid-end" href="#top">
- ▲ {t(tSite, { key: 'back-to-top' })}
+ <a href={`/${locale}/rss.xml`} class="footer__rss-button">
+ <span class="footer__rss-button__label">
+ {t(tComponent, { key: 'subscribe-to-rss' })}
+ </span>
+ <img class="footer__rss-button__img" src="/images/rss.svg" />
+ </a>
+
+ <Button classNames="footer__back-to-top" href="#top">
+ ▲ {t(tComponent, { key: 'back-to-top' })}
</Button>
</footer>
diff --git a/src/i18n/translations/components/footer.ts b/src/i18n/translations/components/footer.ts
new file mode 100644
index 0000000..c7d6055
--- /dev/null
+++ b/src/i18n/translations/components/footer.ts
@@ -0,0 +1,15 @@
+import type { TranslationsDictionary } from '$types/TranslationsDictionary';
+
+const tComponent = {
+ 'back-to-top': {
+ sco: () => 'Back til tap',
+ 'en-GB': () => 'Back to top',
+ },
+ 'subscribe-to-rss': {
+ sco: () => 'Subscrive til oor RSS feed',
+ 'en-GB': () => 'Subscribe to our RSS feed',
+ },
+};
+
+type Raw = typeof tComponent;
+export default tComponent as TranslationsDictionary<Raw>;
diff --git a/src/i18n/translations/site.ts b/src/i18n/translations/site.ts
index 7d48670..59a8cd4 100644
--- a/src/i18n/translations/site.ts
+++ b/src/i18n/translations/site.ts
@@ -32,10 +32,6 @@ const tSite = {
sco: () => 'an',
'en-GB': () => 'and',
},
- 'back-to-top': {
- sco: () => 'Back til tap',
- 'en-GB': () => 'Back to top',
- },
locale: {
sco: ({ locale }: { locale: Locale }) => {
switch (locale) {
diff --git a/src/pages/[locale]/index.astro b/src/pages/[locale]/index.astro
index 39db161..f031e8e 100644
--- a/src/pages/[locale]/index.astro
+++ b/src/pages/[locale]/index.astro
@@ -27,7 +27,7 @@ const mostRecentNewsItem = await getMostRecentNewsItem(locale);
<NewsIndex newsItems={mostRecentNewsItem ? [mostRecentNewsItem] : []} headingLevel="h3" />
{
mostRecentNewsItem && (
- <Button layoutClasses="grid-span-3 grid-prose-end" href={`/${locale}/news`}>
+ <Button classNames="grid-span-3 grid-prose-end" href={`/${locale}/news`}>
{t(tPage, { key: 'aw-news' })} ▶
</Button>
)
@@ -73,7 +73,7 @@ const mostRecentNewsItem = await getMostRecentNewsItem(locale);
<section>
<h2 set:html={t(tPage, { key: 'furthsettins' })} />
<p set:html={t(tPage, { key: 'furthsettins-para' })} />
- <Button layoutClasses="grid-span-3 grid-prose-end" href={`/${locale}/furthsettins`}>
+ <Button classNames="grid-span-3 grid-prose-end" href={`/${locale}/furthsettins`}>
{t(tPage, { key: 'aw-furthsettins' })} ▶
</Button>
</section>
diff --git a/src/pages/robots.txt.ts b/src/pages/robots.txt.ts
new file mode 100644
index 0000000..c7e396f
--- /dev/null
+++ b/src/pages/robots.txt.ts
@@ -0,0 +1,11 @@
+import type { APIContext } from 'astro';
+
+export async function get(context: APIContext) {
+ return new Response(`
+ User-agent: *
+ User-agent: AdsBot-Google
+ Disallow: */payment-success-confirmation
+
+ Sitemap: ${context.site}sitemap-index.xml
+ `);
+}