diff --git a/src/lib/components/MarkdownRenderer.svelte b/src/lib/components/MarkdownRenderer.svelte index b40b616..aaf3d5c 100644 --- a/src/lib/components/MarkdownRenderer.svelte +++ b/src/lib/components/MarkdownRenderer.svelte @@ -9,6 +9,7 @@ replaceGithubAdmonitions, sanitizeMarkdownHtml } from '$lib/markdown/rendering'; + import { markdownIcon } from '$lib/markdown/icons'; // 按需引入及注册主流核心前端、后端、运维语法包,替代沉重的 190+ 语言全集捆绑 import bash from 'highlight.js/lib/languages/bash'; @@ -256,18 +257,12 @@ }) .join('\n'); - const chevronRight = - ''; - const listOlIcon = - ''; - const barsIcon = - ''; - const copyIcon = - ''; - const checkIcon = - ''; - const ellipsisIcon = - ''; + const chevronRight = markdownIcon('chevron-right', 'chevron-icon'); + const listOlIcon = markdownIcon('list-ordered'); + const barsIcon = markdownIcon('text-wrap'); + const copyIcon = markdownIcon('copy'); + const checkIcon = markdownIcon('check'); + const ellipsisIcon = markdownIcon('ellipsis'); return `
@@ -311,30 +306,20 @@ function parseAdmonitions(markdown: string) { const icons = { - note: '', - abstract: - '', - info: '', - tip: '', - success: - '', - question: - '', - warning: - '', - failure: - '', - danger: - '', - bug: '', - example: - '', - quote: - '', - important: - '', - caution: - '' + note: markdownIcon('pencil'), + abstract: markdownIcon('text-align-start'), + info: markdownIcon('info'), + tip: markdownIcon('lightbulb'), + success: markdownIcon('circle-check'), + question: markdownIcon('circle-question-mark'), + warning: markdownIcon('triangle-alert'), + failure: markdownIcon('circle-x'), + danger: markdownIcon('zap'), + bug: markdownIcon('bug'), + example: markdownIcon('flask-conical'), + quote: markdownIcon('quote'), + important: markdownIcon('circle-alert'), + caution: markdownIcon('octagon-alert') }; let html = replaceGithubAdmonitions(markdown, (type, title, content) => { diff --git a/src/lib/components/Toast.svelte b/src/lib/components/Toast.svelte index 05009d3..506d6a6 100644 --- a/src/lib/components/Toast.svelte +++ b/src/lib/components/Toast.svelte @@ -1,5 +1,6 @@ @@ -12,68 +13,16 @@ out:fade={{ duration: 200 }} > {#if msg.type === 'success'} - - - +
{/each} @@ -125,7 +74,7 @@ color: #d9534f; } - .toast-icon { + .toast-msg :global(.toast-icon) { flex-shrink: 0; } diff --git a/src/lib/components/admin/DatePicker.svelte b/src/lib/components/admin/DatePicker.svelte index e2cd769..db3dd22 100644 --- a/src/lib/components/admin/DatePicker.svelte +++ b/src/lib/components/admin/DatePicker.svelte @@ -1,5 +1,6 @@ @@ -19,20 +20,7 @@
管理{$page.data.aliases?.post || '文章'} - + @@ -43,20 +31,7 @@ 撰写新{$page.data.aliases?.post || '文章'} - + @@ -67,20 +42,7 @@ 管理{$page.data.aliases?.page || '页面'} - + @@ -91,20 +53,7 @@ 管理{$page.data.aliases?.category || '分类'} - + @@ -115,20 +64,7 @@ 管理{$page.data.aliases?.tag || '标签'} - + @@ -139,20 +75,7 @@ 管理{$page.data.aliases?.series || '系列'} - + @@ -226,12 +149,12 @@ text-decoration: none; } - .arrow-icon { + .action-link :global(.arrow-icon) { margin-left: 6px; transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); } - .stat-card:hover .arrow-icon { + .stat-card:hover :global(.arrow-icon) { transform: translate(3px, -3px); } diff --git a/src/routes/admin/files/+page.svelte b/src/routes/admin/files/+page.svelte index 1b78a39..7da9460 100644 --- a/src/routes/admin/files/+page.svelte +++ b/src/routes/admin/files/+page.svelte @@ -2,6 +2,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { enhance } from '$app/forms'; + import { File, Upload } from 'lucide-svelte'; import type { ActionData, PageData } from './$types'; import { addToast } from '$lib/stores/toast.svelte'; import { confirmState } from '$lib/stores/confirm.svelte'; @@ -73,20 +74,7 @@ }} > @@ -110,19 +98,7 @@ {file.filename} {:else}
- - - - +
{/if} diff --git a/src/routes/admin/pages/+page.svelte b/src/routes/admin/pages/+page.svelte index d0cc172..4def110 100644 --- a/src/routes/admin/pages/+page.svelte +++ b/src/routes/admin/pages/+page.svelte @@ -1,6 +1,7 @@