refactor(blog): description logic
This commit is contained in:
parent
88bf59ce27
commit
d89047bdfa
1 changed files with 7 additions and 6 deletions
|
@ -10,12 +10,17 @@ interface Props {
|
||||||
image?: string;
|
image?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const {isArticle = false, title, description = 'default description', image = '/cozy.jpg' } = Astro.props;
|
let {isArticle = false, title, description = 'default description', image = '/cozy.jpg' } = Astro.props;
|
||||||
|
|
||||||
|
description = title === SITE_TITLE
|
||||||
|
? SITE_DESCRIPTION
|
||||||
|
: `${SITE_TITLE} • ${description}`
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- Global Metadata -->
|
<!-- Global Metadata -->
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||||
|
|
||||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="generator" content={Astro.generator} />
|
<meta name="generator" content={Astro.generator} />
|
||||||
|
|
||||||
|
@ -24,11 +29,7 @@ const {isArticle = false, title, description = 'default description', image = '/
|
||||||
<link rel="preload" href="/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin />
|
<link rel="preload" href="/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin />
|
||||||
|
|
||||||
<!-- Primary Meta Tags -->
|
<!-- Primary Meta Tags -->
|
||||||
<title>{title} • {
|
<title>{title} • {description}</title>
|
||||||
title === SITE_TITLE
|
|
||||||
? SITE_DESCRIPTION
|
|
||||||
: `${SITE_TITLE} • ${description}`
|
|
||||||
}</title>
|
|
||||||
<meta name="title" content={title} />
|
<meta name="title" content={title} />
|
||||||
<meta name="description" content={description} />
|
<meta name="description" content={description} />
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue