| | |
| | | simplifySlug, |
| | | splitAnchor, |
| | | transformLink, |
| | | joinSegments, |
| | | } from "../../util/path" |
| | | import path from "path" |
| | | import { visit } from "unist-util-visit" |
| | |
| | | externalLinkIcon: true, |
| | | } |
| | | |
| | | export const CrawlLinks: QuartzTransformerPlugin<Partial<Options> | undefined> = (userOpts) => { |
| | | export const CrawlLinks: QuartzTransformerPlugin<Partial<Options>> = (userOpts) => { |
| | | const opts = { ...defaultOptions, ...userOpts } |
| | | return { |
| | | name: "LinkProcessing", |
| | |
| | | } |
| | | node.properties.className = classes |
| | | |
| | | if (opts.openLinksInNewTab) { |
| | | if (isExternal && opts.openLinksInNewTab) { |
| | | node.properties.target = "_blank" |
| | | } |
| | | |