diff --git a/sanityv3/package.json b/sanityv3/package.json index 2fa38a935..23b7a9e70 100644 --- a/sanityv3/package.json +++ b/sanityv3/package.json @@ -47,7 +47,7 @@ "@types/react-dom": "^18.0.5", "@types/styled-components": "^5.1.26", "eslint": "^8.6.0", - "nanoid": "^5.0.4", + "nanoid": "^5.0.9", "prettier": "^2.8.3", "typescript": "^4.0.0" } diff --git a/sanityv3/pnpm-lock.yaml b/sanityv3/pnpm-lock.yaml index 3357531b8..f8455a287 100644 --- a/sanityv3/pnpm-lock.yaml +++ b/sanityv3/pnpm-lock.yaml @@ -91,8 +91,8 @@ devDependencies: specifier: ^8.6.0 version: 8.6.0 nanoid: - specifier: ^5.0.4 - version: 5.0.4 + specifier: ^5.0.9 + version: 5.0.9 prettier: specifier: ^2.8.3 version: 2.8.3 @@ -1404,7 +1404,7 @@ packages: dependencies: diff-match-patch: 1.0.5 hotscript: 1.0.13 - nanoid: 5.0.4 + nanoid: 5.0.9 dev: false /@codemirror/autocomplete@6.18.0(@codemirror/language@6.10.2)(@codemirror/state@6.4.1)(@codemirror/view@6.33.0)(@lezer/common@1.2.1): @@ -7331,8 +7331,8 @@ packages: hasBin: true dev: false - /nanoid@5.0.4: - resolution: {integrity: sha512-vAjmBf13gsmhXSgBrtIclinISzFFy22WwCYoyilZlsrRXNIHSwgFQ1bEdjRwMT3aoadeIF6HMuDRlOxzfXV8ig==} + /nanoid@5.0.9: + resolution: {integrity: sha512-Aooyr6MXU6HpvvWXKoVoXwKMs/KyVakWwg7xQfv5/S/RIgJMy0Ifa45H9qqYy7pTCszrHzP21Uk4PZq2HpEM8Q==} engines: {node: ^18 || >=20} hasBin: true diff --git a/search/IndexArchivedNews/algolia.ts b/search/IndexArchivedNews/algolia.ts deleted file mode 100644 index dbf5afcde..000000000 --- a/search/IndexArchivedNews/algolia.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Settings } from '@algolia/client-search' - -export const indexSettings: Settings = { - searchableAttributes: ['pageTitle', 'text'], - attributesToSnippet: ['text'], - attributesForFaceting: ['year', 'topicTags', 'countryTags'], - attributeForDistinct: 'slug', - distinct: 1, - advancedSyntax: true, - ranking: ['desc(publishDateTime)', 'typo', 'geo', 'words', 'filters', 'proximity', 'attribute', 'exact', 'custom'], -} diff --git a/search/IndexArchivedNews/index.ts b/search/IndexArchivedNews/index.ts index 368b9c8b9..d81de267b 100644 --- a/search/IndexArchivedNews/index.ts +++ b/search/IndexArchivedNews/index.ts @@ -11,7 +11,7 @@ import * as T from 'fp-ts/lib/Task' import { init, getClient, getFileList, copyFile } from './blobStorage' import { ContainerClient } from '@azure/storage-blob' import { update, generateIndexName, getEnvironment, languageFromIso, languageOrDefault, NewsIndex } from '../common' -import { indexSettings } from './algolia' +import { indexSettings } from '../IndexSanityContent/common/news/algolia' import { mapData } from './mapper' import { loadJson } from './fileStorage' diff --git a/web/templates/magazine/Magazineroom.tsx b/web/templates/magazine/Magazineroom.tsx index 71c9e6285..fb9503282 100644 --- a/web/templates/magazine/Magazineroom.tsx +++ b/web/templates/magazine/Magazineroom.tsx @@ -35,9 +35,7 @@ const MagazineRoom = ({ pageData, slug }: MagazineIndexTemplateProps) => { const resultsRef = useRef(null) const [isLoading, setIsLoading] = useState(false) const router = useRouter() - const parentSlug = - (router.locale !== router.defaultLocale ? `/${router.locale}` : '') + - router.asPath.substring(router.asPath.indexOf('/'), router.asPath.lastIndexOf('/')) + const parentSlug = `${router.locale !== router.defaultLocale ? `/${router.locale}` : ''}${router.pathname}` const magazineList = useMemo(() => magazineArticles, [magazineArticles]) const pagedList = useMemo(() => chunkArray(magazineList, 12), [magazineList])