Move social image to /src/images to allow Astro auto optimization
This commit is contained in:
parent
827086c49d
commit
3431077897
3 changed files with 6 additions and 1 deletions
|
|
@ -20,7 +20,9 @@ const URL = `${Astro.site}`; // Set the website URL in astro.config.mjs
|
|||
const author = SITE.author;
|
||||
const ogTitle = OG.title;
|
||||
const ogDescription = OG.description;
|
||||
const socialImage: string = `${Astro.site}/social.png`; // Set the path for the social media image
|
||||
const socialImageRes = await getImage({ src: OG.image, width: 1200, height: 600 });
|
||||
const socialImage = Astro.url.origin + socialImageRes.src; // Get the full URL of the image (https://stackoverflow.com/a/9858694)
|
||||
|
||||
---
|
||||
|
||||
<!-- Inject structured data into the page if provided. This data is formatted as JSON-LD, a method recommended by Google for structured data pass:
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import ogImageSrc from "@/images/social.png";
|
||||
|
||||
export const SITE = {
|
||||
title: "ScrewFast",
|
||||
tagline: "Top-quality Hardware Tools",
|
||||
|
|
@ -33,4 +35,5 @@ export const OG = {
|
|||
url: SITE.url,
|
||||
title: `${SITE.title}: : Hardware Tools & Construction Services`,
|
||||
description: "Equip your projects with ScrewFast's top-quality hardware tools and expert construction services. Trusted by industry leaders, ScrewFast offers simplicity, affordability, and reliability. Experience the difference with user-centric design and cutting-edge tools. Start exploring now!",
|
||||
image: ogImageSrc,
|
||||
};
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Loading…
Add table
Reference in a new issue