Fix shareable url

This commit is contained in:
prototypa
2022-11-07 17:42:09 -05:00
parent 570900c4cb
commit 801b4fd01b
2 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ import SocialShare from '~/components/atoms/SocialShare.astro';
import { getFormattedDate } from '~/utils/utils'; import { getFormattedDate } from '~/utils/utils';
const { post, canonical } = Astro.props; const { post, url } = Astro.props;
--- ---
<section class="py-8 sm:py-16 lg:py-20 mx-auto"> <section class="py-8 sm:py-16 lg:py-20 mx-auto">
@ -45,7 +45,7 @@ const { post, canonical } = Astro.props;
<div class="container mx-auto px-6 sm:px-6 max-w-3xl mt-8 flex justify-between flex-col sm:flex-row"> <div class="container mx-auto px-6 sm:px-6 max-w-3xl mt-8 flex justify-between flex-col sm:flex-row">
<PostTags tags={post.tags} class="mr-5" /> <PostTags tags={post.tags} class="mr-5" />
<SocialShare <SocialShare
url={canonical} url={url}
text={post.title} text={post.title}
class="mt-5 sm:mt-1 align-middle text-gray-400 dark:text-slate-600" class="mt-5 sm:mt-1 align-middle text-gray-400 dark:text-slate-600"
/> />

View File

@ -23,12 +23,12 @@ export async function getStaticPaths() {
} }
const { post } = Astro.props; const { post } = Astro.props;
const canonical = post.canonical || getCanonical(getPermalink(post.slug, 'post')); const url = getCanonical(getPermalink(post.slug, 'post'));
const meta = { const meta = {
title: `${post.title} — ${SITE.name}`, title: `${post.title} — ${SITE.name}`,
description: post.description, description: post.description,
canonical: canonical, canonical: post.canonical || url,
image: await findImage(post.image), image: await findImage(post.image),
ogTitle: post.title, ogTitle: post.title,
ogType: 'article', ogType: 'article',
@ -36,5 +36,5 @@ const meta = {
--- ---
<Layout {meta}> <Layout {meta}>
<SinglePost post={{ ...post, image: meta.image }} canonical={canonical} /> <SinglePost post={{ ...post, image: meta.image }} url={url} />
</Layout> </Layout>