Skip to content

Commit

Permalink
fix(utils): hash-awareness of url-to-folder-path
Browse files Browse the repository at this point in the history
  • Loading branch information
argl authored Oct 18, 2024
1 parent 32db11a commit a4e9dc4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ export async function toPrettyJSON(value: unknown) {
}

export function urlToFolderPath(url: string) {
// Split off any # part of the URL (ex: passed in from redirect targets).
[url] = url.split("#");
const [, locale, , ...slugParts] = url.split("/");
return path.join(locale.toLowerCase(), _slugToFolder(slugParts.join("/")));
}
Expand Down

0 comments on commit a4e9dc4

Please sign in to comment.