minista 2.8.2 → 2.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build.js +5 -5
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -762,7 +762,7 @@ async function buildSearchJson({
|
|
|
762
762
|
blockTextElements: { script: false, style: false, pre: false }
|
|
763
763
|
});
|
|
764
764
|
const regTrimPath = new RegExp(`^${entryBase}|index|.html`, "g");
|
|
765
|
-
const
|
|
765
|
+
const routePath = path.join(config.base, filePath.replace(regTrimPath, ""));
|
|
766
766
|
const regTrimTitle = new RegExp(trimTitle);
|
|
767
767
|
const pTitle = parsedHtml.querySelector("title");
|
|
768
768
|
const title = pTitle ? pTitle.rawText.replace(regTrimTitle, "") : "";
|
|
@@ -771,7 +771,7 @@ async function buildSearchJson({
|
|
|
771
771
|
if (!targetContent) {
|
|
772
772
|
tempWords.push(title);
|
|
773
773
|
tempPages.push({
|
|
774
|
-
path:
|
|
774
|
+
path: routePath,
|
|
775
775
|
toc: [],
|
|
776
776
|
title: titleArray,
|
|
777
777
|
content: []
|
|
@@ -815,7 +815,7 @@ async function buildSearchJson({
|
|
|
815
815
|
tempWords.push(title);
|
|
816
816
|
tempWords.push(body);
|
|
817
817
|
tempPages.push({
|
|
818
|
-
path:
|
|
818
|
+
path: routePath,
|
|
819
819
|
toc,
|
|
820
820
|
title: titleArray,
|
|
821
821
|
content: contentArray.flat()
|
|
@@ -837,7 +837,7 @@ async function buildSearchJson({
|
|
|
837
837
|
});
|
|
838
838
|
const pages = [];
|
|
839
839
|
await Promise.all(tempPages.map(async (page) => {
|
|
840
|
-
const
|
|
840
|
+
const routePath = page.path;
|
|
841
841
|
const toc = page.toc;
|
|
842
842
|
const title = page.title.map((word) => {
|
|
843
843
|
return sortedWords.indexOf(word);
|
|
@@ -845,7 +845,7 @@ async function buildSearchJson({
|
|
|
845
845
|
const content = page.content.map((word) => {
|
|
846
846
|
return sortedWords.indexOf(word);
|
|
847
847
|
});
|
|
848
|
-
pages.push({ path:
|
|
848
|
+
pages.push({ path: routePath, title, toc, content });
|
|
849
849
|
}));
|
|
850
850
|
const sortedPages = pages.sort((a, b) => {
|
|
851
851
|
const pathA = a.path.toUpperCase();
|