Skip to content

Commit

Permalink
Merge branch 'v4' of https://github.com/jackyzha0/quartz into v4
Browse files Browse the repository at this point in the history
  • Loading branch information
Darakuu committed Feb 21, 2024
2 parents a680cdb + 7dd596e commit 02973c5
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs/features/explorer.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ When passing in your own options, you can omit any or all of these fields if you

Want to customize it even more?

- Removing table of contents: remove `Component.Explorer()` from `quartz.layout.ts`
- Removing explorer: remove `Component.Explorer()` from `quartz.layout.ts`
- (optional): After removing the explorer component, you can move the [[table of contents | Table of Contents]] component back to the `left` part of the layout
- Changing `sort`, `filter` and `map` behavior: explained in [[#Advanced customization]]
- Component:
Expand Down
9 changes: 6 additions & 3 deletions quartz/components/pages/TagContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ function TagContent(props: QuartzComponentProps) {
<p>
{i18n(cfg.locale).pages.tagContent.itemsUnderTag({ count: pages.length })}
{pages.length > numPages && (
<span>
{i18n(cfg.locale).pages.tagContent.showingFirst({ count: numPages })}
</span>
<>
{" "}
<span>
{i18n(cfg.locale).pages.tagContent.showingFirst({ count: numPages })}
</span>
</>
)}
</p>
<PageList limit={numPages} {...listProps} />
Expand Down
4 changes: 2 additions & 2 deletions quartz/i18n/locales/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ export default {
folderContent: {
folder: "Ordner",
itemsUnderFolder: ({ count }) =>
count === 1 ? "1 Datei in diesem Ordner" : `${count} Dateien in diesem Ordner.`,
count === 1 ? "1 Datei in diesem Ordner." : `${count} Dateien in diesem Ordner.`,
},
tagContent: {
tag: "Tag",
tagIndex: "Tag-Übersicht",
itemsUnderTag: ({ count }) =>
count === 1 ? "1 Datei mit diesem Tag" : `${count} Dateien mit diesem Tag.`,
count === 1 ? "1 Datei mit diesem Tag." : `${count} Dateien mit diesem Tag.`,
showingFirst: ({ count }) => `Die ersten ${count} Tags werden angezeigt.`,
totalTags: ({ count }) => `${count} Tags insgesamt.`,
},
Expand Down
4 changes: 2 additions & 2 deletions quartz/i18n/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ export default {
folderContent: {
folder: "Folder",
itemsUnderFolder: ({ count }) =>
count === 1 ? "1 item under this folder" : `${count} items under this folder.`,
count === 1 ? "1 item under this folder." : `${count} items under this folder.`,
},
tagContent: {
tag: "Tag",
tagIndex: "Tag Index",
itemsUnderTag: ({ count }) =>
count === 1 ? "1 item with this tag" : `${count} items with this tag.`,
count === 1 ? "1 item with this tag." : `${count} items with this tag.`,
showingFirst: ({ count }) => `Showing first ${count} tags.`,
totalTags: ({ count }) => `Found ${count} total tags.`,
},
Expand Down
4 changes: 2 additions & 2 deletions quartz/i18n/locales/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ export default {
folderContent: {
folder: "Carpeta",
itemsUnderFolder: ({ count }) =>
count === 1 ? "1 artículo en esta carpeta" : `${count} artículos en esta carpeta.`,
count === 1 ? "1 artículo en esta carpeta." : `${count} artículos en esta carpeta.`,
},
tagContent: {
tag: "Etiqueta",
tagIndex: "Índice de Etiquetas",
itemsUnderTag: ({ count }) =>
count === 1 ? "1 artículo con esta etiqueta" : `${count} artículos con esta etiqueta.`,
count === 1 ? "1 artículo con esta etiqueta." : `${count} artículos con esta etiqueta.`,
showingFirst: ({ count }) => `Mostrando las primeras ${count} etiquetas.`,
totalTags: ({ count }) => `Se encontraron ${count} etiquetas en total.`,
},
Expand Down
4 changes: 2 additions & 2 deletions quartz/i18n/locales/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ export default {
folderContent: {
folder: "Dossier",
itemsUnderFolder: ({ count }) =>
count === 1 ? "1 élément sous ce dossier" : `${count} éléments sous ce dossier.`,
count === 1 ? "1 élément sous ce dossier." : `${count} éléments sous ce dossier.`,
},
tagContent: {
tag: "Étiquette",
tagIndex: "Index des étiquettes",
itemsUnderTag: ({ count }) =>
count === 1 ? "1 élément avec cette étiquette" : `${count} éléments avec cette étiquette.`,
count === 1 ? "1 élément avec cette étiquette." : `${count} éléments avec cette étiquette.`,
showingFirst: ({ count }) => `Affichage des premières ${count} étiquettes.`,
totalTags: ({ count }) => `Trouvé ${count} étiquettes au total.`,
},
Expand Down
4 changes: 2 additions & 2 deletions quartz/i18n/locales/it-IT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ export default {
folderContent: {
folder: "Cartella",
itemsUnderFolder: ({ count }) =>
count === 1 ? "1 oggetto in questa cartella" : `${count} oggetti in questa cartella.`,
count === 1 ? "1 oggetto in questa cartella." : `${count} oggetti in questa cartella.`,
},
tagContent: {
tag: "Etichetta",
tagIndex: "Indice etichette",
itemsUnderTag: ({ count }) =>
count === 1 ? "1 oggetto con questa etichetta" : `${count} oggetti con questa etichetta.`,
count === 1 ? "1 oggetto con questa etichetta." : `${count} oggetti con questa etichetta.`,
showingFirst: ({ count }) => `Prime ${count} etichette.`,
totalTags: ({ count }) => `Trovate ${count} etichette totali.`,
},
Expand Down
2 changes: 1 addition & 1 deletion quartz/i18n/locales/nl-NL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default {
folderContent: {
folder: "Map",
itemsUnderFolder: ({ count }) =>
count === 1 ? "1 item in deze map" : `${count} items in deze map.`,
count === 1 ? "1 item in deze map." : `${count} items in deze map.`,
},
tagContent: {
tag: "Label",
Expand Down
4 changes: 2 additions & 2 deletions quartz/i18n/locales/uk-UA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ export default {
folderContent: {
folder: "Папка",
itemsUnderFolder: ({ count }) =>
count === 1 ? "У цій папці 1 елемент" : `Елементів у цій папці: ${count}.`,
count === 1 ? "У цій папці 1 елемент." : `Елементів у цій папці: ${count}.`,
},
tagContent: {
tag: "Тег",
tagIndex: "Індекс тегу",
itemsUnderTag: ({ count }) =>
count === 1 ? "1 елемент з цим тегом" : `Елементів з цим тегом: ${count}.`,
count === 1 ? "1 елемент з цим тегом." : `Елементів з цим тегом: ${count}.`,
showingFirst: ({ count }) => `Показ перших ${count} тегів.`,
totalTags: ({ count }) => `Всього знайдено тегів: ${count}.`,
},
Expand Down
4 changes: 2 additions & 2 deletions quartz/plugins/transformers/toc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Slugger from "github-slugger"

export interface Options {
maxDepth: 1 | 2 | 3 | 4 | 5 | 6
minEntries: 1
minEntries: number
showByDefault: boolean
collapseByDefault: boolean
}
Expand Down Expand Up @@ -52,7 +52,7 @@ export const TableOfContents: QuartzTransformerPlugin<Partial<Options> | undefin
}
})

if (toc.length > opts.minEntries) {
if (toc.length > 0 && toc.length > opts.minEntries) {
file.data.toc = toc.map((entry) => ({
...entry,
depth: entry.depth - highestDepth,
Expand Down

0 comments on commit 02973c5

Please sign in to comment.