Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions _config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import lume from "lume/mod.ts";
import jsx from "lume/plugins/jsx.ts";
import lightningcss from "lume/plugins/lightningcss.ts";
import mdx from "lume/plugins/mdx.ts";
import metas from "lume/plugins/metas.ts";

const site = lume({
src: "./src",
Expand All @@ -13,10 +14,33 @@ const site = lume({
site.use(mdx());
site.use(jsx());
site.use(lightningcss());
site.use(metas());

site.add("styles");
site.copy("static", "/");
site.copy("static/_headers", "/_headers");
site.copy("static/_redirects", "/_redirects");

// The metas plugin points og:url at the raw output path (e.g. "/contact.html"),
// but the host rewrites URLs to their extensionless form, so canonical links
// and og:url need to match that instead.
site.process([".html"], (pages) => {
for (const page of pages) {
if (!page.data.metas) continue;

const canonicalUrl = site.url(page.data.url, true)
.replace(/\/index\.html$/, "/")
.replace(/\.html$/, "");

const { document } = page;
document.querySelector('meta[property="og:url"]')
?.setAttribute("content", canonicalUrl);

const link = document.createElement("link");
link.setAttribute("rel", "canonical");
link.setAttribute("href", canonicalUrl);
document.head.appendChild(link);
}
});

export default site;
22 changes: 20 additions & 2 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 5 additions & 26 deletions src/_components/BaseHead.vto
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,13 @@
-->

<!-- Styling -->
<link rel="stylesheet" href="/styles/global.css" />
<meta charset="utf-8" />

<!-- Global Metadata -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="{Astro.generator}" />

<!-- Primary Meta Tags -->
<title>{{ title }}</title>
<meta name="title" content="{{ title }}" />
<meta name="description" content="{{ description }}" />

{{ set canonicalUrl = "https://erisa.uk" + url.replace(/\/index\.html$/, "/").replace(/\.html$/, "") }}

<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ canonicalUrl }}" />
<meta property="og:title" content="{{ meta_title }}" />
<meta property="og:site_name" content="Erisa's Website" />
<meta property="og:description" content="{{ description }}" />
<meta property="og:image" content="{{ image }}" />

<link rel="canonical" href="{{ canonicalUrl }}" />

<!-- Twitter -->
<meta property="twitter:url" content="{{ canonicalUrl }}" />
<meta property="twitter:title" content="{{ metaTitle }}" />
<meta property="twitter:description" content="{{ description }}" />
<link rel="stylesheet" href="/styles/global.css" />

<!-- Mastodon verification -->
<link rel="me" href="https://awau.social/@erisa" />

<!-- Primary Meta Tags -->
<title>{{ title }}</title>
<meta name="title" content="{{ title }}" />
2 changes: 1 addition & 1 deletion src/_components/ContactForm.vto
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function onSubmit() {
turnstile.reset("#turnstile");
document.getElementById("error").innerText = "Sent!";
} else if (res.status === 500) {
document.getElementById("error").innerText = " An error ocurred while sending the message.";
document.getElementById("error").innerText = "An error occurred while sending the message.";
turnstile.reset("#turnstile");
} else {
const response = await res.text();
Expand Down
3 changes: 3 additions & 0 deletions src/_data.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
metas:
site: "Erisa's Website"
image: "https://cdn.erisa.uk/avatars/common.png"
5 changes: 1 addition & 4 deletions src/_includes/page.vto
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
---
title: "Erisa!!"
meta_title: "It's me, Erisa"
description: "Hiya! This website provides links to my stuff. I think that's about it, might be more."
image: "https://cdn.erisa.uk/avatars/common.png"
turnstile: false
---
<!DOCTYPE html>
<html lang="en">
<head>
{{ await comp.BaseHead({ title, description, metaTitle: meta_title, image, url }) }}
{{ await comp.BaseHead({ title }) }}
{{ if turnstile }}
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit" class="turnstile"></script>
{{ /if }}
Expand Down
4 changes: 1 addition & 3 deletions src/_includes/post.vto
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ image: "https://cdn.erisa.uk/avatars/common.png"
<!DOCTYPE html>
<html lang="en">
<head>
{{ await comp.BaseHead({ title, description: tagline, metaTitle: title, image, url }) }}
<meta name="twitter:card" content="summary_large_image" />
<meta name="article:published_time" content="{{ date.toISOString() }}" />
{{ await comp.BaseHead({ title }) }}
<style>
body {
max-width: 850px;
Expand Down
5 changes: 5 additions & 0 deletions src/blog/_data.yml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
layout: "post.vto"
metas:
title: "=title"
description: "=tagline"
image: "=image || https://cdn.erisa.uk/avatars/common.png"
"article:published_time": "=date"
4 changes: 4 additions & 0 deletions src/blog/index.vto
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
title: Erisa blog
layout: page.vto
metas:
title: Erisa blog
description: Weirdo with strange hobbies. I think this is the website to detail some of those?
"article:published_time": null
---

<h1>Erisa blog</h1>
Expand Down
5 changes: 3 additions & 2 deletions src/contact.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
layout: 'page.vto'
title: 'Erisa - Contact'
meta_title: "Erisa's contact form!"
description: 'This page gives you a convenient way to contact me!'
metas:
title: "Erisa's contact form!"
description: 'This page gives you a convenient way to contact me!'
turnstile: true
---

Expand Down
3 changes: 3 additions & 0 deletions src/devices.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
layout: page.vto
title: Erisa's Magnificent Devices
metas:
title: Erisa's Magnificent Devices
description: A list of the various computers and phones I own or have owned.
---

<style>
Expand Down
5 changes: 3 additions & 2 deletions src/domains.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
layout: 'page.vto'
title: "Erisa's domains"
meta_title: "Erisa's domains"
description: 'Ever wanted to know what domains I own? Now you can find out!'
metas:
title: "Erisa's domains"
description: 'Ever wanted to know what domains I own? Now you can find out!'
---
# Erisa's domain list

Expand Down
7 changes: 5 additions & 2 deletions src/index.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
---
layout: 'page.vto'
title: 'Erisa!!'
metas:
title: "It's me, Erisa"
description: "Hiya! This website provides links to my stuff. I think that's about it, might be more."
---

# Erisa!

Hi there, I'm <comp.Erisa/>!<br/>
I'm in <a href="https://en.wikipedia.org/wiki/Wales" target="_blank">Wales</a>, UK and I'm a Technical Community Manager at <comp.Ts/>.
I'm in England, UK and I'm a Technical Community Manager at <comp.Ts/>.

<comp.ProjectLinks />

You're always free to reach out to me at my email address: erisa@erisa.uk

Or you can leave a message with my [Contact form](/contact.html)!

<comp.Bio />
<comp.Bio />
5 changes: 3 additions & 2 deletions src/privacy.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
layout: 'page.vto'
title: 'Erisa!! | Privacy Policy'
meta_title: 'Erisa | Privacy Policy'
description: 'Privacy? Privacy!'
metas:
title: 'Erisa | Privacy Policy'
description: 'Privacy? Privacy!'
---

# Privacy
Expand Down
2 changes: 1 addition & 1 deletion src/static/.well-known/security.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Contact: mailto:security@erisa.uk
Expires: 2026-10-15T23:00:00.000Z
Expires: 2027-10-15T23:00:00.000Z
Preferred-Languages: en
Canonical: https://erisa.uk/.well-known/security.txt