1
0
Fork 0

refactor blog and showcase implementation

This commit is contained in:
Enoch Riese 2023-07-18 21:27:36 -06:00
parent 6653e6f5b7
commit 2768adc36c
14 changed files with 266 additions and 297 deletions

View file

@ -349,3 +349,10 @@ export const maxPovDepthSlug = (slug, site) => {
* In that case, this will return true
*/
export const isSlugPart = (part, slug) => slug.slice(0, part.length) === part
/*
* Makes a properly formated path for the given locale
* (i.e. skips adding 'en' to localized paths)
* Expects a slug with no leading slash
* */
export const localePath = (locale, slug) => (locale === 'en' ? '/' : `/${locale}/`) + slug