Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(links.ts): custom identifiers for custom icons #1654

Draft
wants to merge 10 commits into
base: v4
Choose a base branch
from
Prev Previous commit
Next Next commit
fix(links.ts): styling
  • Loading branch information
bfahrenfort committed Dec 23, 2024
commit 936ce4ff07fa63bd913bb56538758d6f673e8e27
4 changes: 3 additions & 1 deletion quartz/plugins/transformers/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options>> = (userOpts)
tagName: "img",
properties: {
src: (sub as Image).src,
style: "max-width:1em;max-height:1em",
style: "max-width:1em;max-height:1em;margin:0px",
},
children: [],
}
Expand Down Expand Up @@ -137,6 +137,8 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options>> = (userOpts)
const isExternal = URL.canParse(dest)
classes.push(isExternal || matched ? "external" : "internal")

// If the link matched a substitution, display the corresponding image afterwards;
// otherwise, if it's an external link, display the default external link icon
if ((isExternal && opts.externalLinkIcon) || matched) {
node.children.push(
refIcon != null
Expand Down