Skip to content

Commit

Permalink
Merge pull request #27 from calimania/feat/product-link
Browse files Browse the repository at this point in the history
Fixes after user tests
  • Loading branch information
dvidsilva authored Jan 5, 2025
2 parents ceec448 + 299ee7f commit 6fbc2bd
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
18 changes: 18 additions & 0 deletions src/interfaces/Product.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ export default interface Product {
SEO: {
metaTitle: string,
metaDescription: string,
socialImage: {
id: string,
url: string,
formats: {
medium: {
ext: string,
url: string,
width: number,
height: number,
},
small: {
ext: string,
url: string,
width: number,
height: number,
}
}
},
metaImage: {
id: string,
url: string,
Expand Down
5 changes: 4 additions & 1 deletion src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ const stores = await getCollection("stores");
const store = stores.find(
store => store.data.slug == markketplace.STORE_SLUG
)?.data;
let href = new URL(Astro.url.pathname, Astro.site);
---

<!doctype html>
Expand Down Expand Up @@ -124,7 +126,8 @@ const store = stores.find(
/>
<meta
property="og:url"
content={meta?.url ||
content={href ||
meta?.url ||
post?.data?.SEO?.metaUrl ||
store?.SEO?.metaUrl ||
canonicalURL}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const links = store?.URLS || [];
<strong>
{
homePage?.data?.SEO?.metaDescription ||
store?.Description ||
store?.data?.Description ||
"A simple and minimal Markketplace theme."
}
</strong>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/products/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const prices = product?.data?.PRICES || [];
const selectedImage =
product?.data?.Thumbnail ||
product?.data?.Slides?.[0] ||
product?.data?.SEO?.metaImage ||
product?.data?.SEO?.socialImage ||
{};
---

Expand Down

0 comments on commit 6fbc2bd

Please sign in to comment.