mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-12-01 21:37:23 +01:00
fix og:images on blog
This commit is contained in:
@@ -50,6 +50,7 @@ export default defineConfig({
|
|||||||
components: {
|
components: {
|
||||||
SiteTitle: './src/components/MyHeader.astro',
|
SiteTitle: './src/components/MyHeader.astro',
|
||||||
ThemeSelect: './src/components/MyThemeSelect.astro',
|
ThemeSelect: './src/components/MyThemeSelect.astro',
|
||||||
|
Head: './src/components/HeadWithOGImage.astro',
|
||||||
},
|
},
|
||||||
social: {
|
social: {
|
||||||
github: 'https://github.com/wasp-lang/open-saas',
|
github: 'https://github.com/wasp-lang/open-saas',
|
||||||
|
|||||||
BIN
opensaas-sh/blog/public/og-images/2023-11-21-coverlettergpt.webp
Normal file
BIN
opensaas-sh/blog/public/og-images/2023-11-21-coverlettergpt.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 46 KiB |
19
opensaas-sh/blog/src/components/HeadWithOGImage.astro
Normal file
19
opensaas-sh/blog/src/components/HeadWithOGImage.astro
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
import type { Props } from '@astrojs/starlight/props'
|
||||||
|
import Default from '@astrojs/starlight/components/Head.astro'
|
||||||
|
|
||||||
|
// Get the URL of the generated image for the current page using its
|
||||||
|
// ID and replace the file extension with `.png`.
|
||||||
|
const ogImageUrl = new URL(
|
||||||
|
`/og-images/${Astro.props.id.replace(/blog\//, '').replace(/\.\w+$/, '.webp')}`,
|
||||||
|
'https://docs.opensaas.sh',
|
||||||
|
)
|
||||||
|
console.log(Astro.props)
|
||||||
|
---
|
||||||
|
|
||||||
|
<!-- Render the default <Head/> component. -->
|
||||||
|
<Default {...Astro.props}><slot /></Default>
|
||||||
|
|
||||||
|
<!-- Render the <meta/> tags for the Open Graph images. -->
|
||||||
|
<meta property="og:image" content={ogImageUrl} />
|
||||||
|
<meta name="twitter:image" content={ogImageUrl} />
|
||||||
@@ -2,7 +2,9 @@
|
|||||||
title: 🍪 THE MOST ANNOYING COOKIE BANNER EVER HACKATHON 🤬
|
title: 🍪 THE MOST ANNOYING COOKIE BANNER EVER HACKATHON 🤬
|
||||||
date: 2024-10-10
|
date: 2024-10-10
|
||||||
tags: ["cookie consent", "saas", "sideproject", "hackathon"]
|
tags: ["cookie consent", "saas", "sideproject", "hackathon"]
|
||||||
image: "/cookie-consent/annoying-cookie-banners.jpg"
|
cover:
|
||||||
|
alt: Annoying Cookie Banner Contest
|
||||||
|
image: "/cookie-consent/annoying-cookie-banners.jpg"
|
||||||
---
|
---
|
||||||
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
|
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
|
||||||
<iframe
|
<iframe
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
title: We Made the Most Annoying Cookie Banners Ever
|
title: We Made the Most Annoying Cookie Banners Ever
|
||||||
date: 2024-11-26
|
date: 2024-11-26
|
||||||
tags: ["cookie consent", "saas", "sideproject", "hackathon"]
|
tags: ["cookie consent", "saas", "sideproject", "hackathon"]
|
||||||
image: "/cookie-consent/annoying-cookie-banners.jpg"
|
cover:
|
||||||
|
alt: the Most Annoying Cookie Banners
|
||||||
|
image: "/cookie-consent/annoying-cookie-banners.jpg"
|
||||||
---
|
---
|
||||||
import VideoPlayer from '../../../components/VideoPlayer.astro';
|
import VideoPlayer from '../../../components/VideoPlayer.astro';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user