Skip to content

Commit

Permalink
svelte
Browse files Browse the repository at this point in the history
  • Loading branch information
yamader committed Jan 14, 2024
1 parent 20bde8a commit 31907e4
Show file tree
Hide file tree
Showing 11 changed files with 4,649 additions and 49 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
#- uses: actions/upload-pages-artifact@v3
# with:
# path: dist

# deploy:
# permissions:
# id-token: write
Expand Down
4 changes: 2 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"printWidth": 80,
"printWidth": 120,
"semi": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-astro"]
"plugins": ["prettier-plugin-astro", "prettier-plugin-organize-imports", "prettier-plugin-svelte"]
}
3 changes: 2 additions & 1 deletion astro.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import mdx from "@astrojs/mdx"
import svelte from "@astrojs/svelte"
import qwikdev from "@qwikdev/astro"
import { defineConfig, passthroughImageService } from "astro/config"
import rehypeKatex from "rehype-katex"
Expand All @@ -14,7 +15,7 @@ export default defineConfig({
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
},
integrations: [mdx(), qwikdev()],
integrations: [mdx(), svelte(), qwikdev()],
vite: {
css: { transformer: "lightningcss" },
// build: { cssMinify: "lightningcss" },
Expand Down
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
"name": "yamad.me",
"version": "2.0.2",
"dependencies": {
"@builder.io/qwik": "1.3.2",
"katex": "0.16.9"
"@builder.io/qwik": "1.3.5",
"katex": "0.16.9",
"svelte": "4.2.8"
},
"devDependencies": {
"@astrojs/check": "0.3.4",
"@astrojs/mdx": "2.0.3",
"@qwikdev/astro": "0.3.4",
"astro": "4.0.9",
"@astrojs/check": "0.4.1",
"@astrojs/mdx": "2.0.4",
"@astrojs/svelte": "5.0.3",
"@qwikdev/astro": "0.4.0",
"astro": "4.1.2",
"badgen": "3.2.3",
"js-beautify": "1.14.11",
"lightningcss": "1.22.1",
"prettier": "3.1.1",
"prettier": "3.2.2",
"prettier-plugin-astro": "0.12.3",
"prettier-plugin-organize-imports": "3.2.4",
"prettier-plugin-svelte": "3.1.2",
"rehype-katex": "7.0.0",
"remark-math": "6.0.0"
},
Expand Down
4 changes: 1 addition & 3 deletions src/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ const links = [

{
Astro.url.pathname.split("/").length > 3 && (
<div style={{ background: "maroon" }}>
募: いい感じのパンくずリストのデザイン
</div>
<div style={{ background: "maroon" }}>募: いい感じのパンくずリストのデザイン</div>
)
}

Expand Down
18 changes: 18 additions & 0 deletions src/components/YO.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<script lang="ts">
let value = new Date().getFullYear()
$: delta = value - 2005
</script>

<p>
西暦<input type="number" class="form" bind:value />年において,山Dは{#if delta < 0}
まだ生まれていません。{:else}<strong>{delta}</strong>歳です。{/if}{#if delta >= 200}
おそらく死んでいます。
{/if}
</p>

<style>
.form {
width: 6em;
margin: 0 0.3em;
}
</style>
25 changes: 0 additions & 25 deletions src/components/YO/index.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions src/components/YO/style.module.css

This file was deleted.

7 changes: 3 additions & 4 deletions src/components/badges/GitHub.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import "./badge.css"
async function updated() {
const fallback = "9315-19-19T11:45:14Z"
if (import.meta.env.DEV) return fallback
const res = await fetch(
`https://api.github.com/repos/${repo}/commits?author=yamader`,
{ headers: { Authorization: "Bearer " + import.meta.env.GITHUB_TOKEN } },
)
const res = await fetch(`https://api.github.com/repos/${repo}/commits?author=yamader`, {
headers: { Authorization: "Bearer " + import.meta.env.GITHUB_TOKEN },
})
if (!res.ok) {
console.error(res)
return fallback
Expand Down
4 changes: 2 additions & 2 deletions src/pages/about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: About
description: 山Dについて
---

import YO from "~/components/YO"
import YO from "~/components/YO.svelte"

# About

Expand All @@ -14,7 +14,7 @@ import YO from "~/components/YO"

某市立高専 電子工学科の4年生です。

<YO />
<YO client:idle />

## やったこと

Expand Down
Loading

0 comments on commit 31907e4

Please sign in to comment.