diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/layouts/Layout.astro | 4 | ||||
| -rw-r--r-- | src/lib/localeStaticPaths.ts | 10 | ||||
| -rw-r--r-- | src/pages/[locale]/index.astro | 4 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index b17de4d..360acfb 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -20,8 +20,8 @@ const t = translate(locale); <meta name="description" content={ t(site, 'description') } /> <meta name="viewport" content="width=device-width" /> <link rel="icon" href="/favicon.ico" /> - <link rel="stylesheet" href="/public/normalize.css" /> - <link rel="stylesheet" href="/public/main.css" /> + <link rel="stylesheet" href="/normalize.css" /> + <link rel="stylesheet" href="/main.css" /> <meta name="generator" content={Astro.generator} /> <title>{ title } | { t(site, 'title') }</title> </head> diff --git a/src/lib/localeStaticPaths.ts b/src/lib/localeStaticPaths.ts new file mode 100644 index 0000000..55c3d9a --- /dev/null +++ b/src/lib/localeStaticPaths.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 localeStaticPaths: { params: { locale: Locale} }[] = [ + { params: { locale: 'sco' } }, + { params: { locale: 'en-GB' } }, +] + +export default localeStaticPaths; diff --git a/src/pages/[locale]/index.astro b/src/pages/[locale]/index.astro index 23a270d..7552cd0 100644 --- a/src/pages/[locale]/index.astro +++ b/src/pages/[locale]/index.astro @@ -1,12 +1,12 @@ --- import Layout from '../../layouts/Layout.astro'; -import staticPaths from './staticPaths'; +import localeStaticPaths from '../../lib/localeStaticPaths'; import translate from '../../i18n/translate'; import site from '../../i18n/translations/site'; import home from '../../i18n/translations/pages/home'; import type Locale from '../../types/Locale'; -export async function getStaticPaths() { return staticPaths; } +export async function getStaticPaths() { return localeStaticPaths; } const locale = Astro.params.locale as Locale; const t = translate(locale); |
