From afa2f91bd83b8986be5743c841bef31f4537e91e Mon Sep 17 00:00:00 2001 From: shiki-01 <0110shiki@gmail.com> Date: Thu, 11 Jun 2026 11:37:43 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A7=20=E4=BE=9D=E5=AD=98=E9=96=A2?= =?UTF-8?q?=E4=BF=82=E3=81=AE=E8=BF=BD=E5=8A=A0=E3=81=A8=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=80=81=E3=82=B9=E3=82=BF=E3=82=A4=E3=83=AB=E3=81=AE=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bun.lock | 4 ++++ package.json | 1 + src/ambient.d.ts | 4 ++++ src/lib/components/BlogDetails.svelte | 19 +++++++++++-------- src/lib/components/BlogLink.svelte | 4 ++++ src/lib/components/BlogList.svelte | 2 +- src/lib/components/TagAndSort.svelte | 2 +- .../middlewares/rewriters/add-anchor-copy.ts | 2 +- src/lib/utils/middlewares/rewriters/figure.ts | 2 +- .../utils/middlewares/rewriters/highlight.ts | 2 +- src/routes/+error.svelte | 6 +++--- src/routes/+layout.svelte | 8 ++++++-- src/routes/+page.svelte | 6 +++++- src/routes/about/+page.svelte | 19 ++++++++++++------- 14 files changed, 55 insertions(+), 26 deletions(-) create mode 100644 src/ambient.d.ts diff --git a/bun.lock b/bun.lock index 2e41c7e..0959dc2 100644 --- a/bun.lock +++ b/bun.lock @@ -1,5 +1,6 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "misc-mdn.dev", @@ -7,6 +8,7 @@ "@fontsource-variable/jetbrains-mono": "^5.2.8", "@fontsource-variable/m-plus-1": "^5.2.10", "@fontsource/noto-color-emoji": "^5.2.12", + "@iconify-json/mdi": "^1.2.3", "@nanostores/persistent": "^0.10.2", "bits-ui": "^2.0.0", "cheerio": "^1.2.0", @@ -128,6 +130,8 @@ "@humanwhocodes/object-schema": ["@humanwhocodes/object-schema@2.0.3", "", {}, "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA=="], + "@iconify-json/mdi": ["@iconify-json/mdi@1.2.3", "", { "dependencies": { "@iconify/types": "*" } }, "sha512-O3cLwbDOK7NNDf2ihaQOH5F9JglnulNDFV7WprU2dSoZu3h3cWH//h74uQAB87brHmvFVxIOkuBX2sZSzYhScg=="], + "@iconify/svelte": ["@iconify/svelte@5.2.1", "", { "dependencies": { "@iconify/types": "^2.0.0" }, "peerDependencies": { "svelte": ">5.0.0" } }, "sha512-zHmsIPmnIhGd5gc95bNN5FL+GifwMZv7M2rlZEpa7IXYGFJm/XGHdWf6PWQa6OBoC+R69WyiPO9NAj5wjfjbow=="], "@iconify/types": ["@iconify/types@2.0.0", "", {}, "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg=="], diff --git a/package.json b/package.json index afec1b1..ee08bcc 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,7 @@ "@fontsource-variable/jetbrains-mono": "^5.2.8", "@fontsource-variable/m-plus-1": "^5.2.10", "@fontsource/noto-color-emoji": "^5.2.12", + "@iconify-json/mdi": "^1.2.3", "@nanostores/persistent": "^0.10.2", "bits-ui": "^2.0.0", "cheerio": "^1.2.0", diff --git a/src/ambient.d.ts b/src/ambient.d.ts new file mode 100644 index 0000000..a7f0c14 --- /dev/null +++ b/src/ambient.d.ts @@ -0,0 +1,4 @@ +declare module "the-new-css-reset"; +declare module "@fontsource-variable/m-plus-1"; +declare module "@fontsource-variable/jetbrains-mono"; +declare module "@fontsource/noto-color-emoji"; \ No newline at end of file diff --git a/src/lib/components/BlogDetails.svelte b/src/lib/components/BlogDetails.svelte index 3378e67..00ffd11 100644 --- a/src/lib/components/BlogDetails.svelte +++ b/src/lib/components/BlogDetails.svelte @@ -36,13 +36,13 @@
- - -

公開日:{formatDate(details.publishedAt)}

更新日:{formatDate(details.updatedAt)}

+ + +
{@html rewriteHTML(details.content)}
@@ -61,6 +61,7 @@ :not(h1) { padding-inline: $spacing-2; } + div { display: grid; grid-template-columns: 1fr; @@ -90,6 +91,12 @@ display: block; padding: $spacing-5; } + + #date-at { + display: flex; + flex-direction: column; + padding: $spacing-5; + } } @include mobile { @@ -132,11 +139,7 @@ padding: auto 0; line-height: 1.8; text-align: justify; - - #date-at { - display: flex; - flex-direction: column; - } + margin: $spacing-5 0; } @include mobile { diff --git a/src/lib/components/BlogLink.svelte b/src/lib/components/BlogLink.svelte index 18d2333..65493c1 100644 --- a/src/lib/components/BlogLink.svelte +++ b/src/lib/components/BlogLink.svelte @@ -81,4 +81,8 @@ margin: 5px; font-size: 0.8em; } + + h1:hover { + text-decoration: underline; + } diff --git a/src/lib/components/BlogList.svelte b/src/lib/components/BlogList.svelte index 165b04b..f3a6fd2 100644 --- a/src/lib/components/BlogList.svelte +++ b/src/lib/components/BlogList.svelte @@ -56,6 +56,6 @@ padding: 0 $spacing-8; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); - gap: $spacing-8; + gap: $spacing-10; } diff --git a/src/lib/components/TagAndSort.svelte b/src/lib/components/TagAndSort.svelte index 3faf5ff..83f10ff 100644 --- a/src/lib/components/TagAndSort.svelte +++ b/src/lib/components/TagAndSort.svelte @@ -78,7 +78,7 @@ position: relative; @include mobile { - grid-template-columns: 1fr; + grid-template-columns: 1fr 1fr; } button { diff --git a/src/lib/utils/middlewares/rewriters/add-anchor-copy.ts b/src/lib/utils/middlewares/rewriters/add-anchor-copy.ts index e45bfe6..86a351d 100644 --- a/src/lib/utils/middlewares/rewriters/add-anchor-copy.ts +++ b/src/lib/utils/middlewares/rewriters/add-anchor-copy.ts @@ -15,5 +15,5 @@ export function addAnchorCopy(html: string): string { $elem.prepend(btn); }); - return $.html(); + return $("body").html() ?? html; } diff --git a/src/lib/utils/middlewares/rewriters/figure.ts b/src/lib/utils/middlewares/rewriters/figure.ts index 972ad0e..a369eeb 100644 --- a/src/lib/utils/middlewares/rewriters/figure.ts +++ b/src/lib/utils/middlewares/rewriters/figure.ts @@ -19,5 +19,5 @@ export function processFigure(html: string): string { ); }); - return $.html(); + return $("body").html() ?? html; } diff --git a/src/lib/utils/middlewares/rewriters/highlight.ts b/src/lib/utils/middlewares/rewriters/highlight.ts index 0839713..e0e038e 100644 --- a/src/lib/utils/middlewares/rewriters/highlight.ts +++ b/src/lib/utils/middlewares/rewriters/highlight.ts @@ -35,5 +35,5 @@ export function highlight(html: string): string { $container.addClass("code-block"); }); - return $.html(); + return $("body").html() ?? html; } diff --git a/src/routes/+error.svelte b/src/routes/+error.svelte index 0c8a1aa..6651eae 100644 --- a/src/routes/+error.svelte +++ b/src/routes/+error.svelte @@ -1,11 +1,11 @@
-
{$page.status}
+
{page.status}

-

{$page.error?.message}

+

{page.error?.message}