redirecter for ao3 that adds opengraph metadata

add example env file

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