mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +02:00
feat(sitemap): add support for "lastmod" (#9954)
This commit is contained in:
parent
465cf4d82c
commit
9017fb9b1d
41 changed files with 1449 additions and 359 deletions
|
@ -92,6 +92,20 @@ export function aliasedSitePath(filePath: string, siteDir: string): string {
|
|||
return `@site/${relativePath}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts back the aliased site path (starting with "@site/...") to a relative path
|
||||
*
|
||||
* TODO method this is a workaround, we shouldn't need to alias/un-alias paths
|
||||
* we should refactor the codebase to not have aliased site paths everywhere
|
||||
* We probably only need aliasing for client-only paths required by Webpack
|
||||
*/
|
||||
export function aliasedSitePathToRelativePath(filePath: string): string {
|
||||
if (filePath.startsWith('@site/')) {
|
||||
return filePath.replace('@site/', '');
|
||||
}
|
||||
throw new Error(`Unexpected, filePath is not site-aliased: ${filePath}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* When you have a path like C:\X\Y
|
||||
* It is not safe to use directly when generating code
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue