diff --git a/package.json b/package.json index 7288d78a..268b99aa 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@sveltejs/adapter-static": "1.0.0-next.48", "@sveltejs/kit": "1.0.0-next.551", "@tailwindcss/typography": "^0.5.8", + "@sveltejs/adapter-netlify": "1.0.0-next.84", "@types/node": "^18.11.9", "@types/unist": "^2.0.6", "@types/workbox-build": "^5.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 16bc4e17..57a8ccc5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,6 +9,7 @@ specifiers: '@iconify-json/simple-icons': 1.1.34 '@iconify-json/uil': ^1.1.2 '@sveltejs/adapter-auto': 1.0.0-next.88 + '@sveltejs/adapter-netlify': 1.0.0-next.84 '@sveltejs/adapter-node': 1.0.0-next.100 '@sveltejs/adapter-static': 1.0.0-next.48 '@sveltejs/kit': 1.0.0-next.551 @@ -71,6 +72,7 @@ devDependencies: '@iconify-json/simple-icons': 1.1.34 '@iconify-json/uil': 1.1.2 '@sveltejs/adapter-auto': 1.0.0-next.88 + '@sveltejs/adapter-netlify': 1.0.0-next.84 '@sveltejs/adapter-node': 1.0.0-next.100 '@sveltejs/adapter-static': 1.0.0-next.48 '@sveltejs/kit': 1.0.0-next.551_svelte@3.53.1+vite@3.2.4 @@ -1410,6 +1412,10 @@ packages: resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} dev: true + /@iarna/toml/2.2.5: + resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} + dev: true + /@iconify-json/heroicons-outline/1.1.4: resolution: {integrity: sha512-H59TKT8dK6SDonC0NXeT021Erhq7n0apg+41cUDFgv3Zps4x+2t2Sd3QWI5cs6sW/kpOlY8DTP0xUtF5T/bp4w==} dependencies: @@ -2592,6 +2598,14 @@ packages: import-meta-resolve: 2.1.0 dev: true + /@sveltejs/adapter-netlify/1.0.0-next.84: + resolution: {integrity: sha512-i4vf3to0sV/iI39UPPhlVjOP+jZCZ048M4oHkqDM1FfJwACwgXaysdF2t4X0DV3loLmrkfarwbatjbGIECA9uQ==} + dependencies: + '@iarna/toml': 2.2.5 + esbuild: 0.15.14 + set-cookie-parser: 2.5.1 + dev: true + /@sveltejs/adapter-node/1.0.0-next.100: resolution: {integrity: sha512-XtyweoRcrnD3T/hkqv4XAlhU24VM6/QiUqR2mfs7I3Ji/KrBKWSM2GCpSptnfk3mELK193sJ0T4m6Z3x8uf47w==} dependencies: diff --git a/src/lib/components/head.svelte b/src/lib/components/head.svelte index 6f02b691..0a9dddc1 100644 --- a/src/lib/components/head.svelte +++ b/src/lib/components/head.svelte @@ -1,133 +1,39 @@ - + + {#if post} + + {#if post.type === 'article'} + {post.title} | {site.title} + {:else if post.type === 'note'} + {post.summary ?? post.path.slice(1)} | {site.title} + {/if} + {#if post.tags}{/if} + {#if post.summary}{/if} + {:else} + + + {#if page} + {page.title ?? page.path.slice(1)} | {site.title} + + {:else} + {site.subtitle ? `${site.title} - ${site.subtitle}` : site.title} + + {/if} + {/if} + {#if head.custom} + {#each head.custom({ dev, post, page }) as tag} + {@html tag} + {/each} + {/if} - - - 0} - class="fixed z-50 w-screen transition-all duration-500 ease-in-out border-b-2 border-transparent max-h-[4.125rem] {scrollY > - 32 && 'backdrop-blur border-base-content/10 bg-base-100/30 md:bg-base-200/30'}"> - {#if !search} - - - {#if headerConfig.nav} - - {/if} - {site.title} - - - {#if headerConfig.search} - (search = !search)} tabindex="0" class="btn btn-square btn-ghost"> - - - {/if} - - - - - - {#each theme as { name, text }} - { - currentTheme = name - localStorage.setItem('theme', name) - }} - class:border-2={currentTheme === name} - class:border-primary={currentTheme === name} - class="btn btn-ghost w-full hover:bg-primary group rounded-lg flex bg-base-100 p-2 transition-all"> - - {text ?? name} - - - - - - - - - {/each} - - - - - {:else} - - - (search = !search)} tabindex="0" class="btn btn-square btn-ghost"> - - - - {/if} - - - window.scrollTo(0, 0)} - class:translate-y-24={!pin || scrollY === 0} - aria-label="scroll to top" - class="fixed grid group btn btn-circle btn-lg border-none backdrop-blur bottom-6 right-6 z-50 duration-500 ease-in-out {percent > - 95 - ? 'btn-accent shadow-lg' - : 'btn-ghost bg-base-100/30 md:bg-base-200/30'}" - class:opacity-100={scrollY}> - - 95} - class="border-4 border-base-content/10 group-hover:border-transparent col-start-1 row-start-1 rounded-full w-full h-full p-4 grid duration-500 ease-in-out"> - - - \ No newline at end of file + \ No newline at end of file diff --git a/src/lib/components/header.svelte b/src/lib/components/header.svelte index 56c2fc1f..6f02b691 100644 --- a/src/lib/components/header.svelte +++ b/src/lib/components/header.svelte @@ -41,7 +41,7 @@ if (browser) currentTheme = - localStorage.getItem('theme') ?? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'night' : 'lemonade') + localStorage.getItem('theme') ?? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') @@ -55,59 +55,61 @@ class:-translate-y-32={!pin && scrollY > 0} class="fixed z-50 w-screen transition-all duration-500 ease-in-out border-b-2 border-transparent max-h-[4.125rem] {scrollY > 32 && 'backdrop-blur border-base-content/10 bg-base-100/30 md:bg-base-200/30'}"> - - - {#if headerConfig.nav} - - {/if} - {site.title} - - - - - - - - - - + + {/if} + + + + + + {#each theme as { name, text }} + { + currentTheme = name + localStorage.setItem('theme', name) + }} + class:border-2={currentTheme === name} + class:border-primary={currentTheme === name} + class="btn btn-ghost w-full hover:bg-primary group rounded-lg flex bg-base-100 p-2 transition-all"> + + {text ?? name} + + + + + + + + + {/each} + - - {#each theme as { name, text }} - { - currentTheme = name - localStorage.setItem('theme', name) - }} - class:border-2={currentTheme === name} - class:border-primary={currentTheme === name} - class="btn btn-ghost hover:bg-primary group rounded-lg flex bg-base-100 p-2 transition-all"> - - {text ?? name} - - - - - - - - - {/each} - - + {:else} + + + (search = !search)} tabindex="0" class="btn btn-square btn-ghost"> + + + + {/if} - + \ No newline at end of file
- {text ?? name} -
+ {text ?? name} +