fix(opengraph): added mandatory opengraph tags to all pages. Also fixed some other minor bugs

This commit is contained in:
2023-09-24 01:25:53 +02:00
parent 4e6b042a44
commit 98a3eb71f5
19 changed files with 34 additions and 20 deletions

View File

@@ -13,7 +13,7 @@ const CategoriesTemplate: React.FC = () => {
const categories = useCategoriesList();
return (
<Layout title={`Categories - ${title}`} description={subtitle}>
<Layout title={`Categories - ${title}`} description={subtitle} slug="/categories/">
<Sidebar />
<Page title="Categories">
<ul>

View File

@@ -28,7 +28,7 @@ const CategoryTemplate: React.FC<Props> = ({ data, pageContext }: Props) => {
currentPage > 0 ? `${group} - Page ${currentPage} - ${siteTitle}` : `${group} - ${siteTitle}`;
return (
<Layout title={pageTitle} description={siteSubtitle}>
<Layout title={pageTitle} description={siteSubtitle} slug={`/category/${group}/`}>
<Sidebar />
<Page title={group}>
<Feed edges={edges} />

View File

@@ -26,7 +26,7 @@ const IndexTemplate: React.FC<Props> = ({ data, pageContext }: Props) => {
const pageTitle = currentPage > 0 ? `Posts - Page ${currentPage} - ${siteTitle}` : siteTitle;
return (
<Layout title={pageTitle} description={siteSubtitle}>
<Layout title={pageTitle} description={siteSubtitle} slug="">
<Sidebar isIndex />
<Page>
<Feed edges={edges} />

View File

@@ -10,7 +10,7 @@ const NotFoundTemplate: React.FC = () => {
const { title, subtitle } = useSiteMetadata();
return (
<Layout title={`Not Found - ${title}`} description={subtitle}>
<Layout title={`Not Found - ${title}`} description={subtitle} slug="/404.html">
<Sidebar />
<Page title="Oh no! page be lost">
<p>

View File

@@ -26,6 +26,7 @@ const PageTemplate: React.FC<Props> = ({ data }: Props) => {
title={`${title} - ${siteTitle}`}
description={metaDescription}
socialImage={socialImage?.publicURL}
slug={data.markdownRemark.fields.slug}
>
<Sidebar />
<Page title={title}>
@@ -40,6 +41,9 @@ export const query = graphql`
markdownRemark(fields: { slug: { eq: $slug } }) {
id
html
fields {
slug
}
frontmatter {
title
date

View File

@@ -24,6 +24,7 @@ const PostTemplate: React.FC<Props> = ({ data }: Props) => {
title={`${title} - ${siteTitle}`}
description={metaDescription}
socialImage={socialImage?.publicURL}
slug={data.markdownRemark.fields.slug}
>
<Post post={data.markdownRemark} />
</Layout>

View File

@@ -28,7 +28,7 @@ const TagTemplate: React.FC<Props> = ({ data, pageContext }: Props) => {
currentPage > 0 ? `${group} - Page ${currentPage} - ${siteTitle}` : `${group} - ${siteTitle}`;
return (
<Layout title={pageTitle} description={siteSubtitle}>
<Layout title={pageTitle} description={siteSubtitle} slug={`/tag/${group}/`}>
<Sidebar />
<Page title={group}>
<Feed edges={edges} />

View File

@@ -13,7 +13,7 @@ const TagsTemplate: React.FC = () => {
const tags = useTagsList();
return (
<Layout title={`Tags - ${title}`} description={subtitle}>
<Layout title={`Tags - ${title}`} description={subtitle} slug="/tags/">
<Sidebar />
<Page title="Tags">
<ul>