Skip to content

Commit

Permalink
feat: use base uri path
Browse files Browse the repository at this point in the history
  • Loading branch information
makamekm authored and 3y3 committed Apr 23, 2024
1 parent dd0cdf2 commit b606d8d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/resolvers/md2html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const getFileProps = async (options: ResolverOptions) => {
const tocBase: string = toc?.base ?? '';
const pathToFileDir: string =
pathToDir === tocBase ? '' : pathToDir.replace(`${tocBase}${sep}`, '');
const relativePathToIndex = relative(pathToDir, `${tocBase}${sep}`);

const {
lang: configLang,
Expand All @@ -97,7 +96,7 @@ const getFileProps = async (options: ResolverOptions) => {
const tocBaseLang = tocBase?.split('/')[0];
const tocLang = configLangs?.includes(tocBaseLang as Lang) && tocBaseLang;

const lang = configLang || tocLang || Lang.RU;
const lang = tocLang || configLang || Lang.RU;
const langs = configLangs?.length ? configLangs : [lang];

const props = {
Expand All @@ -107,7 +106,7 @@ const getFileProps = async (options: ResolverOptions) => {
...meta,
},
router: {
pathname: join(relativePathToIndex, pathToFileDir, basename(outputPath)),
pathname: join(pathToFileDir, basename(outputPath)),
},
lang,
langs,
Expand Down

0 comments on commit b606d8d

Please sign in to comment.