Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions src/ambient.d.ts
Original file line number Diff line number Diff line change
@@ -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";
19 changes: 11 additions & 8 deletions src/lib/components/BlogDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
<div id="image" style={`view-transition-name: ${details.id}-thumbnail`}>
<BlogImage imageData={details.ogpImg} alt={details.title} />
</div>
</div>

<article>
<div id="date-at">
<p>公開日:{formatDate(details.publishedAt)}</p>
<p>更新日:{formatDate(details.updatedAt)}</p>
</div>
</div>

<article>
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html rewriteHTML(details.content)}
</article>
Expand All @@ -61,6 +61,7 @@
:not(h1) {
padding-inline: $spacing-2;
}

div {
display: grid;
grid-template-columns: 1fr;
Expand Down Expand Up @@ -90,6 +91,12 @@
display: block;
padding: $spacing-5;
}

#date-at {
display: flex;
flex-direction: column;
padding: $spacing-5;
}
}

@include mobile {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions src/lib/components/BlogLink.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,8 @@
margin: 5px;
font-size: 0.8em;
}

h1:hover {
text-decoration: underline;
}
</style>
2 changes: 1 addition & 1 deletion src/lib/components/BlogList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
</style>
2 changes: 1 addition & 1 deletion src/lib/components/TagAndSort.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
position: relative;

@include mobile {
grid-template-columns: 1fr;
grid-template-columns: 1fr 1fr;
}

button {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/middlewares/rewriters/add-anchor-copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export function addAnchorCopy(html: string): string {
$elem.prepend(btn);
});

return $.html();
return $("body").html() ?? html;
}
2 changes: 1 addition & 1 deletion src/lib/utils/middlewares/rewriters/figure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export function processFigure(html: string): string {
);
});

return $.html();
return $("body").html() ?? html;
}
2 changes: 1 addition & 1 deletion src/lib/utils/middlewares/rewriters/highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ export function highlight(html: string): string {
$container.addClass("code-block");
});

return $.html();
return $("body").html() ?? html;
}
6 changes: 3 additions & 3 deletions src/routes/+error.svelte
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script lang="ts">
import { page } from "$app/stores";
import { page } from "$app/state";
</script>

<div>
<div class="status">{$page.status}</div>
<div class="status">{page.status}</div>
<hr />
<h1 class="message">{$page.error?.message}</h1>
<h1 class="message">{page.error?.message}</h1>
</div>

<style lang="scss">
Expand Down
8 changes: 6 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<script lang="ts">
import { addCollection } from "@iconify/svelte";
import mdiIcons from "@iconify-json/mdi/icons.json";
import extend from "just-extend";
import type { Snippet } from "svelte";
import { MetaTags } from "svelte-meta-tags";

addCollection(mdiIcons as Parameters<typeof addCollection>[0]);
import { setupViewTransition } from "sveltekit-view-transition";
import type { LayoutData } from "./$types";
import { page } from "$app/stores";
import { page } from "$app/state";
import Footer from "$lib/components/Footer.svelte";
import Header from "$lib/components/Header.svelte";

Expand All @@ -20,7 +24,7 @@
let { data, children }: { data: LayoutData; children: Snippet } = $props();

const metaTags = $derived(
extend(true, {}, data.baseMetaTags, $page.data.pageMetaTags),
extend(true, {}, data.baseMetaTags, page.data.pageMetaTags),
);
</script>

Expand Down
6 changes: 5 additions & 1 deletion src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<Marker>blogs</Marker>
</h2>

<section>
<section id="blogs">
<BlogList blogs={data.blogList} {limit} />
</section>

Expand Down Expand Up @@ -98,6 +98,10 @@
padding-block: $spacing-10;
}

#blogs {
padding: $spacing-10;
}

#arrow {
display: flex;
flex-direction: column;
Expand Down
19 changes: 12 additions & 7 deletions src/routes/about/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@
</p>
<ul>
<li>
<a href="https://svelte.jp/">Svelte / SvelteKit</a>
<a target="_blank" href="https://svelte.jp/">Svelte / SvelteKit</a>
</li>
<li>
<a href="https://www.typescriptlang.org/">TypeScript</a>
<a target="_blank" href="https://www.typescriptlang.org/">TypeScript</a>
</li>
<li>
<a href="https://sass-lang.com/">SCSS</a>
<a target="_blank" href="https://sass-lang.com/">SCSS</a>
</li>
<li>
<a href="https://microcms.io/">microCMS</a>
<a target="_blank" href="https://microcms.io/">microCMS</a>
</li>
</ul>
<p>
このサイトは、<a href="https://github.com/misc-org/misc-mdn.dev">GitHub</a
このサイトは、<a target="_blank" href="https://github.com/misc-org/misc-mdn.dev">GitHub</a
>でソースコードを公開しています。
</p>
</article>
Expand Down Expand Up @@ -104,14 +104,19 @@
}

div {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
display: flex;
flex-direction: column;
gap: $spacing-5;

div {
min-width: 400px;
padding: $spacing-2;
border-radius: 5px;
background-color: #d9d9d9;

@include mobile {
min-width: 300px;
}
}

p {
Expand Down
Loading