diff --git a/quartz/i18n/locales/ar-SA.ts b/quartz/i18n/locales/ar-SA.ts index 0b059bab6..22994702c 100644 --- a/quartz/i18n/locales/ar-SA.ts +++ b/quartz/i18n/locales/ar-SA.ts @@ -94,6 +94,7 @@ export default { wrongPassword: "خاطئة. يرجى إعادة إدخال كلمة المرور لفتح القفل:", noPayload: "حمولة مشفرة.", decrypting: "جاري فك التشفير...", + defaultDescription: "هذه صفحة مشفرة", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/ca-ES.ts b/quartz/i18n/locales/ca-ES.ts index 8604a1239..f1e28e932 100644 --- a/quartz/i18n/locales/ca-ES.ts +++ b/quartz/i18n/locales/ca-ES.ts @@ -90,6 +90,7 @@ export default { wrongPassword: "Contrasenya incorrecta. Introduïu de nou la contrasenya per desbloquejar:", noPayload: "No hi ha càrrega útil xifrada.", decrypting: "Desxifrant...", + defaultDescription: "Aquesta és una pàgina xifrada", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/cs-CZ.ts b/quartz/i18n/locales/cs-CZ.ts index e4686a67b..9ea1ecfe6 100644 --- a/quartz/i18n/locales/cs-CZ.ts +++ b/quartz/i18n/locales/cs-CZ.ts @@ -89,6 +89,7 @@ export default { wrongPassword: "Nesprávné heslo. Zadejte heslo znovu pro odemknutí:", noPayload: "Není žádné šifrované užitečné zatížení.", decrypting: "Dekódování...", + defaultDescription: "Toto je šifrovaná stránka", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/de-DE.ts b/quartz/i18n/locales/de-DE.ts index c61a5b265..1e871323c 100644 --- a/quartz/i18n/locales/de-DE.ts +++ b/quartz/i18n/locales/de-DE.ts @@ -91,6 +91,7 @@ export default { "Falsches Passwort. Bitte geben Sie das Passwort erneut ein, um zu entsperren:", noPayload: "Keine verschlüsselte Nutzlast.", decrypting: "Entschlüsseln...", + defaultDescription: "Dies ist eine verschlüsselte Seite", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/definition.ts b/quartz/i18n/locales/definition.ts index d50f5ce73..49d77f947 100644 --- a/quartz/i18n/locales/definition.ts +++ b/quartz/i18n/locales/definition.ts @@ -89,6 +89,7 @@ export interface Translation { wrongPassword: string noPayload: string decrypting: string + defaultDescription: string } } } diff --git a/quartz/i18n/locales/en-GB.ts b/quartz/i18n/locales/en-GB.ts index a0ac07b9f..0d63017fa 100644 --- a/quartz/i18n/locales/en-GB.ts +++ b/quartz/i18n/locales/en-GB.ts @@ -89,6 +89,7 @@ export default { wrongPassword: "Wrong password. Please re-enter passsword to unlock:", noPayload: "No encrypted payload.", decrypting: "Decrypting...", + defaultDescription: "This is encrypted page", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/en-US.ts b/quartz/i18n/locales/en-US.ts index 23cd1db49..5e2ed062e 100644 --- a/quartz/i18n/locales/en-US.ts +++ b/quartz/i18n/locales/en-US.ts @@ -89,6 +89,7 @@ export default { wrongPassword: "Wrong password. Please re-enter passsword to unlock:", noPayload: "No encrypted payload.", decrypting: "Decrypting...", + defaultDescription: "This is encrypted page", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/es-ES.ts b/quartz/i18n/locales/es-ES.ts index f2acfd354..b4fe65f0a 100644 --- a/quartz/i18n/locales/es-ES.ts +++ b/quartz/i18n/locales/es-ES.ts @@ -90,6 +90,7 @@ export default { wrongPassword: "Contraseña incorrecta. Vuelva a introducir la contraseña para desbloquear:", noPayload: "No hay ninguna carga útil cifrada.", decrypting: "Descifrando...", + defaultDescription: "Esta es una página encriptada", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/fa-IR.ts b/quartz/i18n/locales/fa-IR.ts index c051175b2..9b68b868d 100644 --- a/quartz/i18n/locales/fa-IR.ts +++ b/quartz/i18n/locales/fa-IR.ts @@ -90,6 +90,7 @@ export default { wrongPassword: "رمز عبور اشتباه است. لطفا رمز عبور را دوباره وارد کنید تا قفل باز شود:", noPayload: "هیچ محموله رمزگذاری شده ای وجود ندارد.", decrypting: "در حال رمزگشایی...", + defaultDescription: "این صفحه رمزگذاری شده است", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/fr-FR.ts b/quartz/i18n/locales/fr-FR.ts index 51975ce41..ce8686be8 100644 --- a/quartz/i18n/locales/fr-FR.ts +++ b/quartz/i18n/locales/fr-FR.ts @@ -91,6 +91,7 @@ export default { "Mot de passe incorrect. Veuillez saisir à nouveau le mot de passe pour déverrouiller :", noPayload: "Aucune charge utile cryptée.", decrypting: "Décryptage en cours...", + defaultDescription: "Ceci est une page cryptée", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/hu-HU.ts b/quartz/i18n/locales/hu-HU.ts index 59fb06cf4..c7b1ef643 100644 --- a/quartz/i18n/locales/hu-HU.ts +++ b/quartz/i18n/locales/hu-HU.ts @@ -88,6 +88,7 @@ export default { wrongPassword: "Helytelen jelszó. Kérjük, adja meg újra a jelszót a feloldáshoz:", noPayload: "Nincs titkosított hasznos teher.", decrypting: "Dekódolás...", + defaultDescription: "Ez egy titkosított oldal", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/it-IT.ts b/quartz/i18n/locales/it-IT.ts index 4b19c50ce..685771cbb 100644 --- a/quartz/i18n/locales/it-IT.ts +++ b/quartz/i18n/locales/it-IT.ts @@ -90,6 +90,7 @@ export default { wrongPassword: "Password errato. Si prega di reinserire la password per sbloccare:", noPayload: "Nessun payload crittografato.", decrypting: "Decifrazione in corso...", + defaultDescription: "Questa è una pagina crittografata", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/ja-JP.ts b/quartz/i18n/locales/ja-JP.ts index 412a77dd4..9ef6e5c16 100644 --- a/quartz/i18n/locales/ja-JP.ts +++ b/quartz/i18n/locales/ja-JP.ts @@ -89,6 +89,7 @@ export default { "パスワードが間違っています。ロックを解除するにはパスワードを再度入力してください:", noPayload: "暗号化されたペイロードはありません。", decrypting: "解読中...", + defaultDescription: "これは暗号化されたページです", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/ko-KR.ts b/quartz/i18n/locales/ko-KR.ts index 1339e9ecc..046bdefdc 100644 --- a/quartz/i18n/locales/ko-KR.ts +++ b/quartz/i18n/locales/ko-KR.ts @@ -87,6 +87,7 @@ export default { wrongPassword: "비밀번호가 잘못되었습니다. 잠금을 해제하려면 암호를 다시 입력하십시오:", noPayload: "암호화된 페이로드가 없습니다.", decrypting: "해독 중...", + defaultDescription: "이 페이지는 암호화된 페이지입니다", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/lt-LT.ts b/quartz/i18n/locales/lt-LT.ts index e5c43a06c..299461372 100644 --- a/quartz/i18n/locales/lt-LT.ts +++ b/quartz/i18n/locales/lt-LT.ts @@ -110,6 +110,7 @@ export default { wrongPassword: "Neteisingas slaptažodis. Norėdami atrakinti, iš naujo įveskite slaptažodį:", noPayload: "Nėra užšifruoto naudingojo krovinio.", decrypting: "Iššifruojama...", + defaultDescription: "Tai yra šifruotas puslapis", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/nl-NL.ts b/quartz/i18n/locales/nl-NL.ts index f3ce080bb..ca84b1e0c 100644 --- a/quartz/i18n/locales/nl-NL.ts +++ b/quartz/i18n/locales/nl-NL.ts @@ -93,6 +93,7 @@ export default { "Verkeerd wachtwoord. Voer alstublieft uw wachtwoord opnieuw in om te ontgrendelen:", noPayload: "Geen versleutelde payload.", decrypting: "Ontsleutelen..", + defaultDescription: "Dit is een gecodeerde pagina", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/pl-PL.ts b/quartz/i18n/locales/pl-PL.ts index ab4ad8120..4eaa458ca 100644 --- a/quartz/i18n/locales/pl-PL.ts +++ b/quartz/i18n/locales/pl-PL.ts @@ -89,6 +89,7 @@ export default { wrongPassword: "Senha incorreta. Digite a senha novamente para desbloquear:", noPayload: "Nie ma zaszyfrowanego ładunku.", decrypting: "Deszyfrowanie...", + defaultDescription: "To jest zaszyfrowana strona", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/pt-BR.ts b/quartz/i18n/locales/pt-BR.ts index a34b2b88f..6741d0b03 100644 --- a/quartz/i18n/locales/pt-BR.ts +++ b/quartz/i18n/locales/pt-BR.ts @@ -89,6 +89,7 @@ export default { wrongPassword: "Parolă greșită. Vă rugăm să reintroduceți parola pentru a debloca:", noPayload: "Não há nenhuma carga útil criptografada.", decrypting: "Descifrando...", + defaultDescription: "Esta é uma página criptografada", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/ro-RO.ts b/quartz/i18n/locales/ro-RO.ts index a7b4aea6d..f04b90005 100644 --- a/quartz/i18n/locales/ro-RO.ts +++ b/quartz/i18n/locales/ro-RO.ts @@ -91,6 +91,7 @@ export default { wrongPassword: "Неправильний пароль. Будь ласка, введіть пароль ще раз, щоб розблокувати:", noPayload: "Nu există nicio sarcină utilă criptată.", decrypting: "Decriptare...", + defaultDescription: "Aceasta este o pagină criptată", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/ru-RU.ts b/quartz/i18n/locales/ru-RU.ts index c8197f862..888f348e4 100644 --- a/quartz/i18n/locales/ru-RU.ts +++ b/quartz/i18n/locales/ru-RU.ts @@ -92,6 +92,7 @@ export default { wrongPassword: "Неверный пароль. Пожалуйста, введите пароль еще раз для разблокировки:", noPayload: "Нет зашифрованной полезной нагрузки.", decrypting: "Расшифровка...", + defaultDescription: "Это зашифрованная страница", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/th-TH.ts b/quartz/i18n/locales/th-TH.ts index b624e389d..82be2f290 100644 --- a/quartz/i18n/locales/th-TH.ts +++ b/quartz/i18n/locales/th-TH.ts @@ -87,6 +87,7 @@ export default { wrongPassword: "รหัสผ่านผิด กรุณากรอกรหัสผ่านอีกครั้งเพื่อปลดล็อค:", noPayload: "ไม่มีเพย์โหลดที่เข้ารหัส", decrypting: "กำลังถอดรหัส...", + defaultDescription: "หน้านี้เป็นหน้าเข้ารหัส", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/tr-TR.ts b/quartz/i18n/locales/tr-TR.ts index 2c4180902..28f471659 100644 --- a/quartz/i18n/locales/tr-TR.ts +++ b/quartz/i18n/locales/tr-TR.ts @@ -90,6 +90,7 @@ export default { wrongPassword: "Yanlış şifre. Kilidi açmak için lütfen şifreyi tekrar girin:", noPayload: "Şifrelenmiş yük yok.", decrypting: "Şifre çözülüyor...", + defaultDescription: "Bu şifrelenmiş bir sayfadır", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/uk-UA.ts b/quartz/i18n/locales/uk-UA.ts index ffde3fa68..f61b9fab2 100644 --- a/quartz/i18n/locales/uk-UA.ts +++ b/quartz/i18n/locales/uk-UA.ts @@ -89,6 +89,7 @@ export default { wrongPassword: "Неправильний пароль. Будь ласка, введіть пароль ще раз, щоб розблокувати:", noPayload: "Немає зашифрованого корисного навантаження.", decrypting: "Розшифровка...", + defaultDescription: "Це зашифрована сторінка", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/vi-VN.ts b/quartz/i18n/locales/vi-VN.ts index afbab2f5c..288563ace 100644 --- a/quartz/i18n/locales/vi-VN.ts +++ b/quartz/i18n/locales/vi-VN.ts @@ -89,6 +89,7 @@ export default { wrongPassword: "Sai mật khẩu. Vui lòng điền lại mật khẩu để mở khóa:", noPayload: "Không có nội dung được mã hóa.", decrypting: "Đang giải mã...", + defaultDescription: "Trang này đã được mã hóa", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/zh-CN.ts b/quartz/i18n/locales/zh-CN.ts index bbcef526f..6e021e8d1 100644 --- a/quartz/i18n/locales/zh-CN.ts +++ b/quartz/i18n/locales/zh-CN.ts @@ -87,6 +87,7 @@ export default { wrongPassword: "密码错误。请重新输入密码解锁:", noPayload: "没有加密的有效负载。", decrypting: "解密中...", + defaultDescription: "这是加密页面", }, }, } as const satisfies Translation diff --git a/quartz/i18n/locales/zh-TW.ts b/quartz/i18n/locales/zh-TW.ts index 8e7d81cda..b6183ecfc 100644 --- a/quartz/i18n/locales/zh-TW.ts +++ b/quartz/i18n/locales/zh-TW.ts @@ -87,6 +87,7 @@ export default { wrongPassword: "密碼錯誤。請重新輸入密碼解鎖:", noPayload: "沒有加密的有效負載。", decrypting: "解密中...", + defaultDescription: "這是加密頁面", }, }, } as const satisfies Translation diff --git a/quartz/plugins/emitters/contentIndex.ts b/quartz/plugins/emitters/contentIndex.ts index c0fef86d2..4844baf1b 100644 --- a/quartz/plugins/emitters/contentIndex.ts +++ b/quartz/plugins/emitters/contentIndex.ts @@ -125,10 +125,11 @@ export const ContentIndex: QuartzEmitterPlugin> = (opts) => { title: file.data.frontmatter?.title!, links: file.data.links ?? [], tags: file.data.frontmatter?.tags ?? [], - content: file.data.text ?? "", - richContent: opts?.rssFullHtml - ? escapeHTML(toHtml(tree as Root, { allowDangerousHtml: true })) - : undefined, + content: file.data.text && !file.data.frontmatter?.password ? file.data.text : "", + richContent: + opts?.rssFullHtml && !file.data.frontmatter?.password + ? escapeHTML(toHtml(tree as Root, { allowDangerousHtml: true })) + : undefined, date: date, description: file.data.description ?? "", }) diff --git a/quartz/plugins/transformers/description.ts b/quartz/plugins/transformers/description.ts index c7e592ee9..f44122937 100644 --- a/quartz/plugins/transformers/description.ts +++ b/quartz/plugins/transformers/description.ts @@ -2,6 +2,7 @@ import { Root as HTMLRoot } from "hast" import { toString } from "hast-util-to-string" import { QuartzTransformerPlugin } from "../types" import { escapeHTML } from "../../util/escape" +import { i18n } from "../../i18n" export interface Options { descriptionLength: number @@ -22,7 +23,7 @@ export const Description: QuartzTransformerPlugin> = (userOpts) const opts = { ...defaultOptions, ...userOpts } return { name: "Description", - htmlPlugins() { + htmlPlugins(ctx) { return [ () => { return async (tree: HTMLRoot, file) => { @@ -37,7 +38,10 @@ export const Description: QuartzTransformerPlugin> = (userOpts) text = text.replace(urlRegex, "$" + "$") } - const desc = frontMatterDescription ?? text + const desc = + (frontMatterDescription ?? file.data.frontmatter?.password) + ? i18n(ctx.cfg.configuration.locale).pages.encryptedContent.defaultDescription + : text const sentences = desc.replace(/\s+/g, " ").split(/\.\s/) const finalDesc: string[] = [] const len = opts.descriptionLength