BaseHead.astro 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. // Import the global.css file here so that it is included on
  3. // all pages through the use of the <BaseHead /> component.
  4. import '../styles/global.css';
  5. interface Props {
  6. title: string;
  7. description: string;
  8. image?: string;
  9. }
  10. const canonicalURL = new URL(Astro.url.pathname, Astro.site);
  11. const { title, description, image = '/blog-placeholder-1.jpg' } = Astro.props;
  12. ---
  13. <!-- Global Metadata -->
  14. <meta charset="utf-8" />
  15. <meta name="viewport" content="width=device-width,initial-scale=1" />
  16. <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
  17. <meta name="generator" content={Astro.generator} />
  18. <!-- Font preloads -->
  19. <link rel="preload" href="/fonts/atkinson-regular.woff" as="font" type="font/woff" crossorigin />
  20. <link rel="preload" href="/fonts/atkinson-bold.woff" as="font" type="font/woff" crossorigin />
  21. <!-- Canonical URL -->
  22. <link rel="canonical" href={canonicalURL} />
  23. <!-- Primary Meta Tags -->
  24. <title>{title}</title>
  25. <meta name="title" content={title} />
  26. <meta name="description" content={description} />
  27. <!-- Open Graph / Facebook -->
  28. <meta property="og:type" content="website" />
  29. <meta property="og:url" content={Astro.url} />
  30. <meta property="og:title" content={title} />
  31. <meta property="og:description" content={description} />
  32. <meta property="og:image" content={new URL(image, Astro.url)} />
  33. <!-- Twitter -->
  34. <meta property="twitter:card" content="summary_large_image" />
  35. <meta property="twitter:url" content={Astro.url} />
  36. <meta property="twitter:title" content={title} />
  37. <meta property="twitter:description" content={description} />
  38. <meta property="twitter:image" content={new URL(image, Astro.url)} />