chore: fix lint issues
This commit is contained in:
parent
bd1d16bf46
commit
a49a75171f
1 changed files with 0 additions and 20 deletions
|
|
@ -3,19 +3,11 @@ import { getImage } from "astro:assets";
|
|||
import { OG, SEO, SITE } from "@data/constants";
|
||||
import faviconSrc from "@images/favicon.png";
|
||||
|
||||
// Default properties for the Meta component. These values are used if props are not provided.
|
||||
// 'meta' sets a default description meta tag to describe the page content.
|
||||
// 'structuredData' defines default structured data in JSON-LD format to enhance search engine understanding of the page (for SEO purposes).
|
||||
const defaultProps = {
|
||||
meta: SITE.description,
|
||||
structuredData: SEO.structuredData,
|
||||
};
|
||||
|
||||
const sd = SEO.structuredData;
|
||||
|
||||
// Extract props with default values assigned from defaultProps. Values can be overridden when the component is used.
|
||||
// For example:
|
||||
// <MainLayout title="Custom Title" meta="Custom description." />
|
||||
const {
|
||||
meta = defaultProps.meta,
|
||||
structuredData = defaultProps.structuredData,
|
||||
|
|
@ -25,7 +17,6 @@ const {
|
|||
const URL = `${Astro.site}`; // Set the website URL in astro.config.mjs
|
||||
const author = SITE.author;
|
||||
const canonical = Astro.url.href;
|
||||
const basePath = Astro.url.pathname;
|
||||
const ogTitle = structuredData.name || OG.title;
|
||||
const ogDescription = structuredData.description || OG.description;
|
||||
const socialImageRes = await getImage({
|
||||
|
|
@ -37,17 +28,6 @@ const socialImage = structuredData?.image?.src
|
|||
? (Astro.url.origin + structuredData.image.src)
|
||||
: Astro.url.origin + socialImageRes.src; // Get the full URL of the image (https://stackoverflow.com/a/9858694)
|
||||
|
||||
function createHref(lang: string, prefix: string, path: string): string {
|
||||
const hasPrefix = path.startsWith(`/${prefix}/`);
|
||||
|
||||
const basePath = hasPrefix ? path : `/${prefix}${path}`;
|
||||
const normalizedBasePath = basePath.replace(/\/\/+/g, "/");
|
||||
return `${URL.slice(0, -1)}${normalizedBasePath}`;
|
||||
}
|
||||
|
||||
const fullPath: string = Astro.url.pathname;
|
||||
|
||||
|
||||
const appleTouchIcon = await getImage({
|
||||
src: faviconSrc,
|
||||
width: 180,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue