mirror of
https://github.com/kogakure/website-astro-stefanimhoff.de.git
synced 2026-02-03 20:15:27 +00:00
feat: add meta tags, and links, and other SEO optimization to the head
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
"astro": "^2.5.5",
|
||||
"astro-icon": "^0.8.0",
|
||||
"astro-imagetools": "^0.8.1",
|
||||
"astro-seo": "^0.7.4",
|
||||
"autoprefixer": "^10.4.14",
|
||||
"chart.js": "^4.3.0",
|
||||
"chartjs-plugin-autocolors": "^0.2.2",
|
||||
|
||||
7
pnpm-lock.yaml
generated
7
pnpm-lock.yaml
generated
@@ -33,6 +33,9 @@ dependencies:
|
||||
astro-imagetools:
|
||||
specifier: ^0.8.1
|
||||
version: 0.8.1(astro@2.5.5)
|
||||
astro-seo:
|
||||
specifier: ^0.7.4
|
||||
version: 0.7.4
|
||||
autoprefixer:
|
||||
specifier: ^10.4.14
|
||||
version: 10.4.14(postcss@8.4.24)
|
||||
@@ -3576,6 +3579,10 @@ packages:
|
||||
imagetools-core: 3.0.2
|
||||
dev: false
|
||||
|
||||
/astro-seo@0.7.4:
|
||||
resolution: {integrity: sha512-E+wJmxOnvBRjgzVctdGk/VdwoEqeQ6Q/KgVW2wRBXZWJVDgOweB32Da/UiH0/FpGncPzo2daOrc08DNn5wTanw==}
|
||||
dev: false
|
||||
|
||||
/astro@2.5.5(@types/node@16.9.1)(sharp@0.32.1):
|
||||
resolution: {integrity: sha512-VRwnlfRtPALeOxfE4e7To5Vlu9pGwlTRWN1zkn1QTizwfg0rLirFTm6t2MCG/fUhlu/p3QO9tz8SpAIyDq53/Q==}
|
||||
engines: {node: '>=16.12.0', npm: '>=6.14.0'}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Shokunin – The Spirit of an Artisan
|
||||
slug: shokunin
|
||||
date: 2023-03-08
|
||||
author: Stefan Imhoff
|
||||
description: The Japanese word “shokunin” describes an artisan or craftsman. In this essay, I investigate the meaning and history of the word and show a variety of examples.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
import '../styles/global.css';
|
||||
import { Sprite } from 'astro-icon';
|
||||
import { SEO } from 'astro-seo';
|
||||
import { site } from '../data/site';
|
||||
|
||||
import ThemeProvider from '../components/ThemeProvider.astro';
|
||||
import PageHeader from '../components/PageHeader.astro';
|
||||
@@ -9,52 +11,142 @@ import Sal from '../components/Sal.astro';
|
||||
|
||||
export interface Props {
|
||||
backLink?: string;
|
||||
cover?: string;
|
||||
description?: string;
|
||||
footer?: boolean;
|
||||
header?: boolean;
|
||||
nofollow?: boolean;
|
||||
noindex?: boolean;
|
||||
title: string;
|
||||
}
|
||||
|
||||
const { backLink, footer = true, header = true, title, description } = Astro.props;
|
||||
const {
|
||||
backLink,
|
||||
description,
|
||||
footer = true,
|
||||
header = true,
|
||||
nofollow,
|
||||
noindex,
|
||||
title,
|
||||
cover = '/assets/images/branding/og/bonsai.jpg',
|
||||
} = Astro.props;
|
||||
const currentPath = new URL(Astro.request.url).pathname;
|
||||
const fullTitle = `${title} · ${site.description}`;
|
||||
const fullDescription = description || site.description;
|
||||
const fullUrl = site.url + currentPath;
|
||||
const fullImage = site.url + cover;
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" class="no-js box-border scroll-smooth text-[125%]">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
|
||||
<title>{title}</title>
|
||||
|
||||
<meta name="description" content={description} />
|
||||
<SEO
|
||||
charset="UTF-8"
|
||||
title={fullTitle}
|
||||
description={fullDescription}
|
||||
canonical={fullUrl}
|
||||
nofollow={nofollow}
|
||||
noindex={noindex}
|
||||
openGraph={{
|
||||
basic: {
|
||||
image: fullImage,
|
||||
title: fullTitle,
|
||||
type: 'article',
|
||||
url: fullUrl,
|
||||
},
|
||||
image: {
|
||||
height: 675,
|
||||
width: 1200,
|
||||
},
|
||||
optional: {
|
||||
description: fullDescription,
|
||||
},
|
||||
}}
|
||||
twitter={{
|
||||
card: 'summary_large_image',
|
||||
creator: site.twitter,
|
||||
description: fullDescription,
|
||||
image: fullImage,
|
||||
site: site.twitter,
|
||||
title: fullTitle,
|
||||
}}
|
||||
extend={{
|
||||
link: [
|
||||
{ rel: 'icon', href: '/favicon.ico' },
|
||||
{
|
||||
rel: 'icon',
|
||||
href: '/assets/images/branding/favicons/favicon.svg',
|
||||
type: 'image/svg+xml',
|
||||
},
|
||||
{
|
||||
rel: 'apple-touch-icon',
|
||||
href: '/assets/images/branding/favicons/apple-touch-icon.png',
|
||||
},
|
||||
{
|
||||
rel: 'manifest',
|
||||
href: '/manifest.webmanifest',
|
||||
},
|
||||
{
|
||||
as: 'font',
|
||||
crossorigin: '',
|
||||
href: '/assets/fonts/secuela-regular-vf.woff2',
|
||||
rel: 'preload',
|
||||
type: 'font/woff2',
|
||||
},
|
||||
{
|
||||
as: 'font',
|
||||
crossorigin: '',
|
||||
href: '/assets/fonts/secuela-italic-vf.woff2',
|
||||
rel: 'preload',
|
||||
type: 'font/woff2',
|
||||
},
|
||||
{
|
||||
rel: 'alternate',
|
||||
type: 'application/rss+xml',
|
||||
title: 'Stefan Imhoff',
|
||||
href: site.url + '/rss.xml',
|
||||
},
|
||||
{
|
||||
rel: 'alternate',
|
||||
type: 'application/rss+xml',
|
||||
title: 'Stefan Imhoff (Haiku)',
|
||||
href: site.url + '/rss-haiku.xml',
|
||||
},
|
||||
{
|
||||
rel: 'alternate',
|
||||
type: 'application/rss+xml',
|
||||
title: 'Stefan Imhoff (Sketchnotes)',
|
||||
href: site.url + '/rss-sketchnotes.xml',
|
||||
},
|
||||
{
|
||||
rel: 'alternate',
|
||||
type: 'application/rss+xml',
|
||||
title: 'Stefan Imhoff (AI Art)',
|
||||
href: site.url + '/rss-ai-art.xml',
|
||||
},
|
||||
{
|
||||
rel: 'alternate',
|
||||
type: 'application/rss+xml',
|
||||
title: 'Stefan Imhoff (Projects)',
|
||||
href: site.url + '/rss-projects.xml',
|
||||
},
|
||||
],
|
||||
meta: [
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
||||
{ name: 'author', content: site.author },
|
||||
{ name: 'generator', content: Astro.generator },
|
||||
{ name: 'theme-color', content: '#e7e6e4' },
|
||||
],
|
||||
}}
|
||||
/>
|
||||
|
||||
<script type="module">
|
||||
document.documentElement.classList.remove('no-js');
|
||||
document.documentElement.classList.add('js');
|
||||
</script>
|
||||
|
||||
<link rel="icon" href="/favicon.ico" sizes="any" />
|
||||
<link rel="icon" href="/assets/images/branding/favicons/favicon.svg" type="image/svg+xml" />
|
||||
<link rel="apple-touch-icon" href="/assets/images/branding/favicons/apple-touch-icon.png" />
|
||||
<!-- <link rel="manifest" href="/manifest.webmanifest" /> -->
|
||||
|
||||
<link
|
||||
as="font"
|
||||
crossorigin
|
||||
href="/assets/fonts/secuela-regular-vf.woff2"
|
||||
rel="preload"
|
||||
type="font/woff2"
|
||||
/>
|
||||
<link
|
||||
as="font"
|
||||
crossorigin
|
||||
href="/assets/fonts/secuela-italic-vf.woff2"
|
||||
rel="preload"
|
||||
type="font/woff2"
|
||||
/>
|
||||
<Sal />
|
||||
|
||||
<ThemeProvider />
|
||||
</head>
|
||||
<body
|
||||
|
||||
@@ -6,24 +6,30 @@ import BaseLayout from './BaseLayout.astro';
|
||||
export interface Props {
|
||||
backLink?: string;
|
||||
class?: string;
|
||||
cover?: string;
|
||||
description?: string;
|
||||
footer?: boolean;
|
||||
gap?: boolean;
|
||||
grid?: 'fullsize' | 'wide' | 'narrow';
|
||||
header?: boolean;
|
||||
innerGrid?: boolean;
|
||||
nofollow?: boolean;
|
||||
noindex?: boolean;
|
||||
title: string;
|
||||
}
|
||||
|
||||
const {
|
||||
backLink,
|
||||
class: className,
|
||||
cover,
|
||||
description,
|
||||
footer = true,
|
||||
gap = true,
|
||||
grid = 'narrow',
|
||||
header,
|
||||
innerGrid,
|
||||
nofollow,
|
||||
noindex,
|
||||
title,
|
||||
} = Astro.props;
|
||||
|
||||
@@ -48,10 +54,13 @@ const wrapperClasses = cx(
|
||||
|
||||
<BaseLayout
|
||||
backLink={backLink}
|
||||
cover={cover}
|
||||
description={description}
|
||||
footer={footer}
|
||||
header={header}
|
||||
nofollow={nofollow}
|
||||
noindex={noindex}
|
||||
title={title}
|
||||
description={description}
|
||||
>
|
||||
<div class={gridClasses}>
|
||||
<slot name="title" />
|
||||
|
||||
@@ -13,7 +13,15 @@ const title = 'Error 404';
|
||||
const description = 'Page not found.';
|
||||
---
|
||||
|
||||
<GridLayout title={title} description={description} grid="wide" class="grid" innerGrid>
|
||||
<GridLayout
|
||||
class="grid"
|
||||
description={description}
|
||||
grid="wide"
|
||||
innerGrid
|
||||
nofollow={true}
|
||||
noindex={true}
|
||||
title={title}
|
||||
>
|
||||
<PageTitle grid="wide" innerGrid>Not Found.</PageTitle>
|
||||
<Verse
|
||||
class="z-10 col-start-1 col-end-17 row-start-2 text-3 italic mbe-10 mbs-10 md:col-start-3 md:col-end-9"
|
||||
|
||||
@@ -48,7 +48,16 @@ const title = entry.data.title;
|
||||
const description = entry.data.description;
|
||||
---
|
||||
|
||||
<GridLayout title={title} description={description} grid="fullsize" innerGrid backLink="/journal/">
|
||||
<GridLayout
|
||||
backLink="/journal/"
|
||||
cover={entry.data.cover}
|
||||
description={description}
|
||||
grid="fullsize"
|
||||
innerGrid
|
||||
nofollow={entry.data.nofollow}
|
||||
noindex={entry.data.noindex}
|
||||
title={title}
|
||||
>
|
||||
<PageTitle slot="title" class="!text-6">
|
||||
{entry.data.title}
|
||||
</PageTitle>
|
||||
|
||||
@@ -27,7 +27,15 @@ const description =
|
||||
'The curriculum vitae of Stefan Imhoff, Senior Software Engineer from Hamburg, Germany.';
|
||||
---
|
||||
|
||||
<GridLayout title={title} description={description} grid="wide" class="grid" innerGrid>
|
||||
<GridLayout
|
||||
class="grid"
|
||||
description={description}
|
||||
grid="wide"
|
||||
innerGrid
|
||||
nofollow={true}
|
||||
noindex={true}
|
||||
title={title}
|
||||
>
|
||||
<PageTitle grid="wide" innerGrid>Curriculum Vitae</PageTitle>
|
||||
|
||||
<article class="col-span-full md:col-start-1 md:col-end-9" {...animation}>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
layout: ../layouts/PageLayout.astro
|
||||
title: Imprint
|
||||
description: The imprint of this website.
|
||||
noindex: true
|
||||
nofollow: true
|
||||
---
|
||||
|
||||
import { mapping } from "../mdx-components.ts";
|
||||
|
||||
@@ -11,5 +11,7 @@ export const aiArt = defineCollection({
|
||||
aspectRatio: z.number(),
|
||||
})
|
||||
),
|
||||
noindex: z.boolean().optional(),
|
||||
nofollow: z.boolean().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -5,5 +5,7 @@ export const haiku = defineCollection({
|
||||
date: z.date(),
|
||||
de: z.string(),
|
||||
en: z.string(),
|
||||
noindex: z.boolean().optional(),
|
||||
nofollow: z.boolean().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -29,5 +29,7 @@ export const journal = defineCollection({
|
||||
])
|
||||
),
|
||||
series: z.string().optional(),
|
||||
noindex: z.boolean().optional(),
|
||||
nofollow: z.boolean().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -38,5 +38,7 @@ export const projects = defineCollection({
|
||||
})
|
||||
.optional(),
|
||||
class: z.string().optional(),
|
||||
noindex: z.boolean().optional(),
|
||||
nofollow: z.boolean().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -11,5 +11,7 @@ export const sketchnotes = defineCollection({
|
||||
aspectRatio: z.number(),
|
||||
})
|
||||
),
|
||||
noindex: z.boolean().optional(),
|
||||
nofollow: z.boolean().optional(),
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user