Skip to content

Commit

Permalink
build: Add Head component and meta tags for social sharing.
Browse files Browse the repository at this point in the history
  • Loading branch information
CarLeonDev committed Jul 23, 2024
1 parent e88c622 commit f5be7ca
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 137 deletions.
1 change: 1 addition & 0 deletions website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default defineConfig({
themes: [myTheme],
},
components: {
Head: "./src/components/Head.astro",
SocialIcons: "./src/components/SocialIcons.astro",
Search: "./src/components/Search.astro",
SiteTitle: "./src/components/SiteTitle.astro",
Expand Down
9 changes: 8 additions & 1 deletion website/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
152 changes: 16 additions & 136 deletions website/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/public/opengraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions website/src/components/Head.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
import type { Props } from "@astrojs/starlight/props";
import Default from "@astrojs/starlight/components/Head.astro";
const canonical = Astro.site
? new URL(Astro.url.pathname, Astro.site)
: undefined;
---

<!-- Render the default <Head/> component. -->
<Default {...Astro.props}><slot /></Default>

<meta property="og:image" content={`${canonical?.href}opengraph.png`} />
<meta property="twitter:image" content={`${canonical?.href}opengraph.png`} />

0 comments on commit f5be7ca

Please sign in to comment.