You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I dynamically set the permalink of each md in extendPageData method. The corresponding folder is not generated after packaging in Linux environment, but it is OK in windows environment
I dynamically set the permalink of each md in extendPageData method. The corresponding folder is not generated after packaging in Linux environment, but it is OK in windows environment
mycode
extendPageData($page) {
const {
_filePath,
regularPath
path,
} = $page;
if (!$page.frontmatter.permalink) {
const pathList = String(_filePath).split("\");
const length = pathList.length;
const folderName = pathList[length - 2] || "";
let fileName = pathList[length - 1].split(".")[0];
fileName = fileName.indexOf("-") >= 0 ? fileName.split("-")[1] : fileName;
const title =
${folderName}/${fileName}
;let englishTitle = getEnglishName(title);
// 生成 permalink
$page.frontmatter.permalink =
/${englishTitle}
;$page.frontmatter.sidebarDepth = 0;
$page.title = fileName;
}
},
The text was updated successfully, but these errors were encountered: