This commit is contained in:
1 parent
daf1e5655c
commit
7b306645a7
16 files changed
+113
-407
No files matched your search
@@ -9,6 +9,7 @@
|
|||||||
replaceGithubAdmonitions,
|
replaceGithubAdmonitions,
|
||||||
sanitizeMarkdownHtml
|
sanitizeMarkdownHtml
|
||||||
} from '$lib/markdown/rendering';
|
} from '$lib/markdown/rendering';
|
||||||
|
import { markdownIcon } from '$lib/markdown/icons';
|
||||||
|
|
||||||
// 按需引入及注册主流核心前端、后端、运维语法包,替代沉重的 190+ 语言全集捆绑
|
// 按需引入及注册主流核心前端、后端、运维语法包,替代沉重的 190+ 语言全集捆绑
|
||||||
import bash from 'highlight.js/lib/languages/bash';
|
import bash from 'highlight.js/lib/languages/bash';
|
||||||
@@ -256,18 +257,12 @@
|
|||||||
})
|
})
|
||||||
.join('\n');
|
.join('\n');
|
||||||
|
|
||||||
const chevronRight =
|
const chevronRight = markdownIcon('chevron-right', 'chevron-icon');
|
||||||
'<svg class="chevron-icon" viewBox="0 0 320 512" fill="currentColor" width="0.625em" height="1em"><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"></path></svg>';
|
const listOlIcon = markdownIcon('list-ordered');
|
||||||
const listOlIcon =
|
const barsIcon = markdownIcon('text-wrap');
|
||||||
'<svg viewBox="0 0 512 512" fill="currentColor" width="1em" height="1em"><path d="M61.77 401l17.5-20.15a19.92 19.92 0 0 0 5.07-14.19v-3.31C84.34 356 80.5 352 73 352H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h22.83a157.41 157.41 0 0 0-11 12.31l-5.61 7c-4 5.07-5.25 10.13-2.8 14.88l1.05 1.93c3 5.76 6.29 7.88 12.25 7.88h4.73c10.33 0 15.94 2.44 15.94 9.09 0 4.72-4.2 8.22-14.36 8.22a41.54 41.54 0 0 1-15.47-3.12c-6.49-3.88-11.74-3.5-15.6 3.12l-5.59 9.31c-3.72 6.13-3.19 11.72 2.63 15.94 7.71 4.69 20.38 9.44 37 9.44 34.16 0 48.5-22.75 48.5-44.12-.03-14.38-9.12-29.76-28.73-34.88zM496 224H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM16 160h64a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H64V40a8 8 0 0 0-8-8H32a8 8 0 0 0-7.14 4.42l-8 16A8 8 0 0 0 24 64h8v64H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8zm-3.91 160H80a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H41.32c3.29-10.29 48.34-18.68 48.34-56.44 0-29.06-25-39.56-44.47-39.56-21.36 0-33.8 10-40.46 18.75-4.37 5.59-3 10.84 2.8 15.37l8.58 6.88c5.61 4.56 11 2.47 16.12-2.44a13.44 13.44 0 0 1 9.46-3.84c3.33 0 9.28 1.56 9.28 8.75C51 248.19 0 257.31 0 304.59v4C0 316 5.08 320 12.09 320z"></path></svg>';
|
const copyIcon = markdownIcon('copy');
|
||||||
const barsIcon =
|
const checkIcon = markdownIcon('check');
|
||||||
'<svg viewBox="0 0 448 512" fill="currentColor" width="1em" height="1em"><path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"></path></svg>';
|
const ellipsisIcon = markdownIcon('ellipsis');
|
||||||
const copyIcon =
|
|
||||||
'<svg viewBox="0 0 448 512" fill="currentColor" width="1em" height="1em"><path d="M433.941 65.941l-51.882-51.882A48 48 0 00348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 00-14.059-33.941zM266 464H54a6 6 0 01-6-6V150a6 6 0 016-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 01-6 6zm128-96H182a6 6 0 01-6-6V54a6 6 0 016-6h106v88c0 13.255 10.745 24 24 24h88v200a6 6 0 01-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 011.757 4.243V112z"></path></svg>';
|
|
||||||
const checkIcon =
|
|
||||||
'<svg viewBox="0 0 512 512" fill="currentColor" width="1em" height="1em"><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"></path></svg>';
|
|
||||||
const ellipsisIcon =
|
|
||||||
'<svg viewBox="0 0 512 512" fill="currentColor" width="1em" height="1em"><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"></path></svg>';
|
|
||||||
|
|
||||||
return `<div class="code-block highlight is-open show-line-numbers">
|
return `<div class="code-block highlight is-open show-line-numbers">
|
||||||
<div class="code-block-header">
|
<div class="code-block-header">
|
||||||
@@ -311,30 +306,20 @@
|
|||||||
|
|
||||||
function parseAdmonitions(markdown: string) {
|
function parseAdmonitions(markdown: string) {
|
||||||
const icons = {
|
const icons = {
|
||||||
note: '<svg viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em"><path d="M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"></path></svg>',
|
note: markdownIcon('pencil'),
|
||||||
abstract:
|
abstract: markdownIcon('text-align-start'),
|
||||||
'<svg viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em"><path d="M48 48a48 48 0 1 0 48 48 48.14 48.14 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48.14 48.14 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48.14 48.14 0 0 0-48-48zm448 16H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"></path></svg>',
|
info: markdownIcon('info'),
|
||||||
info: '<svg viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em"><path d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"></path></svg>',
|
tip: markdownIcon('lightbulb'),
|
||||||
tip: '<svg viewBox="0 0 352 512" fill="currentColor" height="1em" width="1em"><path d="M96.06 454.35c.01 6.29 1.87 12.45 5.36 17.69l17.09 25.69a31.99 31.99 0 0 0 26.64 14.28h61.71a31.99 31.99 0 0 0 26.64-14.28l17.09-25.69a31.989 31.989 0 0 0 5.36-17.69l.04-38.35H96.01l.05 38.35zM0 176c0 44.37 16.45 84.85 43.56 115.78 16.64 18.99 42.74 58.8 52.42 92.16h160.03c9.68-33.35 35.78-73.16 52.42-92.16C335.55 260.85 352 220.37 352 176 352 78.8 273.2 0 176 0S0 78.8 0 176z"></path></svg>',
|
success: markdownIcon('circle-check'),
|
||||||
success:
|
question: markdownIcon('circle-question-mark'),
|
||||||
'<svg viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em"><path d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg>',
|
warning: markdownIcon('triangle-alert'),
|
||||||
question:
|
failure: markdownIcon('circle-x'),
|
||||||
'<svg viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em"><path d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z"></path></svg>',
|
danger: markdownIcon('zap'),
|
||||||
warning:
|
bug: markdownIcon('bug'),
|
||||||
'<svg viewBox="0 0 576 512" fill="currentColor" height="1em" width="1em"><path d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.466-32.004 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>',
|
example: markdownIcon('flask-conical'),
|
||||||
failure:
|
quote: markdownIcon('quote'),
|
||||||
'<svg viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z"></path></svg>',
|
important: markdownIcon('circle-alert'),
|
||||||
danger:
|
caution: markdownIcon('octagon-alert')
|
||||||
'<svg viewBox="0 0 448 512" fill="currentColor" height="1em" width="1em"><path d="M439.15 453.06L297.17 384l141.99-69.06c7.9-3.95 11.11-13.56 7.15-21.46L432 264.85c-3.95-7.9-13.56-11.11-21.47-7.16L224 348.41 37.47 257.69c-7.9-3.95-17.51-.75-21.47 7.16L1.69 293.48c-3.96 7.9-.76 17.51 7.15 21.46L150.83 384 8.85 453.06c-7.9 3.95-11.11 13.56-7.15 21.47l14.31 28.63c3.95 7.9 13.56 11.11 21.47 7.15L224 419.59l186.53 90.72c7.9 3.95 17.51.75 21.47-7.15l14.31-28.63c3.95-7.91.75-17.52-7.16-21.47zM150 237.28l-5.48 25.87c-2.67 12.62 5.42 24.85 16.45 24.85h126.08c11.03 0 19.12-12.23 16.45-24.85l-5.5-25.87c41.78-22.41 70-62.8 70-109.28C368 61.85 303.73 0 224 0S80 61.85 80 128c0 46.48 28.22 86.87 70 109.28zM280 112c17.65 0 32 14.35 32 32s-14.35 32-32 32-32-14.35-32-32 14.35-32 32-32zm-112 0c17.65 0 32 14.35 32 32s-14.35 32-32 32-32-14.35-32-32 14.35-32 32-32z"></path></svg>',
|
|
||||||
bug: '<svg viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em"><path d="M511.98 256.03c0-34.92-27.46-64-62.24-64h-38.38c-8.91-44.57-30.82-84.34-60.77-116.14l27.13-27.13c12.5-12.5 12.5-32.76 0-45.25l-22.63-22.63c-12.5-12.5-32.76-12.5-45.25 0l-43.14 43.14A220.617 220.617 0 0 0 256 16.03c-3.69 0-7.38.15-11.05.35l-43.15-43.15c-12.5-12.5-32.76-12.5-45.25 0l-22.63 22.63c-12.5 12.5-12.5 32.76 0 45.25l27.13 27.13c-29.95 31.8-51.86 71.57-60.77 116.14H62.26c-34.78 0-62.24 29.08-62.24 64 0 34.39 26.89 62.48 61 63.92V336.1c0 51.52 19.34 98.4 51.05 133.72l-25.56 25.56c-12.5 12.5-12.5 32.76 0 45.25l22.63 22.63c12.5 12.5 32.76 12.5 45.25 0l42.66-42.66c30.2 16.92 64.71 27.42 101 27.42s70.8-10.5 101-27.42l42.66 42.66c12.5 12.5 32.76 12.5 45.25 0l22.63-22.63c12.5-12.5 12.5-32.76 0-45.25l-25.56-25.56C430.68 434.5 450 387.62 450 336.1v-23.79c34.11-1.44 61.98-29.53 61.98-63.92v-8.36zM152 280.03c0-13.25 10.75-24 24-24s24 10.75 24 24v56c0 13.25-10.75 24-24 24s-24-10.75-24-24v-56zm160 0c0-13.25 10.75-24 24-24s24 10.75 24 24v56c0 13.25-10.75 24-24 24s-24-10.75-24-24v-56z"></path></svg>',
|
|
||||||
example:
|
|
||||||
'<svg viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em"><path d="M61.77 401l17.5-20.15a19.92 19.92 0 0 0 5.07-14.19v-3.31C84.34 356 80.5 352 73 352H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h34.71L15.32 424.64A29.85 29.85 0 0 0 8 444v16c0 26.51 21.49 48 48 48h24a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H56c-8.84 0-16-7.16-16-16v-4.52a6.01 6.01 0 0 1 1.76-4.24l19.24-19.24a48.28 48.28 0 0 0 7.58 3.06L64 448c0 35.35 28.65 64 64 64s64-28.65 64-64-28.65-64-64-64c-9.67 0-18.77 2.21-27.05 6.04L75.64 361.7A29.8 29.8 0 0 0 56 352h-7.66c10.37-4.14 17.66-14.24 17.66-26.34v-3.31c0-15.46-12.54-28-28-28H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h22c2.21 0 4 1.79 4 4v3.31c0 2.21-1.79 4-4 4H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h15.4c17.21 0 33.15 6.94 44.97 19.46l5.4-6.23a43.83 43.83 0 0 1 7.23-7.19h-15zM480 352H208a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h272a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM208 112h272a16 16 0 0 0 16-16V64a16 16 0 0 0-16-16H208a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16zM480 208H208a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h272a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM88 32H16C7.16 32 0 39.16 0 48v20c0 8.84 7.16 16 16 16h16v64c0 8.84 7.16 16 16 16h16c8.84 0 16-7.16 16-16V48c0-8.84-7.16-16-16-16h-48c0-8.84 7.16-16 16-16zm64 160c0-35.35-28.65-64-64-64s-64 28.65-64 64 28.65 64 64 64 64-28.65 64-64zm-32 0c0 17.67-14.33 32-32 32s-32-14.33-32-32 14.33-32 32-32 32 14.33 32 32zm0-24c0 17.67-14.33 32-32 32s-32-14.33-32-32 14.33-32 32-32 32 14.33 32 32zm0-24c0 17.67-14.33 32-32 32s-32-14.33-32-32 14.33-32 32-32 32 14.33 32 32z"></path></svg>',
|
|
||||||
quote:
|
|
||||||
'<svg viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em"><path d="M464 256h-80v-64c0-35.3 28.7-64 64-64h8c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24h-8c-88.4 0-160 71.6-160 160v240c0 26.5 21.5 48 48 48h128c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48zm-288 0H96v-64c0-35.3 28.7-64 64-64h8c13.3 0 24-10.7 24-24V56c0-13.3-10.7-24-24-24h-8C71.6 32 0 103.6 0 192v240c0 26.5 21.5 48 48 48h128c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z"></path></svg>',
|
|
||||||
important:
|
|
||||||
'<svg viewBox="0 0 192 512" fill="currentColor" height="1em" width="1em"><path d="M176 432c0 44.112-35.888 80-80 80s-80-35.888-80-80 35.888-80 80-80 80 35.888 80 80zM25.26 25.33l7.12 256.33c.35 12.63 10.71 22.34 23.36 22.34h80.51c12.65 0 23.01-9.71 23.36-22.34l7.12-256.33c.37-13.37-10.36-24.33-23.75-24.33H49.02c-13.4 0-24.12 10.96-23.76 24.33z"></path></svg>',
|
|
||||||
caution:
|
|
||||||
'<svg viewBox="0 0 512 512" fill="currentColor" height="1em" width="1em"><path d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"></path></svg>'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let html = replaceGithubAdmonitions(markdown, (type, title, content) => {
|
let html = replaceGithubAdmonitions(markdown, (type, title, content) => {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { toastState } from '$lib/stores/toast.svelte';
|
import { toastState } from '$lib/stores/toast.svelte';
|
||||||
|
import { Check, CircleX, Info, X } from 'lucide-svelte';
|
||||||
import { fade, fly } from 'svelte/transition';
|
import { fade, fly } from 'svelte/transition';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -12,68 +13,16 @@
|
|||||||
out:fade={{ duration: 200 }}
|
out:fade={{ duration: 200 }}
|
||||||
>
|
>
|
||||||
{#if msg.type === 'success'}
|
{#if msg.type === 'success'}
|
||||||
<svg
|
<Check size={18} class="toast-icon" aria-hidden="true" />
|
||||||
viewBox="0 0 24 24"
|
|
||||||
width="18"
|
|
||||||
height="18"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
fill="none"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
class="toast-icon"
|
|
||||||
>
|
|
||||||
<polyline points="20 6 9 17 4 12"></polyline>
|
|
||||||
</svg>
|
|
||||||
{:else if msg.type === 'error'}
|
{:else if msg.type === 'error'}
|
||||||
<svg
|
<CircleX size={18} class="toast-icon" aria-hidden="true" />
|
||||||
viewBox="0 0 24 24"
|
|
||||||
width="18"
|
|
||||||
height="18"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
fill="none"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
class="toast-icon"
|
|
||||||
>
|
|
||||||
<circle cx="12" cy="12" r="10"></circle>
|
|
||||||
<line x1="15" y1="9" x2="9" y2="15"></line>
|
|
||||||
<line x1="9" y1="9" x2="15" y2="15"></line>
|
|
||||||
</svg>
|
|
||||||
{:else}
|
{:else}
|
||||||
<svg
|
<Info size={18} class="toast-icon" aria-hidden="true" />
|
||||||
viewBox="0 0 24 24"
|
|
||||||
width="18"
|
|
||||||
height="18"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
fill="none"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
class="toast-icon"
|
|
||||||
>
|
|
||||||
<circle cx="12" cy="12" r="10"></circle>
|
|
||||||
<line x1="12" y1="16" x2="12" y2="12"></line>
|
|
||||||
<line x1="12" y1="8" x2="12.01" y2="8"></line>
|
|
||||||
</svg>
|
|
||||||
{/if}
|
{/if}
|
||||||
<span>{msg.text}</span>
|
<span>{msg.text}</span>
|
||||||
|
|
||||||
<button class="toast-close" onclick={() => toastState.remove(msg.id)} aria-label="Close">
|
<button class="toast-close" onclick={() => toastState.remove(msg.id)} aria-label="Close">
|
||||||
<svg
|
<X size={14} aria-hidden="true" />
|
||||||
viewBox="0 0 24 24"
|
|
||||||
width="14"
|
|
||||||
height="14"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
fill="none"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
>
|
|
||||||
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
||||||
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
@@ -125,7 +74,7 @@
|
|||||||
color: #d9534f;
|
color: #d9534f;
|
||||||
}
|
}
|
||||||
|
|
||||||
.toast-icon {
|
.toast-msg :global(.toast-icon) {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
import { Calendar } from 'lucide-svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
value = $bindable(''),
|
value = $bindable(''),
|
||||||
@@ -79,21 +80,7 @@
|
|||||||
<div class="input-wrapper" aria-hidden="true" onclick={() => (isOpen = !isOpen)}>
|
<div class="input-wrapper" aria-hidden="true" onclick={() => (isOpen = !isOpen)}>
|
||||||
<input type="text" {id} {name} {value} readonly placeholder="选择建站日期..." />
|
<input type="text" {id} {name} {value} readonly placeholder="选择建站日期..." />
|
||||||
<span class="icon">
|
<span class="icon">
|
||||||
<svg
|
<Calendar size={16} aria-hidden="true" />
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
>
|
|
||||||
<rect x="3" y="4" width="18" height="18" rx="0" ry="0"></rect>
|
|
||||||
<line x1="16" y1="2" x2="16" y2="6"></line>
|
|
||||||
<line x1="8" y1="2" x2="8" y2="6"></line>
|
|
||||||
<line x1="3" y1="10" x2="21" y2="10"></line>
|
|
||||||
</svg>
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,18 @@
|
|||||||
import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
|
import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
|
||||||
import { languages } from '@codemirror/language-data';
|
import { languages } from '@codemirror/language-data';
|
||||||
import { placeholder as cmPlaceholder } from '@codemirror/view';
|
import { placeholder as cmPlaceholder } from '@codemirror/view';
|
||||||
|
import {
|
||||||
|
Bold,
|
||||||
|
CodeXml,
|
||||||
|
Heading,
|
||||||
|
Image as ImageIcon,
|
||||||
|
Info,
|
||||||
|
Italic,
|
||||||
|
Link,
|
||||||
|
List,
|
||||||
|
Scissors,
|
||||||
|
Strikethrough
|
||||||
|
} from 'lucide-svelte';
|
||||||
import { addToast } from '$lib/stores/toast.svelte';
|
import { addToast } from '$lib/stores/toast.svelte';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -206,10 +218,7 @@
|
|||||||
onclick={() => insertAtCursor('**', '**', '粗体')}
|
onclick={() => insertAtCursor('**', '**', '粗体')}
|
||||||
title="加粗"
|
title="加粗"
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24">
|
<Bold aria-hidden="true" />
|
||||||
<path d="M7 5h5a3.5 3.5 0 0 1 0 7H7z" />
|
|
||||||
<path d="M7 12h6a3.5 3.5 0 0 1 0 7H7z" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -217,11 +226,7 @@
|
|||||||
onclick={() => insertAtCursor('*', '*', '斜体')}
|
onclick={() => insertAtCursor('*', '*', '斜体')}
|
||||||
title="斜体"
|
title="斜体"
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24">
|
<Italic aria-hidden="true" />
|
||||||
<line x1="19" y1="5" x2="11.5" y2="5" />
|
|
||||||
<line x1="12.5" y1="19" x2="5" y2="19" />
|
|
||||||
<line x1="15" y1="5" x2="9" y2="19" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -229,11 +234,7 @@
|
|||||||
onclick={() => insertAtCursor('~~', '~~', '删除线')}
|
onclick={() => insertAtCursor('~~', '~~', '删除线')}
|
||||||
title="删除线"
|
title="删除线"
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24">
|
<Strikethrough aria-hidden="true" />
|
||||||
<path d="M16 5.5H10.5a3 3 0 0 0 0 6" />
|
|
||||||
<path d="M13.5 12.5a3 3 0 0 1 0 6H8" />
|
|
||||||
<line x1="4.5" y1="12" x2="19.5" y2="12" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -241,11 +242,7 @@
|
|||||||
onclick={() => insertAtCursor('### ', '', '标题')}
|
onclick={() => insertAtCursor('### ', '', '标题')}
|
||||||
title="标题"
|
title="标题"
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24">
|
<Heading aria-hidden="true" />
|
||||||
<path d="M6 5v14" />
|
|
||||||
<path d="M18 5v14" />
|
|
||||||
<path d="M6 12h12" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
<div class="md-divider"></div>
|
<div class="md-divider"></div>
|
||||||
<button
|
<button
|
||||||
@@ -254,14 +251,7 @@
|
|||||||
onclick={() => insertAtCursor('- ', '', '列表项')}
|
onclick={() => insertAtCursor('- ', '', '列表项')}
|
||||||
title="无序列表"
|
title="无序列表"
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24">
|
<List aria-hidden="true" />
|
||||||
<line x1="9" y1="5.5" x2="19.5" y2="5.5" />
|
|
||||||
<line x1="9" y1="12" x2="19.5" y2="12" />
|
|
||||||
<line x1="9" y1="18.5" x2="19.5" y2="18.5" />
|
|
||||||
<circle cx="5" cy="5.5" r="1" fill="currentColor" stroke="none" />
|
|
||||||
<circle cx="5" cy="12" r="1" fill="currentColor" stroke="none" />
|
|
||||||
<circle cx="5" cy="18.5" r="1" fill="currentColor" stroke="none" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -269,10 +259,7 @@
|
|||||||
onclick={() => insertAtCursor('[', '](https://)', '链接文字')}
|
onclick={() => insertAtCursor('[', '](https://)', '链接文字')}
|
||||||
title="链接"
|
title="链接"
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24">
|
<Link aria-hidden="true" />
|
||||||
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
|
|
||||||
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
<div class="toolbar-dropdown-wrapper">
|
<div class="toolbar-dropdown-wrapper">
|
||||||
{#if showImageMenu}
|
{#if showImageMenu}
|
||||||
@@ -286,11 +273,7 @@
|
|||||||
onclick={() => (showImageMenu = !showImageMenu)}
|
onclick={() => (showImageMenu = !showImageMenu)}
|
||||||
title="图片"
|
title="图片"
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24">
|
<ImageIcon aria-hidden="true" />
|
||||||
<rect x="3" y="3" width="18" height="18" rx="2" />
|
|
||||||
<circle cx="9" cy="9" r="2" />
|
|
||||||
<path d="M21 15l-3.09-3.09a2 2 0 0 0-2.82 0L6 21" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
{#if showImageMenu}
|
{#if showImageMenu}
|
||||||
<div class="toolbar-dropdown">
|
<div class="toolbar-dropdown">
|
||||||
@@ -328,10 +311,7 @@
|
|||||||
onclick={() => insertAtCursor('```\n', '\n```', 'code')}
|
onclick={() => insertAtCursor('```\n', '\n```', 'code')}
|
||||||
title="代码块"
|
title="代码块"
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24">
|
<CodeXml aria-hidden="true" />
|
||||||
<polyline points="15.5 5.5 20.5 12 15.5 18.5" />
|
|
||||||
<polyline points="8.5 5.5 3.5 12 8.5 18.5" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
<div class="md-divider"></div>
|
<div class="md-divider"></div>
|
||||||
<div class="toolbar-dropdown-wrapper">
|
<div class="toolbar-dropdown-wrapper">
|
||||||
@@ -350,11 +330,7 @@
|
|||||||
onclick={() => (showAdmonitionMenu = !showAdmonitionMenu)}
|
onclick={() => (showAdmonitionMenu = !showAdmonitionMenu)}
|
||||||
title="提示框 (Admonition)"
|
title="提示框 (Admonition)"
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24">
|
<Info aria-hidden="true" />
|
||||||
<circle cx="12" cy="12" r="8.5" />
|
|
||||||
<path d="M12 11.5V16" />
|
|
||||||
<circle cx="12" cy="8.25" r=".9" fill="currentColor" stroke="none" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
{#if showAdmonitionMenu}
|
{#if showAdmonitionMenu}
|
||||||
<div class="toolbar-dropdown">
|
<div class="toolbar-dropdown">
|
||||||
@@ -371,11 +347,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="md-btn" onclick={insertMore} title="插入摘要分割线">
|
<button type="button" class="md-btn" onclick={insertMore} title="插入摘要分割线">
|
||||||
<svg viewBox="0 0 24 24">
|
<Scissors aria-hidden="true" />
|
||||||
<path d="M5 5v3.5h14V5" />
|
|
||||||
<path d="M5 19v-3.5h14V19" />
|
|
||||||
<line x1="5" y1="12" x2="19" y2="12" stroke-dasharray="2 2" stroke-linecap="butt" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -449,7 +421,7 @@
|
|||||||
outline-offset: -2px;
|
outline-offset: -2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.md-btn svg {
|
.md-btn :global(svg) {
|
||||||
width: 18px;
|
width: 18px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
display: block;
|
display: block;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { ChevronDown } from 'lucide-svelte';
|
||||||
|
|
||||||
type SelectValue = string | number;
|
type SelectValue = string | number;
|
||||||
|
|
||||||
type SelectOption = {
|
type SelectOption = {
|
||||||
@@ -108,9 +110,7 @@
|
|||||||
onkeydown={handleTriggerKeydown}
|
onkeydown={handleTriggerKeydown}
|
||||||
>
|
>
|
||||||
<span>{selectedLabel}</span>
|
<span>{selectedLabel}</span>
|
||||||
<svg viewBox="0 0 24 24" aria-hidden="true">
|
<ChevronDown aria-hidden="true" />
|
||||||
<polyline points="6 9 12 15 18 9"></polyline>
|
|
||||||
</svg>
|
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{#if isOpen}
|
{#if isOpen}
|
||||||
@@ -190,7 +190,7 @@
|
|||||||
border-bottom-color: var(--accent-color, #419b38);
|
border-bottom-color: var(--accent-color, #419b38);
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-dropdown-trigger svg {
|
.select-dropdown-trigger :global(svg) {
|
||||||
width: 17px;
|
width: 17px;
|
||||||
height: 17px;
|
height: 17px;
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
@@ -202,7 +202,7 @@
|
|||||||
transition: transform 0.2s ease;
|
transition: transform 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-dropdown-trigger.open svg {
|
.select-dropdown-trigger.open :global(svg) {
|
||||||
transform: rotate(180deg);
|
transform: rotate(180deg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
|
import { ArrowUp, Menu, X } from 'lucide-svelte';
|
||||||
|
|
||||||
let scrolled = $state(false);
|
let scrolled = $state(false);
|
||||||
let uptimeText = $state('');
|
let uptimeText = $state('');
|
||||||
@@ -69,35 +70,9 @@
|
|||||||
aria-label="Toggle menu"
|
aria-label="Toggle menu"
|
||||||
>
|
>
|
||||||
{#if isMobileMenuOpen}
|
{#if isMobileMenuOpen}
|
||||||
<svg
|
<X size={20} aria-hidden="true" />
|
||||||
aria-hidden="true"
|
|
||||||
focusable="false"
|
|
||||||
role="img"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 320 512"
|
|
||||||
width="20"
|
|
||||||
height="20"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"
|
|
||||||
></path>
|
|
||||||
</svg>
|
|
||||||
{:else}
|
{:else}
|
||||||
<svg
|
<Menu size={20} aria-hidden="true" />
|
||||||
aria-hidden="true"
|
|
||||||
focusable="false"
|
|
||||||
role="img"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 448 512"
|
|
||||||
width="20"
|
|
||||||
height="20"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M16 132h416c8.8 0 16-7.2 16-16V76c0-8.8-7.2-16-16-16H16C7.2 60 0 67.2 0 76v40c0 8.8 7.2 16 16 16zm0 160h416c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16H16c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16zm0 160h416c8.8 0 16-7.2 16-16v-40c0-8.8-7.2-16-16-16H16c-8.8 0-16 7.2-16 16v40c0 8.8 7.2 16 16 16z"
|
|
||||||
></path>
|
|
||||||
</svg>
|
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
<nav class={isMobileMenuOpen ? 'open' : ''}>
|
<nav class={isMobileMenuOpen ? 'open' : ''}>
|
||||||
@@ -192,19 +167,7 @@
|
|||||||
scrollToTop();
|
scrollToTop();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<svg
|
<ArrowUp size={16} aria-hidden="true" />
|
||||||
aria-hidden="true"
|
|
||||||
focusable="false"
|
|
||||||
role="img"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 448 512"
|
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
><path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z"
|
|
||||||
></path></svg
|
|
||||||
>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { resolve } from '$app/paths';
|
import { resolve } from '$app/paths';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
import { ExternalLink } from 'lucide-svelte';
|
||||||
import Toast from '$lib/components/Toast.svelte';
|
import Toast from '$lib/components/Toast.svelte';
|
||||||
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte';
|
||||||
|
|
||||||
@@ -76,19 +77,7 @@
|
|||||||
</nav>
|
</nav>
|
||||||
<div class="user-info">
|
<div class="user-info">
|
||||||
<a href={resolve('/')} target="_blank" class="site-link" title="访问前台">
|
<a href={resolve('/')} target="_blank" class="site-link" title="访问前台">
|
||||||
<svg
|
<ExternalLink size={14} aria-hidden="true" />
|
||||||
width="14"
|
|
||||||
height="14"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline
|
|
||||||
points="15 3 21 3 21 9"
|
|
||||||
></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg
|
|
||||||
>
|
|
||||||
<span>站点首页</span>
|
<span>站点首页</span>
|
||||||
</a>
|
</a>
|
||||||
<span class="user-email">{$page.data.user?.email || 'Admin'}</span>
|
<span class="user-email">{$page.data.user?.email || 'Admin'}</span>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import { resolve } from '$app/paths';
|
import { resolve } from '$app/paths';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
|
import { ArrowUpRight } from 'lucide-svelte';
|
||||||
let { data }: { data: PageData } = $props();
|
let { data }: { data: PageData } = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -19,20 +20,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<a href={resolve('/admin/posts')} class="action-link">
|
<a href={resolve('/admin/posts')} class="action-link">
|
||||||
管理{$page.data.aliases?.post || '文章'}
|
管理{$page.data.aliases?.post || '文章'}
|
||||||
<svg
|
<ArrowUpRight class="arrow-icon" size="1.3em" aria-hidden="true" />
|
||||||
class="arrow-icon"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="1.3em"
|
|
||||||
height="1.3em"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2.5"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"
|
|
||||||
></polyline></svg
|
|
||||||
>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -43,20 +31,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<a href={resolve('/admin/posts/new')} class="action-link">
|
<a href={resolve('/admin/posts/new')} class="action-link">
|
||||||
撰写新{$page.data.aliases?.post || '文章'}
|
撰写新{$page.data.aliases?.post || '文章'}
|
||||||
<svg
|
<ArrowUpRight class="arrow-icon" size="1.3em" aria-hidden="true" />
|
||||||
class="arrow-icon"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="1.3em"
|
|
||||||
height="1.3em"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2.5"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"
|
|
||||||
></polyline></svg
|
|
||||||
>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -67,20 +42,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<a href={resolve('/admin/pages')} class="action-link">
|
<a href={resolve('/admin/pages')} class="action-link">
|
||||||
管理{$page.data.aliases?.page || '页面'}
|
管理{$page.data.aliases?.page || '页面'}
|
||||||
<svg
|
<ArrowUpRight class="arrow-icon" size="1.3em" aria-hidden="true" />
|
||||||
class="arrow-icon"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="1.3em"
|
|
||||||
height="1.3em"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2.5"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"
|
|
||||||
></polyline></svg
|
|
||||||
>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -91,20 +53,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<a href={resolve('/admin/categories')} class="action-link">
|
<a href={resolve('/admin/categories')} class="action-link">
|
||||||
管理{$page.data.aliases?.category || '分类'}
|
管理{$page.data.aliases?.category || '分类'}
|
||||||
<svg
|
<ArrowUpRight class="arrow-icon" size="1.3em" aria-hidden="true" />
|
||||||
class="arrow-icon"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="1.3em"
|
|
||||||
height="1.3em"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2.5"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"
|
|
||||||
></polyline></svg
|
|
||||||
>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -115,20 +64,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<a href={resolve('/admin/tags')} class="action-link">
|
<a href={resolve('/admin/tags')} class="action-link">
|
||||||
管理{$page.data.aliases?.tag || '标签'}
|
管理{$page.data.aliases?.tag || '标签'}
|
||||||
<svg
|
<ArrowUpRight class="arrow-icon" size="1.3em" aria-hidden="true" />
|
||||||
class="arrow-icon"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="1.3em"
|
|
||||||
height="1.3em"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2.5"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"
|
|
||||||
></polyline></svg
|
|
||||||
>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -139,20 +75,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<a href={resolve('/admin/series')} class="action-link">
|
<a href={resolve('/admin/series')} class="action-link">
|
||||||
管理{$page.data.aliases?.series || '系列'}
|
管理{$page.data.aliases?.series || '系列'}
|
||||||
<svg
|
<ArrowUpRight class="arrow-icon" size="1.3em" aria-hidden="true" />
|
||||||
class="arrow-icon"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="1.3em"
|
|
||||||
height="1.3em"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2.5"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
><line x1="7" y1="17" x2="17" y2="7"></line><polyline points="7 7 17 7 17 17"
|
|
||||||
></polyline></svg
|
|
||||||
>
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -226,12 +149,12 @@
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow-icon {
|
.action-link :global(.arrow-icon) {
|
||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
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);
|
transform: translate(3px, -3px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
|
||||||
import { enhance } from '$app/forms';
|
import { enhance } from '$app/forms';
|
||||||
|
import { File, Upload } from 'lucide-svelte';
|
||||||
import type { ActionData, PageData } from './$types';
|
import type { ActionData, PageData } from './$types';
|
||||||
import { addToast } from '$lib/stores/toast.svelte';
|
import { addToast } from '$lib/stores/toast.svelte';
|
||||||
import { confirmState } from '$lib/stores/confirm.svelte';
|
import { confirmState } from '$lib/stores/confirm.svelte';
|
||||||
@@ -73,20 +74,7 @@
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<button type="button" class="upload-box" onclick={() => fileInput.click()}>
|
<button type="button" class="upload-box" onclick={() => fileInput.click()}>
|
||||||
<svg
|
<Upload size={48} stroke-width={1.5} aria-hidden="true" />
|
||||||
viewBox="0 0 24 24"
|
|
||||||
width="48"
|
|
||||||
height="48"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="1.5"
|
|
||||||
fill="none"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
>
|
|
||||||
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
|
|
||||||
<polyline points="17 8 12 3 7 8"></polyline>
|
|
||||||
<line x1="12" y1="3" x2="12" y2="15"></line>
|
|
||||||
</svg>
|
|
||||||
<h3>{isUploading ? '正在上传...' : '点击或拖拽文件上传'}</h3>
|
<h3>{isUploading ? '正在上传...' : '点击或拖拽文件上传'}</h3>
|
||||||
<p>存储于 Cloudflare R2</p>
|
<p>存储于 Cloudflare R2</p>
|
||||||
</button>
|
</button>
|
||||||
@@ -110,19 +98,7 @@
|
|||||||
<img src={url} alt={file.filename} loading="lazy" />
|
<img src={url} alt={file.filename} loading="lazy" />
|
||||||
{:else}
|
{:else}
|
||||||
<div class="file-icon">
|
<div class="file-icon">
|
||||||
<svg
|
<File size={48} stroke-width={1.5} aria-hidden="true" />
|
||||||
viewBox="0 0 24 24"
|
|
||||||
width="48"
|
|
||||||
height="48"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="1.5"
|
|
||||||
fill="none"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
>
|
|
||||||
<path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path>
|
|
||||||
<polyline points="13 2 13 9 20 9"></polyline>
|
|
||||||
</svg>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { resolve } from '$app/paths';
|
import { resolve } from '$app/paths';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
|
import { ExternalLink } from 'lucide-svelte';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { confirmState } from '$lib/stores/confirm.svelte';
|
import { confirmState } from '$lib/stores/confirm.svelte';
|
||||||
import Button from '$lib/components/admin/Button.svelte';
|
import Button from '$lib/components/admin/Button.svelte';
|
||||||
@@ -105,19 +106,7 @@
|
|||||||
class="preview-link"
|
class="preview-link"
|
||||||
title="前台预览"
|
title="前台预览"
|
||||||
>
|
>
|
||||||
<svg
|
<ExternalLink size={16} aria-hidden="true" />
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline
|
|
||||||
points="15 3 21 3 21 9"
|
|
||||||
></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg
|
|
||||||
>
|
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td><SlugBadge slug={pageItem.slug} /></td>
|
<td><SlugBadge slug={pageItem.slug} /></td>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
import Tabs from '$lib/components/admin/Tabs.svelte';
|
import Tabs from '$lib/components/admin/Tabs.svelte';
|
||||||
import ArticleAttachments from '$lib/components/admin/ArticleAttachments.svelte';
|
import ArticleAttachments from '$lib/components/admin/ArticleAttachments.svelte';
|
||||||
import { untrack } from 'svelte';
|
import { untrack } from 'svelte';
|
||||||
|
import { ArrowLeft } from 'lucide-svelte';
|
||||||
|
|
||||||
let { data, form }: { data: PageData; form: ActionData } = $props();
|
let { data, form }: { data: PageData; form: ActionData } = $props();
|
||||||
const initialData = $state.snapshot(untrack(() => data));
|
const initialData = $state.snapshot(untrack(() => data));
|
||||||
@@ -30,7 +31,9 @@
|
|||||||
<Button href={resolve('/[slug]', { slug: data.page.slug })} target="_blank" variant="secondary">
|
<Button href={resolve('/[slug]', { slug: data.page.slug })} target="_blank" variant="secondary">
|
||||||
前台预览
|
前台预览
|
||||||
</Button>
|
</Button>
|
||||||
<Button href={resolve('/admin/pages')} variant="secondary">← 返回</Button>
|
<Button href={resolve('/admin/pages')} variant="secondary">
|
||||||
|
<ArrowLeft size={14} style="margin-right: 6px;" aria-hidden="true" />返回
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
import ArticleAttachments from '$lib/components/admin/ArticleAttachments.svelte';
|
import ArticleAttachments from '$lib/components/admin/ArticleAttachments.svelte';
|
||||||
|
|
||||||
import { createSlugAutoHandler } from '$lib/utils/slugify';
|
import { createSlugAutoHandler } from '$lib/utils/slugify';
|
||||||
|
import { ArrowLeft } from 'lucide-svelte';
|
||||||
|
|
||||||
let { form }: { form: ActionData } = $props();
|
let { form }: { form: ActionData } = $props();
|
||||||
|
|
||||||
@@ -45,7 +46,9 @@
|
|||||||
<h2>新建独立{$page.data.aliases?.page || '页面'}</h2>
|
<h2>新建独立{$page.data.aliases?.page || '页面'}</h2>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<Button type="submit" form="page-form" variant="primary">发布</Button>
|
<Button type="submit" form="page-form" variant="primary">发布</Button>
|
||||||
<Button href={resolve('/admin/pages')} variant="secondary">← 返回</Button>
|
<Button href={resolve('/admin/pages')} variant="secondary">
|
||||||
|
<ArrowLeft size={14} style="margin-right: 6px;" aria-hidden="true" />返回
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { resolve } from '$app/paths';
|
import { resolve } from '$app/paths';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
|
import { ExternalLink } from 'lucide-svelte';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { confirmState } from '$lib/stores/confirm.svelte';
|
import { confirmState } from '$lib/stores/confirm.svelte';
|
||||||
import Button from '$lib/components/admin/Button.svelte';
|
import Button from '$lib/components/admin/Button.svelte';
|
||||||
@@ -101,19 +102,7 @@
|
|||||||
class="preview-link"
|
class="preview-link"
|
||||||
title="前台预览"
|
title="前台预览"
|
||||||
>
|
>
|
||||||
<svg
|
<ExternalLink size={16} aria-hidden="true" />
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline
|
|
||||||
points="15 3 21 3 21 9"
|
|
||||||
></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg
|
|
||||||
>
|
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td><span class="badge">{post.category || '未分类'}</span></td>
|
<td><span class="badge">{post.category || '未分类'}</span></td>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import type { PageData, ActionData } from './$types';
|
import type { PageData, ActionData } from './$types';
|
||||||
import { deserialize } from '$app/forms';
|
import { deserialize } from '$app/forms';
|
||||||
|
import { Save, X } from 'lucide-svelte';
|
||||||
import MarkdownRenderer from '$lib/components/MarkdownRenderer.svelte';
|
import MarkdownRenderer from '$lib/components/MarkdownRenderer.svelte';
|
||||||
import MarkdownEditor from '$lib/components/admin/MarkdownEditor.svelte';
|
import MarkdownEditor from '$lib/components/admin/MarkdownEditor.svelte';
|
||||||
import FeaturedImagePicker from '$lib/components/admin/FeaturedImagePicker.svelte';
|
import FeaturedImagePicker from '$lib/components/admin/FeaturedImagePicker.svelte';
|
||||||
@@ -112,8 +113,11 @@
|
|||||||
<div class="admin-page-header">
|
<div class="admin-page-header">
|
||||||
<h2>编辑</h2>
|
<h2>编辑</h2>
|
||||||
<div class="header-actions">
|
<div class="header-actions">
|
||||||
<Button type="submit" form="post-form" variant="primary">保存</Button>
|
<Button type="submit" form="post-form" variant="primary">
|
||||||
<Button href={resolve('/admin/posts')} variant="secondary">← 返回</Button>
|
<Save class="btn-icon" size={16} aria-hidden="true" />
|
||||||
|
保存
|
||||||
|
</Button>
|
||||||
|
<Button href={resolve('/admin/posts')} variant="secondary">返回</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -248,22 +252,7 @@
|
|||||||
class="remove-tag-btn"
|
class="remove-tag-btn"
|
||||||
onclick={() => toggleTag(tagId)}
|
onclick={() => toggleTag(tagId)}
|
||||||
title="移除{$page.data.aliases?.tag || '标签'}"
|
title="移除{$page.data.aliases?.tag || '标签'}"
|
||||||
><svg
|
><X size={14} aria-hidden="true" /></button
|
||||||
viewBox="0 0 24 24"
|
|
||||||
width="14"
|
|
||||||
height="14"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
fill="none"
|
|
||||||
><line x1="18" y1="6" x2="6" y2="18"></line><line
|
|
||||||
x1="6"
|
|
||||||
y1="6"
|
|
||||||
x2="18"
|
|
||||||
y2="18"
|
|
||||||
></line></svg
|
|
||||||
></button
|
|
||||||
>
|
>
|
||||||
<input type="hidden" name="tags" value={tagId} />
|
<input type="hidden" name="tags" value={tagId} />
|
||||||
</div>
|
</div>
|
||||||
@@ -344,6 +333,18 @@
|
|||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:global(.btn-icon) {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
flex: none;
|
||||||
|
margin-right: 6px;
|
||||||
|
stroke: currentColor;
|
||||||
|
stroke-width: 2;
|
||||||
|
stroke-linecap: round;
|
||||||
|
stroke-linejoin: round;
|
||||||
|
fill: none;
|
||||||
|
}
|
||||||
|
|
||||||
.editor-header {
|
.editor-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import type { PageData, ActionData } from './$types';
|
import type { PageData, ActionData } from './$types';
|
||||||
import { deserialize } from '$app/forms';
|
import { deserialize } from '$app/forms';
|
||||||
|
import { ArrowLeft, X } from 'lucide-svelte';
|
||||||
import MarkdownRenderer from '$lib/components/MarkdownRenderer.svelte';
|
import MarkdownRenderer from '$lib/components/MarkdownRenderer.svelte';
|
||||||
import MarkdownEditor from '$lib/components/admin/MarkdownEditor.svelte';
|
import MarkdownEditor from '$lib/components/admin/MarkdownEditor.svelte';
|
||||||
import FeaturedImagePicker from '$lib/components/admin/FeaturedImagePicker.svelte';
|
import FeaturedImagePicker from '$lib/components/admin/FeaturedImagePicker.svelte';
|
||||||
@@ -133,7 +134,9 @@
|
|||||||
<Button type="submit" form="post-form" variant="primary">
|
<Button type="submit" form="post-form" variant="primary">
|
||||||
发布{$page.data.aliases?.post || '文章'}
|
发布{$page.data.aliases?.post || '文章'}
|
||||||
</Button>
|
</Button>
|
||||||
<Button href={resolve('/admin/posts')} variant="secondary">← 返回</Button>
|
<Button href={resolve('/admin/posts')} variant="secondary">
|
||||||
|
<ArrowLeft size={14} style="margin-right: 6px;" aria-hidden="true" />返回
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -280,22 +283,7 @@
|
|||||||
class="remove-tag-btn"
|
class="remove-tag-btn"
|
||||||
onclick={() => toggleTag(tagId)}
|
onclick={() => toggleTag(tagId)}
|
||||||
title="移除{$page.data.aliases?.tag || '标签'}"
|
title="移除{$page.data.aliases?.tag || '标签'}"
|
||||||
><svg
|
><X size={14} aria-hidden="true" /></button
|
||||||
viewBox="0 0 24 24"
|
|
||||||
width="14"
|
|
||||||
height="14"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-width="2"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round"
|
|
||||||
fill="none"
|
|
||||||
><line x1="18" y1="6" x2="6" y2="18"></line><line
|
|
||||||
x1="6"
|
|
||||||
y1="6"
|
|
||||||
x2="18"
|
|
||||||
y2="18"
|
|
||||||
></line></svg
|
|
||||||
></button
|
|
||||||
>
|
>
|
||||||
<input type="hidden" name="tags" value={tagId} />
|
<input type="hidden" name="tags" value={tagId} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import { resolve } from '$app/paths';
|
import { resolve } from '$app/paths';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { onMount, tick } from 'svelte';
|
import { onMount, tick } from 'svelte';
|
||||||
|
import { ArrowLeft } from 'lucide-svelte';
|
||||||
import tocbot from 'tocbot';
|
import tocbot from 'tocbot';
|
||||||
import MarkdownRenderer from '$lib/components/MarkdownRenderer.svelte';
|
import MarkdownRenderer from '$lib/components/MarkdownRenderer.svelte';
|
||||||
|
|
||||||
@@ -176,19 +177,7 @@
|
|||||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||||
<div id="toggle-toc" class="ctrler-item" onclick={() => (sidebarShow = !sidebarShow)}>
|
<div id="toggle-toc" class="ctrler-item" onclick={() => (sidebarShow = !sidebarShow)}>
|
||||||
<svg
|
<ArrowLeft size={16} aria-hidden="true" />
|
||||||
aria-hidden="true"
|
|
||||||
focusable="false"
|
|
||||||
role="img"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
viewBox="0 0 448 512"
|
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
><path
|
|
||||||
fill="currentColor"
|
|
||||||
d="M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L27 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 120.8c9.8 9.3 10 24.8.4 34.3z"
|
|
||||||
></path></svg
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
Reference in new issue
Block a user