File tree Expand file tree Collapse file tree
web/app/[locale]/(pages)/news/archive/[...slug] Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export default async function LocaleLayout({
3131 const slugs =
3232 archivedItems ?. map ( ( data : PathType ) => ( {
3333 slug : `${ data . locale === 'no' ? '/no' : '' } ${ data . slug as string } ` ,
34- lang : data . locale === 'en' ? 'en_GB ' : 'nb_NO ' ,
34+ lang : data . locale === 'en' ? 'en-GB ' : 'nb-NO ' ,
3535 } ) ) ?? [ ]
3636
3737 return (
Original file line number Diff line number Diff line change @@ -7,11 +7,12 @@ import { Flags } from '@/sanity/helpers/datasetHelpers'
77import type { PathType } from '@/sanity/queries/paths/getPaths'
88import ArchivedNews from '@/templates/archivedNews/ArchivedNews'
99
10+
1011type Params = Promise < { locale : string ; slug : string [ ] } >
1112//TODO types
1213async function getArchivedPageData ( params : { locale : string ; slug : string [ ] } ) {
1314 const { locale : routeLocale , slug : pagePathArray } = params
14- const locale = routeLocale === 'en-GB' ? 'en' : routeLocale
15+ const locale = ( routeLocale === 'en-GB' ) ? 'en' : 'no'
1516 if ( ! Flags . HAS_ARCHIVED_NEWS ) return { notFound : true }
1617
1718 const pagePath = pagePathArray ?. join ( '/' )
@@ -35,7 +36,6 @@ export async function generateMetadata({
3536 params : Params
3637} ) : Promise < Metadata > {
3738 const { locale, slug : pagePathArray } = await params
38-
3939 const archivedItems = archivedNews . filter (
4040 e => e . slug === `/news/archive/${ pagePathArray . join ( '/' ) } ` ,
4141 )
You can’t perform that action at this time.
0 commit comments