mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-02 14:58:14 +00:00
improve path resolution stability
This commit is contained in:
parent
c874e7e937
commit
dd47be1bc6
5 changed files with 8 additions and 7 deletions
quartz/components/pages
|
@ -5,11 +5,11 @@ import path from "path"
|
|||
|
||||
import style from "../styles/listPage.scss"
|
||||
import { PageList } from "../PageList"
|
||||
import { simplifySlug } from "../../util/path"
|
||||
import { _stripSlashes, simplifySlug } from "../../util/path"
|
||||
|
||||
function FolderContent(props: QuartzComponentProps) {
|
||||
const { tree, fileData, allFiles } = props
|
||||
const folderSlug = simplifySlug(fileData.slug!)
|
||||
const folderSlug = _stripSlashes(simplifySlug(fileData.slug!))
|
||||
const allPagesInFolder = allFiles.filter((file) => {
|
||||
const fileSlug = simplifySlug(file.slug!)
|
||||
const prefixed = fileSlug.startsWith(folderSlug) && fileSlug !== folderSlug
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue