redirecter for ao3 that adds opengraph metadata

add example env file

+3
.env.example
···
+
SITENAME=fixAO3
+
DESCRIPTION=Unofficial AO3 embed prettifier for social media
+
DOMAIN=localhost:3000
+4 -1
.gitignore
···
.pnpm-debug.log*
# env files (can opt-in for committing if needed)
-
.env*
+
.env
+
.env.development
+
.env.production
+
.env.staging
# vercel
.vercel
+11
src/app/globals.css
···
border-bottom: 1px white solid;
padding: 20px;
margin: 0;
+
display: flex;
+
justify-content: space-between;
+
align-items: center;
+
}
+
+
h1 a {
+
text-decoration: none;
+
}
+
+
h1 #generator-link {
+
font-size: 16px;
}
h2 {
+6 -3
src/app/layout.js
···
import "./globals.css"
export const metadata = {
-
title: "fixAO3",
-
description: "fixes yr ao3",
+
title: process.env.SITENAME,
+
description: process.env.DESCRIPTION,
};
export default function RootLayout({ children }) {
···
<html lang="en">
<body>
<div id="page">
-
<h1>fixAO3</h1>
+
<h1>
+
<a href="/">{process.env.SITENAME}</a>
+
<a href="/generator" id="generator-link">✨ generator ✨</a>
+
</h1>
{children}
</div>
</body>
+1 -1
src/app/page.js
···
<h2>How do I use it?</h2>
<p>
All you have to do is change the "ao3.org" or
-
"archiveofourown.org" part of your fic's URL to "fixao3.val.run".
+
"archiveofourown.org" part of your fic's URL to "{process.env.DOMAIN}".
It'll automatically pull in your fic's metadata and set up a
redirect. Easy as that!
</p>