diff --git a/demo/content/post/Markdown Syntax/index.md b/demo/content/post/Markdown Syntax/index.md index eb2678f..1b40b14 100644 --- a/demo/content/post/Markdown Syntax/index.md +++ b/demo/content/post/Markdown Syntax/index.md @@ -49,16 +49,19 @@ The blockquote element represents content that is quoted from another source, op ### Blockquote with alert -> [!NOTE] +> [!NOTE] > Highlights information that users should take into account, even when skimming. +> [!NOTE] Custom title +> You can also provide a custom title for the note alert. + > [!TIP] > Optional information to help a user be more successful. -> [!IMPORTANT] +> [!IMPORTANT] > Crucial information necessary for users to succeed. -> [!WARNING] +> [!WARNING] > Critical content demanding immediate user attention due to potential risks. > [!CAUTION] diff --git a/demo/content/post/Markdown Syntax/index.zh.md b/demo/content/post/Markdown Syntax/index.zh.md index 34584c4..14a8c86 100644 --- a/demo/content/post/Markdown Syntax/index.zh.md +++ b/demo/content/post/Markdown Syntax/index.zh.md @@ -49,21 +49,24 @@ Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sap ### 带提示的引用 -> [!NOTE] +> [!NOTE] > 突出显示用户在快速浏览时也应注意的信息。 > [!TIP] > 可选信息,帮助用户更顺利地完成任务。 -> [!IMPORTANT] +> [!IMPORTANT] > 用户成功所必需的关键信息。 -> [!WARNING] +> [!WARNING] > 由于潜在风险而需要用户立即关注的关键内容。 > [!CAUTION] > 某个操作可能带来的负面后果。 +> [!NOTE] 自定义标题 +> 如果你想使用自定义标题,可以在方括号后面添加标题文本,如上所示。 + ## 表格 (Tables) 表格虽然不是 Markdown 核心规范的一部分,但 Hugo 出箱即用地支持它们。 diff --git a/i18n/ar.toml b/i18n/ar.toml index e6f86fa..d7b3b6f 100644 --- a/i18n/ar.toml +++ b/i18n/ar.toml @@ -22,6 +22,13 @@ darkMode = "الوضع الداكن" one = "تُقرأ خلال دقيقة" other = "تُقرأ خلال {{ .Count }} دقائق" + [article.alert] + note = "ملاحظة" + tip = "نصيحة" + important = "مهم" + warning = "تحذير" + caution = "تنبيه" + [notFound] title = "غير موجود" subtitle = "تعذر العثور على الصفحة المطلوبة." diff --git a/i18n/be.toml b/i18n/be.toml index a06fc6d..020e2c8 100644 --- a/i18n/be.toml +++ b/i18n/be.toml @@ -23,6 +23,13 @@ darkMode = "Цёмны рэжым" tableOfContents = "Змест" readingTime = "Час чытання: {{ .Count }} хв." + [article.alert] + note = "Заўвага" + tip = "Парада" + important = "Важна" + warning = "Папярэджанне" + caution = "Асцярога" + [notFound] title = "Не знойдзена" subtitle = "Запытваемая старонка не існуе" diff --git a/i18n/bg.toml b/i18n/bg.toml index 622de04..c455d0e 100644 --- a/i18n/bg.toml +++ b/i18n/bg.toml @@ -22,6 +22,13 @@ darkMode = "Тъмен Режим" one = "{{ .Count }} minute read" other = "{{ .Count }} minute read" + [article.alert] + note = "Бележка" + tip = "Съвет" + important = "Важно" + warning = "Предупреждение" + caution = "Внимание" + [notFound] title = "Не е намерено" subtitle = "Страницата която търсите не е открита" diff --git a/i18n/bn.toml b/i18n/bn.toml index bf1ac58..2d1046e 100644 --- a/i18n/bn.toml +++ b/i18n/bn.toml @@ -22,6 +22,13 @@ darkMode = "ডার্ক মোড" one = "{{ .Count }} মিনিটে পড়া যাবে" other = "{{ .Count }} মিনিটে পড়া যাবে" + [article.alert] + note = "টীকা" + tip = "পরামর্শ" + important = "গুরুত্বপূর্ণ" + warning = "সতর্কতা" + caution = "সাবধানতা" + [notFound] title = "পাওয়া যায়নি" subtitle = "এই পাতাটি বিদ্যমান নেই" diff --git a/i18n/ca.toml b/i18n/ca.toml index a8a915d..3588cda 100644 --- a/i18n/ca.toml +++ b/i18n/ca.toml @@ -22,6 +22,13 @@ darkMode = "Mode fosc" one = "{{ .Count }} minut a llegir" other = "{{ .Count }} minuts a llegir" + [article.alert] + note = "Nota" + tip = "Consell" + important = "Important" + warning = "Avís" + caution = "Precaució" + [notFound] title = "No Trobat" subtitle = "Aquesta pàgina no existeix" diff --git a/i18n/cs.toml b/i18n/cs.toml index af6d5e4..17a9ae4 100644 --- a/i18n/cs.toml +++ b/i18n/cs.toml @@ -22,6 +22,13 @@ darkMode = "Tmavý režim" one = "{{ .Count }} minuta" other = "{{ .Count }} minut" + [article.alert] + note = "Poznámka" + tip = "Tip" + important = "Důležité" + warning = "Varování" + caution = "Upozornění" + [notFound] title = "Nenalezeno" subtitle = "Tato stránka neexistuje" diff --git a/i18n/de.toml b/i18n/de.toml index e685a86..5d20565 100644 --- a/i18n/de.toml +++ b/i18n/de.toml @@ -22,6 +22,13 @@ darkMode = "Dunkler Modus" one = "{{ .Count }} Minute Lesezeit" other = "{{ .Count }} Minuten Lesezeit" + [article.alert] + note = "Hinweis" + tip = "Tipp" + important = "Wichtig" + warning = "Warnung" + caution = "Vorsicht" + [notFound] title = "Seite nicht gefunden" subtitle = "Diese Seite existiert nicht" diff --git a/i18n/el.toml b/i18n/el.toml index 627d4c1..31c7576 100644 --- a/i18n/el.toml +++ b/i18n/el.toml @@ -22,6 +22,13 @@ darkMode = "Σκοτεινό θέμα" one = "{{ .Count }} λεπτό ανάγνωσης" other = "{{ .Count }} λεπτά ανάγνωσης" + [article.alert] + note = "Σημείωση" + tip = "Συμβουλή" + important = "Σημαντικό" + warning = "Προειδοποίηση" + caution = "Προσοχή" + [notFound] title = "Δε βρέθηκε" subtitle = "Η σελίδα δε βρέθηκε." diff --git a/i18n/en.toml b/i18n/en.toml index 0e48244..f1affad 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -22,6 +22,13 @@ darkMode = "Dark Mode" one = "{{ .Count }} minute read" other = "{{ .Count }} minutes read" + [article.alert] + note = "Note" + tip = "Tip" + important = "Important" + warning = "Warning" + caution = "Caution" + [notFound] title = "Not Found" subtitle = "This page does not exist" diff --git a/i18n/es.toml b/i18n/es.toml index 3d377ef..09f2227 100644 --- a/i18n/es.toml +++ b/i18n/es.toml @@ -22,6 +22,13 @@ darkMode = "Modo oscuro" one = "Tiempo de lectura {{ .Count }} minuto" other = "Tiempo de lectura {{ .Count }} minutos" + [article.alert] + note = "Nota" + tip = "Consejo" + important = "Importante" + warning = "Advertencia" + caution = "Precaución" + [notFound] title = "No Encontrado" subtitle = "Esta página no existe" diff --git a/i18n/fa.toml b/i18n/fa.toml index 1a26003..694a0ff 100644 --- a/i18n/fa.toml +++ b/i18n/fa.toml @@ -22,6 +22,13 @@ darkMode = "حالت شب" one = "مطالعه در {{ .Count }} دقیقه" other = "مطالعه در {{ .Count }} دقیقه" + [article.alert] + note = "یادداشت" + tip = "نکته" + important = "مهم" + warning = "هشدار" + caution = "احتیاط" + [notFound] title = "یافت نشد" subtitle = "این صحه وجود ندارد" diff --git a/i18n/fr.toml b/i18n/fr.toml index 5d4aa6a..2a421d7 100644 --- a/i18n/fr.toml +++ b/i18n/fr.toml @@ -22,6 +22,13 @@ darkMode = "Mode sombre" one = "{{ .Count }} minute de lecture" other = "{{ .Count }} minutes de lecture" + [article.alert] + note = "Note" + tip = "Astuce" + important = "Important" + warning = "Avertissement" + caution = "Attention" + [notFound] title = "Page non trouvée" subtitle = "Cette page n'existe pas." diff --git a/i18n/hi.toml b/i18n/hi.toml index 2c2f9d2..57ead7a 100644 --- a/i18n/hi.toml +++ b/i18n/hi.toml @@ -22,6 +22,13 @@ darkMode = "डार्क मोड" one = "{{ .Count }} मिनट पढ़ें" other = "{{ .Count }} मिनट पढ़ें" + [article.alert] + note = "नोट" + tip = "सलाह" + important = "महत्वपूर्ण" + warning = "चेतावनी" + caution = "सावधानी" + [notFound] title = "404 नहीं मिला।" subtitle = "यह पृष्ठ मौजूद नहीं है।" diff --git a/i18n/hu.toml b/i18n/hu.toml index 483b7d5..e8554d3 100644 --- a/i18n/hu.toml +++ b/i18n/hu.toml @@ -22,6 +22,13 @@ darkMode = "Sötét Mód" one = "{{ .Count }} percnyi olvasmány" other = "{{ .Count }} percnyi olvasmány" + [article.alert] + note = "Megjegyzés" + tip = "Tipp" + important = "Fontos" + warning = "Figyelmeztetés" + caution = "Óvatosság" + [notFound] title = "Nem található" subtitle = "Ez az oldal nem létezik" diff --git a/i18n/id.toml b/i18n/id.toml index d080d81..96b92b2 100644 --- a/i18n/id.toml +++ b/i18n/id.toml @@ -22,6 +22,13 @@ darkMode = "Mode Gelap" one = "Waktu Membaca: {{ .Count }} menit" other = "Waktu Membaca: {{ .Count }} menit" + [article.alert] + note = "Catatan" + tip = "Tips" + important = "Penting" + warning = "Peringatan" + caution = "Perhatian" + [notFound] title = "Tidak ditemukan" subtitle = "Halaman yang Anda akses tidak ditemukan." diff --git a/i18n/it.toml b/i18n/it.toml index 68df941..f95191c 100644 --- a/i18n/it.toml +++ b/i18n/it.toml @@ -22,6 +22,13 @@ darkMode = "Modalità scura" one = "{{ .Count }} min per leggere" other = "{{ .Count }} min per leggere" + [article.alert] + note = "Nota" + tip = "Suggerimento" + important = "Importante" + warning = "Avvertenza" + caution = "Attenzione" + [notFound] title = "Non trovato" subtitle = "Questa pagina non esiste." diff --git a/i18n/ja.toml b/i18n/ja.toml index 10e6d2c..81b1130 100644 --- a/i18n/ja.toml +++ b/i18n/ja.toml @@ -13,6 +13,13 @@ darkMode = "ダークモード" lastUpdatedOn = "最終更新" readingTime = "読了時間: {{ .Count }}分" + [article.alert] + note = "注記" + tip = "ヒント" + important = "重要" + warning = "警告" + caution = "注意" + [notFound] title = "404 Not Found" subtitle = "指定されたページは存在しません。" diff --git a/i18n/ko.toml b/i18n/ko.toml index 8d7590a..6bbcb63 100644 --- a/i18n/ko.toml +++ b/i18n/ko.toml @@ -22,6 +22,13 @@ darkMode = "다크 모드" one = "{{ .Count }} 분 정도" other = "{{ .Count }} 분 정도" + [article.alert] + note = "참고" + tip = "팁" + important = "중요" + warning = "경고" + caution = "주의" + [notFound] title = "찾을 수 없음" subtitle = "페이지를 찾을 수 없습니다." diff --git a/i18n/nl.toml b/i18n/nl.toml index 3a9bba3..405c7fe 100644 --- a/i18n/nl.toml +++ b/i18n/nl.toml @@ -17,6 +17,13 @@ darkMode = "Donkere modus" lastUpdatedOn = "Laatst bijgewerkt op" readingTime = "{{ .Count }} leestijd" + [article.alert] + note = "Opmerking" + tip = "Tip" + important = "Belangrijk" + warning = "Waarschuwing" + caution = "Let op" + [notFound] title = "Niet gevonden" subtitle = "Deze pagina bestaat niet." diff --git a/i18n/oc.toml b/i18n/oc.toml index fce98e2..f7d5d03 100644 --- a/i18n/oc.toml +++ b/i18n/oc.toml @@ -22,6 +22,13 @@ darkMode = "Mòde fosc" one = "{{ .Count }} minuta de lectura" other = "{{ .Count }} minutas de lectura" + [article.alert] + note = "Nòta" + tip = "Conselh" + important = "Important" + warning = "Avertiment" + caution = "Atencion" + [notFound] title = "Non trobat" subtitle = "Aquesta pagina existís pas" diff --git a/i18n/pl.toml b/i18n/pl.toml index 150c07c..b2f8667 100644 --- a/i18n/pl.toml +++ b/i18n/pl.toml @@ -28,6 +28,13 @@ darkMode = "Tryb ciemny" many = "Przeczytasz w {{ .Count }} minut" other = "Przeczytasz w {{ .Count }} minut" + [article.alert] + note = "Notatka" + tip = "Wskazówka" + important = "Ważne" + warning = "Ostrzeżenie" + caution = "Uwaga" + [notFound] title = "Nie znaleziono" subtitle = "Ta strona nie istnieje" diff --git a/i18n/pt-br.toml b/i18n/pt-br.toml index 9423069..dc25b58 100644 --- a/i18n/pt-br.toml +++ b/i18n/pt-br.toml @@ -22,6 +22,13 @@ darkMode = "Modo Escuro" one = "{{ .Count }} minuto de leitura" other = "{{ .Count }} minutos de leitura" + [article.alert] + note = "Nota" + tip = "Dica" + important = "Importante" + warning = "Aviso" + caution = "Cuidado" + [notFound] title = "Não Encontrado" subtitle = "Esta página não existe." diff --git a/i18n/pt-pt.toml b/i18n/pt-pt.toml index 753810d..74c9d19 100644 --- a/i18n/pt-pt.toml +++ b/i18n/pt-pt.toml @@ -22,6 +22,13 @@ darkMode = "Modo Escuro" one = "{{ .Count }} minuto de leitura" other = "{{ .Count }} minutos de leitura" + [article.alert] + note = "Nota" + tip = "Dica" + important = "Importante" + warning = "Aviso" + caution = "Cuidado" + [notFound] title = "Não Encontrado" subtitle = "Esta página não existe." diff --git a/i18n/ru.toml b/i18n/ru.toml index e9fab56..2ab0340 100644 --- a/i18n/ru.toml +++ b/i18n/ru.toml @@ -23,6 +23,13 @@ darkMode = "Тёмный режим" tableOfContents = "Содержание" readingTime = "Время чтения: {{ .Count }} мин." + [article.alert] + note = "Примечание" + tip = "Совет" + important = "Важно" + warning = "Предупреждение" + caution = "Осторожно" + [notFound] title = "Не найдено" subtitle = "Запрашиваемая страница не существует" diff --git a/i18n/sk.toml b/i18n/sk.toml index f02b486..d2225fa 100644 --- a/i18n/sk.toml +++ b/i18n/sk.toml @@ -22,6 +22,13 @@ darkMode = "Tmavý režim" one = "{{ .Count }} minúta" other = "{{ .Count }} minút" + [article.alert] + note = "Poznámka" + tip = "Tip" + important = "Dôležité" + warning = "Varovanie" + caution = "Upozornenie" + [notFound] title = "Nenájdené" subtitle = "Tato stránka neexistuje" diff --git a/i18n/th.toml b/i18n/th.toml index 9612dc0..7b828a7 100644 --- a/i18n/th.toml +++ b/i18n/th.toml @@ -22,6 +22,13 @@ darkMode = "ธีมมืด" one = "น่าจะใช้เวลา {{ .Count }} นาทีในการอ่าน" other = "น่าจะใช้เวลา {{ .Count }} นาทีในการอ่าน" + [article.alert] + note = "หมายเหตุ" + tip = "เคล็ดลับ" + important = "สำคัญ" + warning = "คำเตือน" + caution = "ระวัง" + [notFound] title = "ไม่พบหัวข้อ" subtitle = "ไม่พบหน้านี้ในระบบ" diff --git a/i18n/tr.toml b/i18n/tr.toml index 15272c5..7997a72 100644 --- a/i18n/tr.toml +++ b/i18n/tr.toml @@ -22,6 +22,13 @@ darkMode = "Koyu Mod" one = "{{ .Count }} dakika okuma süresi" other = "{{ .Count }} dakika okuma süresi" + [article.alert] + note = "Not" + tip = "İpucu" + important = "Önemli" + warning = "Uyarı" + caution = "Dikkat" + [notFound] title = "Bulunamadı" subtitle = "Aradığınız sayfa mevcut değil." diff --git a/i18n/uk.toml b/i18n/uk.toml index e917559..fd62c79 100644 --- a/i18n/uk.toml +++ b/i18n/uk.toml @@ -23,6 +23,13 @@ darkMode = "Темна тема" one = "Час читання: {{ .Count }} хв" other = "Час читання: {{ .Count }} хв" + [article.alert] + note = "Примітка" + tip = "Порада" + important = "Важливо" + warning = "Попередження" + caution = "Обережно" + [notFound] title = "Не знайдено" subtitle = "Ця сторінка не існує" diff --git a/i18n/vi.toml b/i18n/vi.toml index 5f48860..16824b5 100644 --- a/i18n/vi.toml +++ b/i18n/vi.toml @@ -22,6 +22,13 @@ darkMode = "Chế độ nền tối" one = "{{ .Count }} phút đọc" other = "{{ .Count }} phút đọc" + [article.alert] + note = "Ghi chú" + tip = "Mẹo" + important = "Quan trọng" + warning = "Cảnh báo" + caution = "Thận trọng" + [notFound] title = "Không tìm thấy" subtitle = "Trang này không tồn tại" diff --git a/i18n/zh-hant-hk.toml b/i18n/zh-hant-hk.toml index f9c4d37..9b8d5bb 100644 --- a/i18n/zh-hant-hk.toml +++ b/i18n/zh-hant-hk.toml @@ -13,6 +13,13 @@ darkMode = "深色模式" lastUpdatedOn = "上次改過於" readingTime = "閱讀時間 {{ .Count }} 分鐘" + [article.alert] + note = "備註" + tip = "提示" + important = "重要" + warning = "警告" + caution = "注意" + [notFound] title = "找不到頁面" subtitle = "本頁面並不存在" diff --git a/i18n/zh-hant-tw.toml b/i18n/zh-hant-tw.toml index 307abe0..84e5ffd 100644 --- a/i18n/zh-hant-tw.toml +++ b/i18n/zh-hant-tw.toml @@ -13,6 +13,13 @@ darkMode = "夜晚模式" lastUpdatedOn = "最後更新" readingTime = "閱讀時間: {{ .Count }} 分鐘" + [article.alert] + note = "備註" + tip = "提示" + important = "重要" + warning = "警告" + caution = "注意" + [notFound] title = "404 錯誤" subtitle = "頁面不存在" diff --git a/i18n/zh.toml b/i18n/zh.toml index 0230b95..2c62ecc 100644 --- a/i18n/zh.toml +++ b/i18n/zh.toml @@ -13,6 +13,13 @@ darkMode = "暗色模式" lastUpdatedOn = "最后更新于" readingTime = "阅读时长: {{ .Count }} 分钟" + [article.alert] + note = "备注" + tip = "提示" + important = "重要" + warning = "警告" + caution = "注意" + [notFound] title = "404 错误" subtitle = "页面不存在" diff --git a/layouts/_markup/render-blockquote.html b/layouts/_markup/render-blockquote.html index b1de8b5..032afbd 100644 --- a/layouts/_markup/render-blockquote.html +++ b/layouts/_markup/render-blockquote.html @@ -1,20 +1,26 @@ -{{- $type := .AlertType -}} -{{- $icons := site.Params.article.alertIcon -}} -{{- $icon := index $icons $type -}} - -
- {{- if $type -}} +{{ if eq .Type "alert" }} + {{- $type := .AlertType -}} + {{- $icons := site.Params.article.alertIcon -}} + {{- $icon := index $icons $type -}} ++{{ end }} \ No newline at end of file+- {{- title $type -}} + {{- with .AlertTitle -}} + {{ . }} + {{- else -}} + {{ or (i18n (printf "article.alert.%s" $type)) (title $type) }} + {{- end -}}- {{- end -}} - -+-+ {{ .Text }} ++ +{{ else }} +{{ .Text }} -