Skip to content

Commit

Permalink
feat:tag hash with css
Browse files Browse the repository at this point in the history
  • Loading branch information
8bitgentleman committed Mar 5, 2024
1 parent 1c3f3d0 commit 3f06f6a
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 9 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
2 changes: 1 addition & 1 deletion quartz/components/TagList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const TagList: QuartzComponent = ({ fileData, displayClass }: QuartzComponentPro
return (
<li>
<a href={linkDest} class="internal tag-link">
{display}
{tag}
</a>
</li>
)
Expand Down
14 changes: 12 additions & 2 deletions quartz/i18n/locales/ru-RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ export default {
rss: {
recentNotes: "Недавние заметки",
lastFewNotes: ({ count }) =>
`Последн${getForm(count, "яя", "ие", "ие")} ${count} замет${getForm(count, "ка", "ки", "ок")}`,
`Последн${getForm(count, "яя", "ие", "ие")} ${count} замет${getForm(
count,
"ка",
"ки",
"ок",
)}`,
},
error: {
title: "Страница не найдена",
Expand All @@ -78,7 +83,12 @@ export default {
tagIndex: "Индекс тегов",
itemsUnderTag: ({ count }) => `с этим тегом ${count} элемент${getForm(count, "", "а", "ов")}`,
showingFirst: ({ count }) =>
`Показыва${getForm(count, "ется", "ются", "ются")} ${count} тег${getForm(count, "", "а", "ов")}`,
`Показыва${getForm(count, "ется", "ются", "ются")} ${count} тег${getForm(
count,
"",
"а",
"ов",
)}`,
totalTags: ({ count }) => `Всего ${count} тег${getForm(count, "", "а", "ов")}`,
},
},
Expand Down
8 changes: 5 additions & 3 deletions quartz/plugins/emitters/contentIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ function generateRSSFeed(cfg: GlobalConfiguration, idx: ContentIndex, limit?: nu
<channel>
<title>${escapeHTML(cfg.pageTitle)}</title>
<link>https://${base}</link>
<description>${!!limit ? i18n(cfg.locale).pages.rss.lastFewNotes({ count: limit }) : i18n(cfg.locale).pages.rss.recentNotes} on ${escapeHTML(
cfg.pageTitle,
)}</description>
<description>${
!!limit
? i18n(cfg.locale).pages.rss.lastFewNotes({ count: limit })
: i18n(cfg.locale).pages.rss.recentNotes
} on ${escapeHTML(cfg.pageTitle)}</description>
<generator>Quartz -- quartz.jzhao.xyz</generator>
${items}
</channel>
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 3f06f6a

Please sign in to comment.