From 85a737b4ee72fb4dba12e1aacbd87d1636cfc30e Mon Sep 17 00:00:00 2001 From: Xinyang Yu <47915643+xy-241@users.noreply.github.com> Date: Mon, 25 Mar 2024 00:33:53 +0800 Subject: [PATCH 1/6] docs: Update showcase.md (#1031) --- docs/showcase.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/showcase.md b/docs/showcase.md index 0509e93ab..4860e0be1 100644 --- a/docs/showcase.md +++ b/docs/showcase.md @@ -26,5 +26,6 @@ Want to see what Quartz can do? Here are some cool community gardens: - [Data Dictionary 🧠](https://glossary.airbyte.com/) - [sspaeti.com's Second Brain](https://brain.sspaeti.com/) - [🪴Aster's notebook](https://notes.asterhu.com) +- [🥷🏻🌳🍃 Computer Science & Thinkering Garden](https://notes.yxy.ninja) If you want to see your own on here, submit a [Pull Request adding yourself to this file](https://github.com/jackyzha0/quartz/blob/v4/docs/showcase.md)! From 6efc4dd724870c9e4fbc2e17651cc2a4f943c4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kun-Szab=C3=B3=20Krist=C3=B3f?= Date: Sun, 24 Mar 2024 17:35:07 +0100 Subject: [PATCH 2/6] i18n: add Hungarian translations (#1023) * add Hungarian translations * typo: _ instead of - in hu-HU * run prettier * revert prettier messing up tsconfig * Update hu-HU.ts --- quartz/i18n/index.ts | 2 + quartz/i18n/locales/hu-HU.ts | 81 ++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 quartz/i18n/locales/hu-HU.ts diff --git a/quartz/i18n/index.ts b/quartz/i18n/index.ts index b97368d96..53650098f 100644 --- a/quartz/i18n/index.ts +++ b/quartz/i18n/index.ts @@ -13,6 +13,7 @@ import ru from "./locales/ru-RU" import ko from "./locales/ko-KR" import zh from "./locales/zh-CN" import vi from "./locales/vi-VN" +import hu from "./locales/hu-HU" export const TRANSLATIONS = { "en-US": en, @@ -50,6 +51,7 @@ export const TRANSLATIONS = { "ko-KR": ko, "zh-CN": zh, "vi-VN": vi, + "hu-HU": hu, } as const export const defaultTranslation = "en-US" diff --git a/quartz/i18n/locales/hu-HU.ts b/quartz/i18n/locales/hu-HU.ts new file mode 100644 index 000000000..6397309b7 --- /dev/null +++ b/quartz/i18n/locales/hu-HU.ts @@ -0,0 +1,81 @@ +import { Translation } from "./definition" + +export default { + propertyDefaults: { + title: "Névtelen", + description: "Nincs leírás", + }, + components: { + callout: { + note: "Jegyzet", + abstract: "Abstract", + info: "Információ", + todo: "Tennivaló", + tip: "Tipp", + success: "Siker", + question: "Kérdés", + warning: "Figyelmeztetés", + failure: "Hiba", + danger: "Veszély", + bug: "Bug", + example: "Példa", + quote: "Idézet", + }, + backlinks: { + title: "Visszautalások", + noBacklinksFound: "Nincs visszautalás", + }, + themeToggle: { + lightMode: "Világos mód", + darkMode: "Sötét mód", + }, + explorer: { + title: "Fájlböngésző", + }, + footer: { + createdWith: "Készítve ezzel:", + }, + graph: { + title: "Grafikonnézet", + }, + recentNotes: { + title: "Legutóbbi jegyzetek", + seeRemainingMore: ({ remaining }) => `${remaining} további megtekintése →`, + }, + transcludes: { + transcludeOf: ({ targetSlug }) => `${targetSlug} áthivatkozása`, + linkToOriginal: "Hivatkozás az eredetire", + }, + search: { + title: "Keresés", + searchBarPlaceholder: "Keress valamire", + }, + tableOfContents: { + title: "Tartalomjegyzék", + }, + contentMeta: { + readingTime: ({ minutes }) => `${minutes} perces olvasás`, + }, + }, + pages: { + rss: { + recentNotes: "Legutóbbi jegyzetek", + lastFewNotes: ({ count }) => `Legutóbbi ${count} jegyzet`, + }, + error: { + title: "Nem található", + notFound: "Ez a lap vagy privát vagy nem létezik.", + }, + folderContent: { + folder: "Mappa", + itemsUnderFolder: ({ count }) => `Ebben a mappában ${count} elem található.`, + }, + tagContent: { + tag: "Címke", + tagIndex: "Címke index", + itemsUnderTag: ({ count }) => `${count} elem található ezzel a címkével.`, + showingFirst: ({ count }) => `Első ${count} címke megjelenítve.`, + totalTags: ({ count }) => `Összesen ${count} címke található.`, + }, + }, +} as const satisfies Translation From 70d86ff096a5f7ebe2bd75791b5fac865598b80b Mon Sep 17 00:00:00 2001 From: Jorge Marcelo Risco <61189874+jorgemrisco@users.noreply.github.com> Date: Sun, 24 Mar 2024 13:40:01 -0300 Subject: [PATCH 3/6] i18n: pt-BR translation (#1024) * i18n: pt-br * i18n: pt-br translation --------- Co-authored-by: Jacky Zhao --- quartz/i18n/index.ts | 2 + quartz/i18n/locales/pt-BR.ts | 83 ++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 quartz/i18n/locales/pt-BR.ts diff --git a/quartz/i18n/index.ts b/quartz/i18n/index.ts index 53650098f..6707ea35d 100644 --- a/quartz/i18n/index.ts +++ b/quartz/i18n/index.ts @@ -13,6 +13,7 @@ import ru from "./locales/ru-RU" import ko from "./locales/ko-KR" import zh from "./locales/zh-CN" import vi from "./locales/vi-VN" +import pt from "./locales/pt-BR" import hu from "./locales/hu-HU" export const TRANSLATIONS = { @@ -51,6 +52,7 @@ export const TRANSLATIONS = { "ko-KR": ko, "zh-CN": zh, "vi-VN": vi, + "pt-BR": pt, "hu-HU": hu, } as const diff --git a/quartz/i18n/locales/pt-BR.ts b/quartz/i18n/locales/pt-BR.ts new file mode 100644 index 000000000..b59c7b47b --- /dev/null +++ b/quartz/i18n/locales/pt-BR.ts @@ -0,0 +1,83 @@ +import { Translation } from "./definition" + +export default { + propertyDefaults: { + title: "Sem título", + description: "Sem descrição", + }, + components: { + callout: { + note: "Nota", + abstract: "Abstrato", + info: "Info", + todo: "Pendência", + tip: "Dica", + success: "Sucesso", + question: "Pergunta", + warning: "Aviso", + failure: "Falha", + danger: "Perigo", + bug: "Bug", + example: "Exemplo", + quote: "Citação", + }, + backlinks: { + title: "Backlinks", + noBacklinksFound: "Sem backlinks encontrados", + }, + themeToggle: { + lightMode: "Tema claro", + darkMode: "Tema escuro", + }, + explorer: { + title: "Explorador", + }, + footer: { + createdWith: "Criado com", + }, + graph: { + title: "Visão de gráfico", + }, + recentNotes: { + title: "Notas recentes", + seeRemainingMore: ({ remaining }) => `Veja mais ${remaining} →`, + }, + transcludes: { + transcludeOf: ({ targetSlug }) => `Transcrever de ${targetSlug}`, + linkToOriginal: "Link ao original", + }, + search: { + title: "Pesquisar", + searchBarPlaceholder: "Pesquisar por algo", + }, + tableOfContents: { + title: "Sumário", + }, + contentMeta: { + readingTime: ({ minutes }) => `Leitura de ${minutes} min`, + }, + }, + pages: { + rss: { + recentNotes: "Notas recentes", + lastFewNotes: ({ count }) => `Últimas ${count} notas`, + }, + error: { + title: "Não encontrado", + notFound: "Esta página é privada ou não existe.", + }, + folderContent: { + folder: "Arquivo", + itemsUnderFolder: ({ count }) => + count === 1 ? "1 item mneste arquivo." : `${count} items neste arquivo.`, + }, + tagContent: { + tag: "Tag", + tagIndex: "Sumário de Tags", + itemsUnderTag: ({ count }) => + count === 1 ? "1 item com esta tag." : `${count} items com esta tag.`, + showingFirst: ({ count }) => `Mostrando as ${count} primeiras tags.`, + totalTags: ({ count }) => `Encontradas ${count} tags.`, + }, + }, +} as const satisfies Translation From 8437d9da7242543c4903ecd7e4687cb2679af867 Mon Sep 17 00:00:00 2001 From: Emile Bangma Date: Sun, 24 Mar 2024 23:43:36 +0100 Subject: [PATCH 4/6] fix(style): LaTex/KaTeX overflow (#1027) * LaTex/KaTeX overflow fix * prettier * Add !important modifier * Added overflow-x override * Refactor without !important * Refactor scss notation * Formatting scss --- quartz/styles/base.scss | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 868dfdc79..1af96f6b0 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -513,3 +513,15 @@ ol.overflow { padding-left: 1rem; } } + +.katex-display { + overflow-x: auto; + overflow-y: visible; + + & > .katex .katex-html { + .base, + .strut { + display: inline; + } + } +} From 0a2b52f618c8a76a2f2a0e29223b5289c0225634 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sun, 24 Mar 2024 15:50:38 -0700 Subject: [PATCH 5/6] simpler katex fix --- docs/features/Latex.md | 11 +++++++++++ quartz/styles/base.scss | 9 +-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/features/Latex.md b/docs/features/Latex.md index b2bdb2dfb..fdc9d277b 100644 --- a/docs/features/Latex.md +++ b/docs/features/Latex.md @@ -39,6 +39,17 @@ a & b & c \end{bmatrix} $$ +$$ +\begin{array}{rll} +E \psi &= H\psi & \text{Expanding the Hamiltonian Operator} \\ +&= -\frac{\hbar^2}{2m}\frac{\partial^2}{\partial x^2} \psi + \frac{1}{2}m\omega x^2 \psi & \text{Using the ansatz $\psi(x) = e^{-kx^2}f(x)$, hoping to cancel the $x^2$ term} \\ +&= -\frac{\hbar^2}{2m} [4k^2x^2f(x)+2(-2kx)f'(x) + f''(x)]e^{-kx^2} + \frac{1}{2}m\omega x^2 f(x)e^{-kx^2} &\text{Removing the $e^{-kx^2}$ term from both sides} \\ +& \Downarrow \\ +Ef(x) &= -\frac{\hbar^2}{2m} [4k^2x^2f(x)-4kxf'(x) + f''(x)] + \frac{1}{2}m\omega x^2 f(x) & \text{Choosing $k=\frac{im}{2}\sqrt{\frac{\omega}{\hbar}}$ to cancel the $x^2$ term, via $-\frac{\hbar^2}{2m}4k^2=\frac{1}{2}m \omega$} \\ +&= -\frac{\hbar^2}{2m} [-4kxf'(x) + f''(x)] \\ +\end{array} +$$ + > [!warn] > Due to limitations in the [underlying parsing library](https://github.com/remarkjs/remark-math), block math in Quartz requires the `$$` delimiters to be on newlines like above. diff --git a/quartz/styles/base.scss b/quartz/styles/base.scss index 1af96f6b0..859bb433e 100644 --- a/quartz/styles/base.scss +++ b/quartz/styles/base.scss @@ -516,12 +516,5 @@ ol.overflow { .katex-display { overflow-x: auto; - overflow-y: visible; - - & > .katex .katex-html { - .base, - .strut { - display: inline; - } - } + overflow-y: hidden; } From d75928ad5cb99c87de40c1c884ddca6bf86163d5 Mon Sep 17 00:00:00 2001 From: Emile Bangma Date: Mon, 25 Mar 2024 00:23:25 +0100 Subject: [PATCH 6/6] fix(assets): pdf page linking support. (#1025) * github-slugger pdf workaround * Skip sluggifying on pdf file extension * Account for pdf files without anchor * Address feedback --- quartz/util/path.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/quartz/util/path.ts b/quartz/util/path.ts index dceb89bfa..c02bfb12d 100644 --- a/quartz/util/path.ts +++ b/quartz/util/path.ts @@ -168,6 +168,9 @@ export function resolveRelative(current: FullSlug, target: FullSlug | SimpleSlug export function splitAnchor(link: string): [string, string] { let [fp, anchor] = link.split("#", 2) + if (fp.endsWith(".pdf")) { + return [fp, anchor === undefined ? "" : `#${anchor}`] + } anchor = anchor === undefined ? "" : "#" + slugAnchor(anchor) return [fp, anchor] }