Skip to content

Commit

Permalink
fix page plugin ignoring options.routeBasePath
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Jul 21, 2021
1 parent cc15ba2 commit 1a5b9eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions packages/docusaurus-plugin-content-pages/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
addTrailingPathSeparator,
Globby,
createAbsoluteFilePathMatcher,
normalizeUrl,
} from '@docusaurus/utils';
import {
LoadContext,
Expand Down Expand Up @@ -124,8 +125,11 @@ export default function pluginContentPages(

const source = path.join(contentPath, relativeSource);
const aliasedSourcePath = aliasedSitePath(source, siteDir);
const pathName = encodePath(fileToPath(relativeSource));
const permalink = pathName.replace(/^\//, baseUrl || '');
const permalink = normalizeUrl([
baseUrl,
options.routeBasePath,
encodePath(fileToPath(relativeSource)),
]);
if (isMarkdownSource(relativeSource)) {
return {
type: 'mdx',
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion website/src/pages/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Docusaurus use some extra plugin instances for testing / dogfooding purpose:

- [/tests/docs](/tests/docs)
- [/tests/blog](/tests/blog)
- [/tests/pages](/pages) (todo bad link to fix)
- [/tests/pages](/tests/pages)

0 comments on commit 1a5b9eb

Please sign in to comment.