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

@ -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,
},
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.',
},
};
}