feat: add PostHead

show blog post details in embed
This commit is contained in:
xHyroM 2023-02-24 20:55:36 +01:00
parent 64057f3ae2
commit 84a249e4de
4 changed files with 72 additions and 31 deletions

View file

@ -0,0 +1,30 @@
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Primary Meta Tags -->
<title>xHyroM</title>
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="canonical" href="https://xhyrom.me"/>
<meta name="title" content="xHyroM" />
<meta name="description" content="I'm Hyro :) o/" />
<meta name="keywords" content="xhyrom developer dev hyro hyrousek"/>
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://xhyrom.me/" />
<meta property="og:title" content="xHyroM" />
<meta property="og:description" content="I'm Hyro :) o/" />
<meta property="og:image" content="/banner.png" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://xhyrom.me/" />
<meta property="twitter:title" content="xHyroM" />
<meta property="twitter:description" content="I'm Hyro :) o/" />
<meta property="twitter:image" content="/banner.png" />
<!-- CSP -->
<meta
http-equiv="Content-Security-Policy"
content="img-src 'self'; font-src *; style-src 'self' 'unsafe-inline' fonts.googleapis.com; script-src 'self' 'unsafe-inline'; object-src 'none'"
/>

View file

@ -0,0 +1,35 @@
---
const url = Astro.url.pathname;
const { title } = Astro.props;
---
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Primary Meta Tags -->
<title>xHyroM</title>
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="canonical" href={`https://xhyrom.me${url}`}/>
<meta name="title" content="xHyroM" />
<meta name="description" content={title} />
<meta name="keywords" content="xhyrom developer dev hyro hyrousek"/>
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content={`https://xhyrom.me${url}`} />
<meta property="og:title" content="xHyroM" />
<meta property="og:description" content={title} />
<meta property="og:image" content="/banner.png" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content={`https://xhyrom.me${url}`} />
<meta property="twitter:title" content="xHyroM" />
<meta property="twitter:description" content={title} />
<meta property="twitter:image" content="/banner.png" />
<!-- CSP -->
<meta
http-equiv="Content-Security-Policy"
content="img-src 'self'; font-src *; style-src 'self' 'unsafe-inline' fonts.googleapis.com; script-src 'self' 'unsafe-inline'; object-src 'none'"
/>

View file

@ -1,6 +1,7 @@
---
import Snow from "../components/widgets/Snow.astro";
import Fireworks from "../components/widgets/Fireworks.astro";
import DefaultHead from "../components/widgets/Head.astro";
const date = new Date();
@ -10,41 +11,15 @@ const fireworks =
const snow =
(date.getMonth() === 11 && date.getDate() === 10) ||
(date.getMonth() === 0 && date.getDate() <= 3);
const { head } = Astro.props;
const Head = head || DefaultHead;
---
<!DOCTYPE html>
<html lang="sk-SK">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Primary Meta Tags -->
<title>xHyroM</title>
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<link rel="canonical" href="https://xhyrom.me"/>
<meta name="title" content="xHyroM" />
<meta name="description" content="I'm Hyro :) o/" />
<meta name="keywords" content="xhyrom developer dev hyro hyrousek"/>
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta property="og:url" content="https://hyrousek.tk/" />
<meta property="og:title" content="xHyroM" />
<meta property="og:description" content="I'm Hyro :) o/" />
<meta property="og:image" content="/banner.png" />
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="https://hyrousek.tk/" />
<meta property="twitter:title" content="xHyroM" />
<meta property="twitter:description" content="I'm Hyro :) o/" />
<meta property="twitter:image" content="/banner.png" />
<!-- CSP -->
<meta
http-equiv="Content-Security-Policy"
content="img-src 'self'; font-src *; style-src 'self' 'unsafe-inline' fonts.googleapis.com; script-src 'self' 'unsafe-inline'; object-src 'none'"
/>
<Head {...Astro.props} />
</head>
<body class="overflow-x-hidden bg-dark font-sans">
<slot />

View file

@ -1,4 +1,5 @@
---
import PostHead from "../../components/widgets/blog/PostHead.astro";
import Container from "../../components/atoms/Container.astro";
import Navbar from "../../components/widgets/Navbar.astro";
import Layout from "../Layout.astro"
@ -14,7 +15,7 @@ const {
} = Astro.props;
---
<Layout>
<Layout head={PostHead} title={title}>
<Navbar />
<h1 class="text-white text-5xl w-full text-center py-32 font-extrabold">
{title}