diff --git a/gatsby-node.js b/gatsby-node.js index aa8f105..4aae087 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -83,7 +83,7 @@ const exportIndex = (index, conceptScheme, language) => { const path = getFilePath( (conceptScheme.id.endsWith("/") ? conceptScheme.id.slice(0, -1) - : conceptScheme.id) + `/cs/search/${language}/${key}`, + : conceptScheme.id) + `-cs/search/${language}/${key}`, `json` ) createData({ diff --git a/src/templates/helpers.js b/src/templates/helpers.js index f7992fb..4f93cda 100644 --- a/src/templates/helpers.js +++ b/src/templates/helpers.js @@ -97,7 +97,7 @@ export const importIndex = async ( const path = (conceptSchemeId.endsWith("/") ? conceptSchemeId.slice(0, -1) - : conceptSchemeId) + `/cs/search/${language}/${key}` + : conceptSchemeId) + `-cs/search/${language}/${key}` data = await fetch(withPrefix(getFilePath(path, `json`))) const jsonData = await data.json() diff --git a/test/mocks/mockFetch.js b/test/mocks/mockFetch.js index 857954e..88aa13a 100644 --- a/test/mocks/mockFetch.js +++ b/test/mocks/mockFetch.js @@ -81,28 +81,28 @@ export default async function mockFetch(url) { json: async () => res, } } - case "/w3id.org/cs/search/de/prefLabel.cfg.json": { + case "/w3id.org-cs/search/de/prefLabel.cfg.json": { return { ok: true, status: 200, json: async () => cfg, } } - case "/w3id.org/cs/search/de/prefLabel.ctx.json": { + case "/w3id.org-cs/search/de/prefLabel.ctx.json": { return { ok: true, status: 200, json: async () => ctx, } } - case "/w3id.org/cs/search/de/prefLabel.map.json": { + case "/w3id.org-cs/search/de/prefLabel.map.json": { return { ok: true, status: 200, json: async () => map, } } - case "/w3id.org/cs/search/de/reg.json": { + case "/w3id.org-cs/search/de/reg.json": { return { ok: true, status: 200,