diff options
| author | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-05 21:32:43 +0100 |
|---|---|---|
| committer | Joe Carstairs <65492573+Sycamost@users.noreply.github.com> | 2023-08-06 22:40:07 +0100 |
| commit | aba5b4e4879712b691532f855eb718d12dd5b9e5 (patch) | |
| tree | 102e3fec16e5d057c4c65a0a2e95a32d2a061bdd | |
| parent | 08ec69cb378d67f31c11f1f934dd9ebdb32d0130 (diff) | |
Moves localeStaticPaths
| -rw-r--r-- | src/lib/localeStaticPaths.ts (renamed from src/pages/[locale]/staticPaths.ts) | 6 | ||||
| -rw-r--r-- | src/pages/[locale]/index.astro | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/pages/[locale]/staticPaths.ts b/src/lib/localeStaticPaths.ts index 266ad2c..55c3d9a 100644 --- a/src/pages/[locale]/staticPaths.ts +++ b/src/lib/localeStaticPaths.ts @@ -1,10 +1,10 @@ -import type Locale from '../../types/Locale'; +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} }[] = [ +const localeStaticPaths: { params: { locale: Locale} }[] = [ { params: { locale: 'sco' } }, { params: { locale: 'en-GB' } }, ] -export default staticPaths;
\ No newline at end of file +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); |
