Improve SEO metadata, Open Graph, and JSON-LD for better Bing/social indexing
This commit is contained in:
1 parent
6dd8fb8703
commit
951b6ee3a6
1 file changed
+16
-1
@@ -19,6 +19,11 @@ const {
|
||||
const canonicalURL = Astro.props.canonicalURL || new URL(Astro.url.pathname, Astro.site || Astro.url.origin || 'https://crischarles.com').href;
|
||||
const socialImageURL = new URL(image, Astro.site || Astro.url.origin || 'https://crischarles.com').href;
|
||||
|
||||
const socialProfiles = [
|
||||
'https://github.com/ssbg04',
|
||||
'https://crischarles.com',
|
||||
];
|
||||
|
||||
// JSON-LD Structured Data Schema (Person & WebSite)
|
||||
const schemaData = {
|
||||
"@context": "https://schema.org",
|
||||
@@ -32,7 +37,12 @@ const schemaData = {
|
||||
"publisher": {
|
||||
"@id": "https://crischarles.com/#person"
|
||||
},
|
||||
"inLanguage": "en-US"
|
||||
"inLanguage": "en-US",
|
||||
"potentialAction": {
|
||||
"@type": "SearchAction",
|
||||
"target": "https://crischarles.com/?q={search_term_string}",
|
||||
"query-input": "required name=search_term_string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "Person",
|
||||
@@ -42,6 +52,7 @@ const schemaData = {
|
||||
"image": socialImageURL,
|
||||
"jobTitle": "Full-Stack Developer & Software Engineer",
|
||||
"description": description,
|
||||
"sameAs": socialProfiles,
|
||||
"knowsAbout": [
|
||||
"Web Development",
|
||||
"React",
|
||||
@@ -84,6 +95,9 @@ const schemaData = {
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:image" content={socialImageURL} />
|
||||
<meta property="og:image:alt" content="Cris Charles Garcia portfolio preview" />
|
||||
<meta property="og:image:width" content="1200" />
|
||||
<meta property="og:image:height" content="630" />
|
||||
<meta property="og:site_name" content="Cris Charles Garcia" />
|
||||
<meta property="og:locale" content="en_US" />
|
||||
{publishedTime && <meta property="article:published_time" content={publishedTime} />}
|
||||
@@ -94,6 +108,7 @@ const schemaData = {
|
||||
<meta property="twitter:title" content={title} />
|
||||
<meta property="twitter:description" content={description} />
|
||||
<meta property="twitter:image" content={socialImageURL} />
|
||||
<meta property="twitter:image:alt" content="Cris Charles Garcia portfolio preview" />
|
||||
<meta name="twitter:creator" content="@CrisCharles" />
|
||||
|
||||
<!-- Structured Data (JSON-LD) -->
|
||||
|
||||
Reference in new issue
Block a user