chore: finished migration

This commit is contained in:
Alexander Daichendt 2022-08-22 15:36:05 +02:00
parent 0e58e8c7e2
commit 97acbbd226
16 changed files with 80 additions and 59 deletions

View file

@ -15,7 +15,7 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "next",
"@sveltejs/kit": "1.0.0-next.413",
"@sveltejs/kit": "^1.0.0-next.428",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"autoprefixer": "^10.4.7",

View file

@ -0,0 +1,25 @@
<script lang="ts">
import { page } from '$app/stores';
export let title = "Alex Daichendt's website";
export let keywords: string[] = [];
export let description: string;
let seo = $page.data?.seo;
if (seo) {
title = seo.title ? `${seo.title} - Alex Daichendt` : "Alex Daichendt's website";
description = seo.description;
keywords = seo.keywords;
}
</script>
<svelte:head
><title>{title}</title>
{#if description}
<meta name="description" content={description} />
{/if}
<meta name="author" content="Alexander Daichendt" />
{#if keywords}
<meta name="keywords" content={keywords.join(',')} />
{/if}
</svelte:head>

View file

@ -12,6 +12,12 @@
import Icon from 'mdi-svelte';
import Divider from '$components/Divider.svelte';
import '$lib/utils/one-dark.css';
import SEO from '$components/SEO.svelte';
// svelte-ignore unused-export-let
export let data;
// svelte-ignore unused-export-let
export let errors;
export let title;
// svelte-ignore unused-export-let
@ -24,6 +30,8 @@
export let hidden = false;
</script>
<SEO {title} {description} {keywords} />
<h1>{title}</h1>
<aside role="note">
{#if updated}

View file

@ -1,37 +1,10 @@
<script lang="ts">
import { page } from '$app/stores';
import MoveUpButton from '$components/MoveUpButton.svelte';
import Footer from '$lib/components/Footer.svelte';
import Header from '$lib/components/Header.svelte';
import '@fontsource/ubuntu-mono/400.css';
// svelte-ignore unused-export-let
export let data;
let seo = $page.data?.seo;
let wrappedTitle = "Alex Daichendt's website";
let description = '';
let keywords: string[] = [];
if (seo) {
wrappedTitle = seo.title ? `${seo.title} - Alex Daichendt` : "Alex Daichendt's website";
description = seo.description;
keywords = seo.keywords;
}
</script>
<svelte:head
><title>{wrappedTitle}</title>
{#if description}
<meta name="description" content={description} />
{/if}
<meta name="author" content="Alexander Daichendt" />
{#if keywords}
<meta name="keywords" content={keywords.join(',')} />
{/if}
</svelte:head>
<div class="container upper">
<Header />
<div class="content">

View file

@ -1,4 +1,5 @@
<script lang="ts">
import SEO from '$components/SEO.svelte';
import ListItem from '$components/ListItem.svelte';
import Link from '$components/Link.svelte';
import type { Skill } from '$lib/utils/types';
@ -53,6 +54,8 @@
];
</script>
<SEO />
<h1>Hi, my name is Alex!</h1>
<p>I am a software engineer, Linux enthusiast and a friend of automation.</p>

View file

@ -1,12 +1,15 @@
<script lang="ts">
import type { BlogPostMeta } from '$lib/utils/types';
import SEO from '$components/SEO.svelte';
import Link from '$components/Link.svelte';
import ListItem from '$components/ListItem.svelte';
import type { PageData } from './$types';
export let data;
const posts: BlogPostMeta[] = data.posts;
export let data: PageData;
$: posts = data.posts;
</script>
<SEO />
<h1>Blog Posts</h1>
<p>Sometimes I document some of the things I do.</p>

View file

@ -1,7 +1,6 @@
import type { LoadEvent } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export async function load({ data }: LoadEvent): PageLoad {
export const load: PageLoad = ({ data }) => {
return {
posts: data.posts,
seo: {
@ -10,4 +9,4 @@ export async function load({ data }: LoadEvent): PageLoad {
'My blogposts, where I occasionally document things, that I think are not accessible or badly documented.',
},
};
}
};

View file

@ -1,13 +1,16 @@
<script lang="ts">
throw new Error("@migration task: Add data prop (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292707)");
import type { PageData } from './$types';
import Image from '$lib/components/CatImage.svelte';
import type { ImageMetadata } from '$lib/utils/types';
import Link from '$lib/components/Link.svelte';
import SEO from '$components/SEO.svelte';
export let cats: { images: ImageMetadata[] }[];
export let data: PageData;
$: cats = data.cats;
</script>
<SEO />
<section class="masonry">
{#each cats as cat}
<figure>

View file

@ -1,13 +1,9 @@
import type { LoadEvent, LoadOutput } from '@sveltejs/kit';
import type { PageLoad } from './$types';
export async function load({ fetch }: LoadEvent): PageLoadOutput {
export const load: PageLoad = async ({ fetch }) => {
const response = await fetch('https://cats.daichendt.one/list');
const asJson = await response.json();
throw new Error("@migration task: Migrate this return statement (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693)");
return {
status: response.status,
props: {
cats: response.ok && asJson,
},
};
}
};

View file

@ -1,4 +1,5 @@
<script>
import SEO from '$components/SEO.svelte';
import { mdiEmailEditOutline, mdiKey } from '@mdi/js';
import { mdiGithub } from '@mdi/js';
import Icon from 'mdi-svelte';
@ -7,6 +8,8 @@
import ListItem from '$components/ListItem.svelte';
</script>
<SEO />
<h1>Contact Information</h1>
<ul>

View file

@ -1,7 +1,6 @@
export async function load() {
throw new Error("@migration task: Migrate this return statement (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693)");
return {
stuff: {
seo: {
title: 'Contact',
description: 'All the communication channels for contacting Alex Daichendt ',
},

View file

@ -1,3 +1,9 @@
<script>
import SEO from '$components/SEO.svelte';
</script>
<SEO />
<h1>Impressum</h1>
<p>Information according to §5 TMG:</p>

View file

@ -1,7 +1,6 @@
export async function load() {
throw new Error("@migration task: Migrate this return statement (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693)");
return {
stuff: {
seo: {
title: 'Impressum',
description: 'The impressum I have to include for Germany.',
},

View file

@ -1,3 +1,9 @@
<script>
import SEO from '$components/SEO.svelte';
</script>
<SEO />
<h1>Privacy Policy for AlexDaichendt</h1>
<p>

View file

@ -1,10 +1,9 @@
export async function load() {
throw new Error("@migration task: Migrate this return statement (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292693)");
return {
stuff: {
seo: {
title: 'Privacy',
description:
'The privacy policy I have to include even though I don"t collect any data or use shady services.',
'The privacy policy I have to include even though I do not collect any data or use shady services.',
},
};
}

View file

@ -159,13 +159,12 @@
"@vercel/nft" "^0.20.0"
esbuild "^0.14.48"
"@sveltejs/kit@1.0.0-next.413":
version "1.0.0-next.413"
resolved "https://registry.yarnpkg.com/@sveltejs/kit/-/kit-1.0.0-next.413.tgz#f79e4a0d582621aaf9016e37826b180f9f3be0aa"
integrity sha512-6rboaf0LuMEOmW+wyyAmBJ7q8/TyRxJ3ESc8t/k9l0NGXoQ2l61IzHKuHxcxjriKczZFdGFuB97j8wQ/PlLyHA==
"@sveltejs/kit@^1.0.0-next.428":
version "1.0.0-next.428"
resolved "https://registry.yarnpkg.com/@sveltejs/kit/-/kit-1.0.0-next.428.tgz#8ca0c4a96d67763e9b2d2e27a2c6eada41d62b6b"
integrity sha512-CVp7zltQ+3VOII1s7KuvgvGEFwD0PSqts9R3q4eaj0CNoC3gpdzcbEZayyQwXX/3lI1HdSNSF8gxbX0TRUoFuA==
dependencies:
"@sveltejs/vite-plugin-svelte" "^1.0.1"
chokidar "^3.5.3"
cookie "^0.5.0"
devalue "^2.0.1"
kleur "^4.1.4"
@ -528,7 +527,7 @@ character-entities@^2.0.0:
resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.2.tgz#2d09c2e72cd9523076ccb21157dff66ad43fcc22"
integrity sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==
chokidar@^3.4.1, chokidar@^3.5.3:
chokidar@^3.4.1:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==