Skip to content

Commit

Permalink
fix(tag): move hash to sass styling only (jackyzha0#930)
Browse files Browse the repository at this point in the history
  • Loading branch information
8bitgentleman authored and qazxcdswe123 committed Apr 18, 2024
1 parent df09fde commit 8deda53
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion quartz/components/PageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const PageList: QuartzComponent = ({ cfg, fileData, allFiles, limit }: Pr
class="internal tag-link"
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
>
#{tag}
{tag}
</a>
</li>
))}
Expand Down
2 changes: 1 addition & 1 deletion quartz/components/RecentNotes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default ((userOpts?: Partial<Options>) => {
class="internal tag-link"
href={resolveRelative(fileData.slug!, `tags/${tag}` as FullSlug)}
>
#{tag}
{tag}
</a>
</li>
))}
Expand Down
3 changes: 1 addition & 2 deletions quartz/components/TagList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ const TagList: QuartzComponent = ({ fileData, displayClass }: QuartzComponentPro
return (
<ul class={classNames(displayClass, "tags")}>
{tags.map((tag) => {
const display = `#${tag}`
const linkDest = baseDir + `/tags/${slugTag(tag)}`
return (
<li>
<a href={linkDest} class="internal tag-link">
{display}
{tag}
</a>
</li>
)
Expand Down
2 changes: 1 addition & 1 deletion quartz/plugins/transformers/ofm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
children: [
{
type: "text",
value: `#${tag}`,
value: tag,
},
],
}
Expand Down
5 changes: 5 additions & 0 deletions quartz/styles/base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ a {
border-radius: 0;
padding: 0;
}
&.tag-link {
&::before {
content: "#";
}
}
}

&.external .external-icon {
Expand Down

0 comments on commit 8deda53

Please sign in to comment.