上传部分Mysql
This commit is contained in:
1 parent
e2921c8347
commit
51aa7a3502
51 files changed
+682
-17
No files matched your search
@@ -97,12 +97,12 @@ function divideSidebar (
|
||||
let file = files[i]
|
||||
// 如果有子项目,则该级别无链接
|
||||
if (file.type === 'file') {
|
||||
let fileName = FileUtils.getFileName(file.path)
|
||||
let fileName = FileUtils.removeExtension(FileUtils.getFileName(file.path))
|
||||
// 是否为 index 文件【index 跳过】
|
||||
if (fileName.includes('index')) continue
|
||||
|
||||
let lastFolderName = FileUtils.getLastFolderName(file.parentFolder)
|
||||
let relativePath = FileUtils.getRelativePath(file.path, rootDir)
|
||||
let relativePath = FileUtils.removeExtension(FileUtils.getRelativePath(file.path, rootDir))
|
||||
let obj: SidebarItem = {
|
||||
text: fileName,
|
||||
link: relativePath,
|
||||
|
||||
@@ -65,6 +65,15 @@ export class FileUtils {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 去除后缀名
|
||||
* @param filename
|
||||
*/
|
||||
static removeExtension(filename:string) {
|
||||
return filename.slice(0, filename.lastIndexOf('.')) || filename;
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
// // /home/runner/work/duyl328.github.io/duyl328.github.io/docs/notes/index.md
|
||||
|
||||
Reference in new issue
Block a user