Skip to content

Commit

Permalink
feat: add description metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRoger committed Dec 9, 2023
1 parent 499a6b2 commit b2afa13
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/components/Prose.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ prose-headings:font-bold prose-h1:text-3xl prose-h2:text-2xl prose-h3:text-xl
prose-p:text-text dark:prose-p:text-dark_text prose-table:table-fixed
sm:prose-em:break-words sm:prose-code:break-words
prose-ul:text-text dark:prose-ul:text-dark_text prose-code:font-code
prose-ol:text-text dark:prose-ol:text-dark_text
prose-code:text-subtext1 dark:prose-code:text-dark_subtext1
prose-img:rounded-md prose-strong:text-subtext1 dark:prose-strong:text-dark_subtext1">
prose-img:rounded-md prose-strong:text-subtext1 dark:prose-strong:text-dark_subtext1
prose-a:text-subtext1 dark:prose-a:text-dark_subtext1">
<slot/>
</div>
7 changes: 5 additions & 2 deletions src/layouts/LayoutBase.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import BackToTopButton from "../components/BackToTopButton.astro";
interface Props {
title: string;
bttEnable: boolean
bttEnable: boolean;
metaDescription?: string;
}
const { title, bttEnable } = Astro.props;
const { title, bttEnable, metaDescription } = Astro.props;
---

<html lang="pt-BR">
Expand All @@ -28,6 +29,8 @@ const { title, bttEnable } = Astro.props;
<link rel="icon" type="image/png" sizes="512x512" href="/favicon/android-chrome512.png" />
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<meta name="description" content={metaDescription ??
"Blog de tecnologia com conteúdo técnico sobre programação e software."} />
<title>{title}</title>
<ViewTransitions/>
</head>
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/PostLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ interface Props {
}
const { post, author } = Astro.props;
const { id, title, date, tags, postType, image } = post;
const { id, title, date, tags, postType, description, image } = post;
const formatedDate = date.toLocaleDateString();
---

<LayoutBase title={title} bttEnable>
<LayoutBase title={title} bttEnable metaDescription={description}>
<main class="sm:mx-5 md:mx-28">
<div class="flex flex-col gap-5 mb-5">
<PostSideBarLeft/>
Expand Down

0 comments on commit b2afa13

Please sign in to comment.