diff --git a/lefthook.toml b/lefthook.toml index ea320bb..1b2cb70 100644 --- a/lefthook.toml +++ b/lefthook.toml @@ -9,6 +9,10 @@ run = "pnpm biome check --apply --no-errors-on-unmatched --files-ignore-unknown= # glob = "*.svelte" # run = "pnpm svelte-check -- {staged_files} && git update-index --again" +# [pre-commit.commands.update-mdx] +# glob = "*.mdx" +# run = "pnpm scripts/update-mdx {staged_files} && git update-index --again" + [pre-commit.commands.check-toml] glob = "*.toml" run = "pnpm taplo format {staged_files} && git update-index --again" diff --git a/package.json b/package.json index 9eaabcd..13a9cf0 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ }, "type": "module", "dependencies": { + "@vercel/analytics": "^1.3.1", "autoprefixer": "^10.4.19", "highlight.js": "^11.9.0", "postcss": "^8.4.38", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c2c459e..d2ff467 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + '@vercel/analytics': + specifier: ^1.3.1 + version: 1.3.1(react@18.2.0) autoprefixer: specifier: ^10.4.19 version: 10.4.19(postcss@8.4.38) @@ -904,6 +907,21 @@ packages: resolution: {integrity: sha512-IfYcSBWE3hLpBg8+X2SEa8LVkJdJEkT2Ese2aaLs3ptGdVtABxndrMaxuFlQ1qdFf9Q5rDvDpxI3WwgvKFAsQA==} dev: true + /@vercel/analytics@1.3.1(react@18.2.0): + resolution: {integrity: sha512-xhSlYgAuJ6Q4WQGkzYTLmXwhYl39sWjoMA3nHxfkvG+WdBT25c563a7QhwwKivEOZtPJXifYHR1m2ihoisbWyA==} + peerDependencies: + next: '>= 13' + react: ^18 || ^19 + peerDependenciesMeta: + next: + optional: true + react: + optional: true + dependencies: + react: 18.2.0 + server-only: 0.0.1 + dev: false + /JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true @@ -2405,6 +2423,10 @@ packages: engines: {node: '>=10'} hasBin: true + /server-only@0.0.1: + resolution: {integrity: sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==} + dev: false + /set-cookie-parser@2.6.0: resolution: {integrity: sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ==} dev: true diff --git a/src/app.css b/src/app.css index 8ba3f11..2e1f020 100644 --- a/src/app.css +++ b/src/app.css @@ -43,7 +43,7 @@ kbd { --a4-height: 297mm; --a4-aspect-ratio: calc(var(--a4-height) / var(--a4-width)); - --page-min-height: calc(100dvh - var(--header-weight) - var(--footer-height)); + --page-min-height: calc(100dvh - var(--header-height) - var(--footer-height)); --primary-100: #e8e9e9; --primary-200: #cdcecf; diff --git a/src/components/blog/blog-link.svelte b/src/components/blog/blog-link.svelte new file mode 100644 index 0000000..57d6b32 --- /dev/null +++ b/src/components/blog/blog-link.svelte @@ -0,0 +1,32 @@ + + + + {article.metadata.title} + + {Intl.DateTimeFormat("en", { + year: "2-digit", + month: "short", + day: "numeric", + }).format(new Date(article.metadata.date))} + + diff --git a/src/components/blog/blog-modal.svelte b/src/components/blog/blog-modal.svelte new file mode 100644 index 0000000..64cc629 --- /dev/null +++ b/src/components/blog/blog-modal.svelte @@ -0,0 +1,103 @@ + + + +
+ {#if showModal} +
+ + e.target instanceof HTMLInputElement && (value = e.target.value)} + error={null} + placeholder={"Search for an article"} + /> +
+ + +
+
+ {/if} +
diff --git a/src/components/blog/blog-section.svelte b/src/components/blog/blog-section.svelte new file mode 100644 index 0000000..0aacecc --- /dev/null +++ b/src/components/blog/blog-section.svelte @@ -0,0 +1,36 @@ + + +{#if isAside} + +{:else} +
+

{label}

+
+ {@render props.children?.()} +
+{/if} + + diff --git a/src/components/blog/index.ts b/src/components/blog/index.ts new file mode 100644 index 0000000..b3b2c82 --- /dev/null +++ b/src/components/blog/index.ts @@ -0,0 +1,3 @@ +export { default as BlogLink } from './blog-link.svelte' +export { default as BlogModal } from './blog-modal.svelte' +export { default as BlogSection } from './blog-section.svelte' diff --git a/src/components/resume/resume.svelte b/src/components/resume/resume.svelte index 4474b8c..9ba9d61 100644 --- a/src/components/resume/resume.svelte +++ b/src/components/resume/resume.svelte @@ -1,5 +1,6 @@ + + diff --git a/src/components/ui/input.svelte b/src/components/ui/input.svelte index 0313b6c..ea7258a 100644 --- a/src/components/ui/input.svelte +++ b/src/components/ui/input.svelte @@ -5,14 +5,24 @@ import type { HTMLInputAttributes } from 'svelte/elements' type InputProps = HTMLInputAttributes & { label: string error: string | null + showLabel?: boolean } -const { label, type, name, required = false, error = null, ...props }: InputProps = $props() +const { + label, + type, + name, + required = false, + error = null, + showLabel = true, + ...props +}: InputProps = $props()