Skip to content

Commit

Permalink
feat: add lang base url for non-lang mode
Browse files Browse the repository at this point in the history
  • Loading branch information
makamekm authored and 3y3 committed Apr 23, 2024
1 parent 3e19c4a commit 7304f8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/steps/processPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,10 @@ async function processingFileToHtml(
metaDataOptions: MetaDataOptions,
): Promise<DocInnerProps> {
const {outputBundlePath, filename, fileExtension, outputPath, pathToFile} = path;
const toc: YfmToc | null = TocService.getForPath(pathToFile) || null;

const deep = pathToFile.split('/').length - 2; // exclude lang and count slashes
const basePath = toc?.base?.split('/')?.filter((str) => str !== '.') || [];
const deep = pathToFile.split('/').length - 1 - basePath.length;

return resolveMd2HTML({
inputPath: pathToFile,
Expand Down

0 comments on commit 7304f8d

Please sign in to comment.