mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-02 06:58:13 +00:00
various path fixes for links to extensions, fix relative paths in links
This commit is contained in:
parent
2dc0ae279c
commit
0c199975f2
16 changed files with 77 additions and 52 deletions
quartz/plugins/transformers
|
@ -36,6 +36,7 @@ export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options> | und
|
|||
} else if (source === "frontmatter" && file.data.frontmatter) {
|
||||
created ||= file.data.frontmatter.date
|
||||
modified ||= file.data.frontmatter.lastmod
|
||||
modified ||= file.data.frontmatter.updated
|
||||
modified ||= file.data.frontmatter["last-modified"]
|
||||
published ||= file.data.frontmatter.publishDate
|
||||
} else if (source === "git") {
|
||||
|
|
|
@ -79,9 +79,8 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options> | undefined> =
|
|||
) {
|
||||
if (!isAbsoluteUrl(node.properties.src)) {
|
||||
let dest = node.properties.src as RelativeURL
|
||||
const ext = path.extname(node.properties.src)
|
||||
dest = node.properties.src = transformLink(curSlug, dest, transformOptions)
|
||||
node.properties.src = dest + ext
|
||||
node.properties.src = dest
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -196,7 +196,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
|
|||
// embed cases
|
||||
if (value.startsWith("!")) {
|
||||
const ext: string = path.extname(fp).toLowerCase()
|
||||
const url = slugifyFilePath(fp as FilePath) + ext
|
||||
const url = slugifyFilePath(fp as FilePath)
|
||||
if ([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg"].includes(ext)) {
|
||||
const dims = alias ?? ""
|
||||
let [width, height] = dims.split("x", 2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue