diff options
| author | Verdant <i@yingyu5658.me> | 2026-02-28 21:44:04 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-28 21:44:04 +0800 |
| commit | d369dacf5bad0079d75cf65e1dcfe01b4a313364 (patch) | |
| tree | 089440f5ecaf79c836d85d5ac68782ec5280f77f /layouts/_markup/render-blockquote.html | |
| parent | 5e57e61a0e42b269c6e2f9d9ef067253c911f7a4 (diff) | |
| parent | 96b88e99201b4aabd3eabf0453ab75a5f34d17df (diff) | |
| download | blog-d369dacf5bad0079d75cf65e1dcfe01b4a313364.tar.gz blog-d369dacf5bad0079d75cf65e1dcfe01b4a313364.zip | |
Merge pull request #2 from yingyu5658/refactor/style
Refactor/style
Diffstat (limited to 'layouts/_markup/render-blockquote.html')
| -rw-r--r-- | layouts/_markup/render-blockquote.html | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/layouts/_markup/render-blockquote.html b/layouts/_markup/render-blockquote.html new file mode 100644 index 0000000..c11de7e --- /dev/null +++ b/layouts/_markup/render-blockquote.html @@ -0,0 +1,107 @@ +<!-- 来自:https://github.com/BigCoke233/geek-death-project/blob/master/layouts/_markup/render-blockquote.html --> + +<style> + +/* 图标/标题所在的第一个 div */ +blockquote[class*="alert-"] > div:first-child { + font-size: 1.25rem; + font-weight: bold; + user-select: none; +} + +/* 2. 针对不同类型的具体配色 */ + +/* Note - 信息提示 - 蓝色 */ +.alert-note { + border-left-color: #2196f3; +} +.alert-note > div:first-child { + color: #2196f3; +} + +/* Tip - 技巧/建议 - 绿色 */ +.alert-tip { + border-left-color: #4caf50; +} +.alert-tip > div:first-child { + color: #4caf50; +} + +/* Warning - 警告 - 橙色 */ +.alert-warning { + border-left-color: #ff9800; +} +.alert-warning > div:first-child { + color: #ff9800; +} + +/* Caution - 危险/注意 - 红色 */ +.alert-caution { + border-left-color: #f44336; +} +.alert-caution > div:first-child { + color: #f44336; +} + +/* Important - 重要 - 紫色/深蓝 */ +.alert-important { + border-left-color: #9c27b0; +} +.alert-important > div:first-child { + color: #9c27b0; +} + +/* Announcement - 公告 - 青色 */ +.alert-announcement { + border-left-color: #00bcd4; +} +.alert-announcement > div:first-child { + color: #00bcd4; +} + +/* 3. 普通 blockquote 样式 (非 Alert) */ +blockquote.text-secondary { + border-left: 3px solid #e0e0e0; + color: #666; + padding-left: 1.5rem !important; /* 覆盖 p-0 */ +} + +/* 适配暗色模式 (可选) */ +@media (prefers-color-scheme: dark) { + blockquote.text-secondary { + border-left-color: #444; + color: #aaa; + } +} +</style> + + +{{ $emojis := dict + "caution" "🚨" + "important" "☝️" + "note" "ℹ️" + "tip" "💡" + "warning" "⚠️" + "announcement" "📣" +}} + +{{ if eq .Type "alert" }} + <blockquote class="rounded-1 leading-[1.75] mx-0 px-5 + flex gap-3 my-2 alert-{{ .AlertType }}" + > + <div class="py-5"> + {{ with .AlertTitle }} + {{.}} + {{ else }} + {{ index $emojis .AlertType }} + {{ end }} + </div> + <div> + {{ .Text }} + </div> + </blockquote> +{{ else }} + <blockquote class="text-secondary p-0 m-0 ml-[1em]"> + {{ .Text }} + </blockquote> +{{ end }} |
