changed from hexo to custom react stuff #1
1 changed files with 3 additions and 1 deletions
|
@ -25,9 +25,11 @@ function addFiles(filesPath: string) {
|
||||||
|
|
||||||
// not perfect. Some filenames might cause problem.
|
// not perfect. Some filenames might cause problem.
|
||||||
let stats = fs.lstatSync(filesPath) // checks if the path leads to a directory or a file
|
let stats = fs.lstatSync(filesPath) // checks if the path leads to a directory or a file
|
||||||
|
|
||||||
|
// don't use replaceAll
|
||||||
let urlPath = `/${path.relative(dirPath, filesPath)}` // path tha will be used for url
|
let urlPath = `/${path.relative(dirPath, filesPath)}` // path tha will be used for url
|
||||||
.replace(/\.[^/.]+$/, "") // remove .md file extension
|
.replace(/\.[^/.]+$/, "") // remove .md file extension
|
||||||
.replaceAll(" ", "-") // replace space with a dash "-"
|
.replace(/ /g, "-") // replace space with a dash "-"
|
||||||
|
|
||||||
// if it's a directory, apply this function to every files/folders in it
|
// if it's a directory, apply this function to every files/folders in it
|
||||||
// if it's a file, read and add it to pageList
|
// if it's a file, read and add it to pageList
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue