feat: add og url field
All checks were successful
/ Build (push) Successful in 52s

This commit is contained in:
log101 2024-08-13 18:02:02 +03:00
parent 209f61b856
commit 4d0ae0c871
2 changed files with 7 additions and 3 deletions

View File

@ -3,9 +3,10 @@ interface Props {
title: string;
ogTitle?: string;
ogDescription?: string;
ogURL?: string;
}
const { title, ogTitle, ogDescription } = Astro.props;
const { title, ogTitle, ogDescription, ogURL } = Astro.props;
import "../styles/main.css";
---
@ -20,7 +21,7 @@ import "../styles/main.css";
<meta name="htmx-config" content='{"code": 204, "swap": false}' />
<meta property="og:title" content={ogTitle ?? "blog.log101.dev"} />
<meta property="og:url" content="https://blog.log101.dev" />
<meta property="og:url" content={ogURL ?? "https://blog.log101.dev"} />
<meta
property="og:description"
content={ogDescription ?? "Yazılıma dair..."}

View File

@ -12,6 +12,8 @@ import BookReview from "@/components/BookReview.astro";
const { entry } = Astro.props;
const URL = Astro.url;
const backendHost = import.meta.env.PUBLIC_BACKEND_HOST;
export async function getStaticPaths() {
@ -32,7 +34,8 @@ export async function getStaticPaths() {
<Layout
title="log101"
ogTitle={entry.data.title}
ogDescription={entry.data.summary}>
ogDescription={entry.data.summary}
ogURL={URL.toString()}>
<Header />
{
entry.collection === "blog" ? (