---
interface Props {
  title: string;
  description: string;
  url?: string;
  image?: SiteImage;
}

const { title, description, url = Astro.url, image } = Astro.props;

import person from "@data/person";
import site from "@data/site";

import { Schema } from "astro-seo-schema";
---

<!-- SEO -->
<link rel="canonical" href={url} />
<meta name="robots" content="all" />
<Schema
  item={{
    "@context": "https://schema.org",
    "@type": "Person",
    name: "Nathan Cummins",
    alternateName: "Nathan Leon Cummins",
    alumniOf: {
      "@type": "CollegeOrUniversity",
      name: [
        "University of Adelaide",
        "Adelaide University",
        "Elder Conservatorium",
        "Elder Conservatorium of Music"
      ]
    },
    knowsAbout: [
      "Music",
      "Music Composition",
      "Composition",
      "Music Theory",
      "Orchestration",
      "Music Orchestration",
      "Conducting",
      "Cubase",
      "Dorico",
      "Sheet Music",
      "Engraving",
      "Unity",
      "Unity3D",
      "Software Development",
      "Web Design",
      "C#",
      "Video Games",
      "Video Game Development",
      "Development",
      "Game Development"
    ],
    email: person.email,
    jobTitle: person.jobTitle,
    description: site.description,
    image: site.image.externalURL
  }}
/>

<!-- Open Graph -->
<meta property="og:site_name" content={site.title} />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:url" content={url} />
<meta
  property="og:image"
  content={image !== undefined && image.externalURL !== undefined
    ? image.externalURL
    : site.image.externalURL}
/>
<meta
  property="og:image:url"
  content={image !== undefined && image.externalURL !== undefined
    ? image.externalURL
    : site.image.externalURL}
/>
<meta
  property="og:image:secure_url"
  content={image !== undefined && image.externalURL !== undefined
    ? image.externalURL
    : site.image.externalURL}
/>
<meta property="og:image:alt" content={image?.alt || site.image.alt} />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content={image?.width.toString() || "1920"} />
<meta property="og:image:height" content={image?.height.toString() || "1080"} />

<!-- Twitter -->
<meta name="twitter:site" content="@nathancummins.au" />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:card" content="summary_large_image" />
<meta
  name="twitter:image:src"
  content={image !== undefined && image.externalURL !== undefined
    ? image.externalURL
    : site.image.externalURL}
/>
<meta name="twitter:image:alt" content={title} />
<meta name="twitter:domain" content={import.meta.env.SITE} />

<!-- Theming -->
<meta name="theme-color" content="#ff2d00" />
