fix: lighthouse issues

This commit is contained in:
Alexander Daichendt 2025-01-02 00:08:25 +01:00
parent 91182a834c
commit a31e367ef5
3 changed files with 97 additions and 64 deletions

38
public/robots.txt Normal file
View file

@ -0,0 +1,38 @@
User-agent: GPTBot
Disallow: /
User-agent: ChatGPT-User
Disallow: /
User-agent: Google-Extended
Disallow: /
User-agent: CCBot
Disallow: /
User-agent: anthropic-ai
Disallow: /
User-agent: Claude-Web
Disallow: /
User-agent: cohere-ai
Disallow: /
User-agent: Omgilibot
Disallow: /
User-agent: Omgili
Disallow: /
User-agent: FacebookBot
Disallow: /
User-agent: Amazonbot
Disallow: /
# Common AI scraper endpoints
Disallow: /*?*source=
Disallow: /*?*ref=
Disallow: /*?*ai=
Disallow: /*&*ai=

View file

@ -1,7 +1,7 @@
--- ---
pubDate: '2025-01-02' pubDate: '2025-01-02'
title: 'Building a CV verification tool in Typst, Astro and Cloudflare D1' title: 'Building a CV verification tool in Typst, Astro and Cloudflare D1'
description: "" description: "Technical details on how I built a CV verification tool in Typst, Astro and Cloudflare D1."
keywords: keywords:
- CV - CV
- verification - verification

View file

@ -5,77 +5,72 @@ import BaseLayout from "./BaseLayout.astro";
import { Picture } from "astro:assets"; import { Picture } from "astro:assets";
type Props = CollectionEntry<"blog">["data"] & { type Props = CollectionEntry<"blog">["data"] & {
readingTime: number; readingTime: number;
}; };
const { title, description, pubDate, updatedDate, heroImage, readingTime } = const { title, description, pubDate, updatedDate, heroImage, readingTime } =
Astro.props; Astro.props;
--- ---
<BaseLayout title={title} description={description}> <BaseLayout title={title} description={description}>
<article> <article>
<div class="hero-image"> <div class="hero-image">
{ {heroImage && <Picture src={heroImage} alt="" width={752} />}
heroImage && ( </div>
<Picture src={heroImage} alt="" width={1020} height={510} /> <div class="prose">
) <div class="title">
} <div class="date">
<FormattedDate date={pubDate} />
{
updatedDate && (
<div class="last-updated-on">
Last updated on <FormattedDate date={updatedDate} />
</div>
)
}
</div> </div>
<div class="prose"> <h1>{title}</h1>
<div class="title"> <p>{readingTime}</p>
<div class="date"> <hr />
<FormattedDate date={pubDate} /> </div>
{ <slot />
updatedDate && ( </div>
<div class="last-updated-on"> </article>
Last updated on{" "}
<FormattedDate date={updatedDate} />
</div>
)
}
</div>
<h1>{title}</h1>
<p>{readingTime}</p>
<hr />
</div>
<slot />
</div>
</article>
</BaseLayout> </BaseLayout>
<style> <style>
main { main {
width: calc(100% - 2em); width: calc(100% - 2em);
max-width: 100%; max-width: 100%;
margin: 0; margin: 0;
} }
.hero-image { .hero-image {
width: 100%; width: 100%;
} }
.hero-image img { .hero-image img {
display: block; display: block;
margin: 0 auto; margin: 0 auto;
border-radius: 12px; border-radius: 12px;
box-shadow: var(--box-shadow); box-shadow: var(--box-shadow);
} }
.prose { .prose {
color: rgb(var(--gray-dark)); color: rgb(var(--gray-dark));
text-wrap: pretty; text-wrap: pretty;
} }
.title { .title {
margin-bottom: 1em; margin-bottom: 1em;
padding: 1em 0; padding: 1em 0;
text-align: center; text-align: center;
line-height: 1; line-height: 1;
} }
.title h1 { .title h1 {
margin: 0 0 0.5em 0; margin: 0 0 0.5em 0;
} }
.date { .date {
margin-bottom: 0.5em; margin-bottom: 0.5em;
color: rgb(var(--gray)); color: rgb(var(--gray));
} }
.last-updated-on { .last-updated-on {
font-style: italic; font-style: italic;
} }
</style> </style>