fix(tag): move hash to sass styling only (#930)

This commit is contained in:
Matt Vogel 2024-03-06 20:25:39 -05:00 committed by GitHub
parent e13cafe070
commit 001c166825
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 5 deletions

View File

@ -63,7 +63,7 @@ export const PageList: QuartzComponent = ({ cfg, fileData, allFiles, limit }: Pr
class="internal tag-link" class="internal tag-link"
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)} href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
> >
#{tag} {tag}
</a> </a>
</li> </li>
))} ))}

View File

@ -63,7 +63,7 @@ export default ((userOpts?: Partial<Options>) => {
class="internal tag-link" class="internal tag-link"
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)} href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
> >
#{tag} {tag}
</a> </a>
</li> </li>
))} ))}

View File

@ -9,12 +9,11 @@ const TagList: QuartzComponent = ({ fileData, displayClass }: QuartzComponentPro
return ( return (
<ul class={classNames(displayClass, "tags")}> <ul class={classNames(displayClass, "tags")}>
{tags.map((tag) => { {tags.map((tag) => {
const display = `#${tag}`
const linkDest = baseDir + `/tags/${slugTag(tag)}` const linkDest = baseDir + `/tags/${slugTag(tag)}`
return ( return (
<li> <li>
<a href={linkDest} class="internal tag-link"> <a href={linkDest} class="internal tag-link">
{display} {tag}
</a> </a>
</li> </li>
) )

View File

@ -328,7 +328,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
children: [ children: [
{ {
type: "text", type: "text",
value: `#${tag}`, value: tag,
}, },
], ],
} }

View File

@ -79,6 +79,11 @@ a {
border-radius: 0; border-radius: 0;
padding: 0; padding: 0;
} }
&.tag-link {
&::before {
content: "#";
}
}
} }
&.external .external-icon { &.external .external-icon {