2021-03-26 00:43:43 +05:30
|
|
|
import envData from '../../../config/env.json';
|
|
|
|
|
2021-07-12 02:17:58 -07:00
|
|
|
const { clientLocale } = envData as {
|
|
|
|
clientLocale: keyof typeof algoliaIndices;
|
|
|
|
};
|
2021-02-11 03:41:51 +09:00
|
|
|
|
|
|
|
const algoliaIndices = {
|
|
|
|
english: {
|
|
|
|
name: 'news',
|
|
|
|
searchPage: 'https://www.freecodecamp.org/news/search/'
|
|
|
|
},
|
|
|
|
espanol: {
|
|
|
|
name: 'news-es',
|
|
|
|
searchPage: 'https://www.freecodecamp.org/espanol/news/search/'
|
|
|
|
},
|
|
|
|
chinese: {
|
|
|
|
name: 'news-zh',
|
|
|
|
searchPage: 'https://chinese.freecodecamp.org/news/search/'
|
2021-03-15 15:40:48 -07:00
|
|
|
},
|
|
|
|
'chinese-traditional': {
|
|
|
|
name: 'news-zh',
|
|
|
|
searchPage: 'https://chinese.freecodecamp.org/news/search'
|
2021-06-15 00:49:18 -07:00
|
|
|
},
|
|
|
|
italian: {
|
2021-12-11 09:10:27 -08:00
|
|
|
name: 'news-it',
|
|
|
|
searchPage: 'https://www.freecodecamp.org/italian/news/search/'
|
2021-06-15 00:49:18 -07:00
|
|
|
},
|
|
|
|
portuguese: {
|
2021-12-11 09:10:27 -08:00
|
|
|
name: 'news-pt',
|
|
|
|
searchPage: 'https://www.freecodecamp.org/portuguese/news/search/'
|
2021-12-11 02:41:52 +05:30
|
|
|
},
|
2021-12-11 09:10:27 -08:00
|
|
|
// TODO: Replace with Ukrainian news when we have more useful resources on that instance
|
2021-12-11 02:41:52 +05:30
|
|
|
ukrainian: {
|
|
|
|
name: 'news',
|
|
|
|
searchPage: 'https://www.freecodecamp.org/news/search/'
|
2021-02-11 03:41:51 +09:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export const newsIndex = algoliaIndices[clientLocale].name;
|
|
|
|
export const searchPageUrl = algoliaIndices[clientLocale].searchPage;
|