mobile fixes, fix bug when linking to anchor on home, docs

This commit is contained in:
Jacky Zhao 2023-08-06 17:09:29 -07:00
parent db6054a8c1
commit 028bcec62c
14 changed files with 134 additions and 24 deletions
quartz/plugins/transformers

View file

@ -2,6 +2,7 @@ import { QuartzTransformerPlugin } from "../types"
import {
CanonicalSlug,
RelativeURL,
_stripSlashes,
canonicalizeServer,
joinSegments,
pathToRoot,
@ -35,7 +36,7 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options> | undefined> =
return (tree, file) => {
const curSlug = canonicalizeServer(file.data.slug!)
const transformLink = (target: string): RelativeURL => {
const targetSlug = transformInternalLink(target).slice("./".length)
const targetSlug = _stripSlashes(transformInternalLink(target).slice(".".length))
let [targetCanonical, targetAnchor] = splitAnchor(targetSlug)
if (opts.markdownLinkResolution === "relative") {
return targetSlug as RelativeURL

View file

@ -225,7 +225,6 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
}
// internal link
// const url = transformInternalLink(fp + anchor)
const url = fp + anchor
return {
type: "link",