mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-05 16:22:22 +00:00
chore: refactor out and export endsWith
This commit is contained in:
parent
af5f5abad4
commit
ab0e20b4d0
5 changed files with 34 additions and 33 deletions
quartz/plugins
|
@ -10,7 +10,7 @@ import {
|
|||
FilePath,
|
||||
FullSlug,
|
||||
SimpleSlug,
|
||||
_stripSlashes,
|
||||
stripSlashes,
|
||||
joinSegments,
|
||||
pathToRoot,
|
||||
simplifySlug,
|
||||
|
@ -38,7 +38,7 @@ export const FolderPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOpt
|
|||
getQuartzComponents() {
|
||||
return [Head, Header, Body, ...header, ...beforeBody, pageBody, ...left, ...right, Footer]
|
||||
},
|
||||
async getDependencyGraph(ctx, content, _resources) {
|
||||
async getDependencyGraph(_ctx, _content, _resources) {
|
||||
// Example graph:
|
||||
// nested/file.md --> nested/file.html
|
||||
// \-------> nested/index.html
|
||||
|
@ -75,7 +75,7 @@ export const FolderPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOpt
|
|||
)
|
||||
|
||||
for (const [tree, file] of content) {
|
||||
const slug = _stripSlashes(simplifySlug(file.data.slug!)) as SimpleSlug
|
||||
const slug = stripSlashes(simplifySlug(file.data.slug!)) as SimpleSlug
|
||||
if (folders.has(slug)) {
|
||||
folderDescriptions[slug] = [tree, file]
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
RelativeURL,
|
||||
SimpleSlug,
|
||||
TransformOptions,
|
||||
_stripSlashes,
|
||||
stripSlashes,
|
||||
simplifySlug,
|
||||
splitAnchor,
|
||||
transformLink,
|
||||
|
@ -115,7 +115,7 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options> | undefined> =
|
|||
}
|
||||
|
||||
// need to decodeURIComponent here as WHATWG URL percent-encodes everything
|
||||
const full = decodeURIComponent(_stripSlashes(destCanonical, true)) as FullSlug
|
||||
const full = decodeURIComponent(stripSlashes(destCanonical, true)) as FullSlug
|
||||
const simple = simplifySlug(full)
|
||||
outgoing.add(simple)
|
||||
node.properties["data-slug"] = full
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue