Skip to content

Commit

Permalink
fix: url and base
Browse files Browse the repository at this point in the history
  • Loading branch information
hrenaud committed Feb 11, 2024
1 parent dc12727 commit e00c0b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
SITE_URL=http://localhost:4321
PUBLIC_BASE=
# BASE_URL=<-ne fonctionne pas localement
PUBLIC_REF_NAME=RWP
PUBLIC_REPO_URL=https://github.com/cnumr/best-practices-wordpress
PUBLIC_REPO_BRANCH=main
4 changes: 2 additions & 2 deletions src/i18n/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export function useTranslations(lang: keyof typeof ui) {
export function useTranslatedPath(lang: keyof typeof ui) {
return function translatePath(path: string, l: string = lang) {
return !showDefaultLang && l === defaultLang
? `/${PUBLIC_BASE}${path}`
: `/${PUBLIC_BASE}${l}${path}`;
? `${process.env.SITE_URL}${process.env.PUBLIC_BASE}/${path}`
: `${process.env.SITE_URL}${process.env.PUBLIC_BASE}/${l}${path}`;
};
}

Expand Down

0 comments on commit e00c0b0

Please sign in to comment.