Compare commits
No commits in common. "6334dadf928cb4d03690cedc18cc683fc8457d15" and "0109c51f83120f55eb2ea08dbb951b1bd73e964c" have entirely different histories.
6334dadf92
...
0109c51f83
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 82 KiB |
|
Before Width: | Height: | Size: 192 KiB After Width: | Height: | Size: 116 KiB |
|
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 172 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 150 KiB |
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 155 KiB After Width: | Height: | Size: 93 KiB |
|
|
@ -21,14 +21,6 @@ interface Props {
|
|||
|
||||
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
||||
|
||||
// For blog posts with date-slug format, show pretty URL in og:url/canonical
|
||||
// This handles both direct /slug access and proxy /blog/slug access
|
||||
const pathParts = Astro.url.pathname.split('/').filter(Boolean);
|
||||
const blogPostMatch = pathParts[0] === 'blog' ? pathParts[1] : pathParts[0];
|
||||
const isBlogPost = blogPostMatch?.match(/^\d{4}-\d{2}-\d{2}-/);
|
||||
const finalCanonicalPath = isBlogPost ? `/${blogPostMatch}/` : Astro.url.pathname;
|
||||
const finalCanonicalURL = new URL(finalCanonicalPath, Astro.site);
|
||||
|
||||
const { title, description, image = "/astro-micro.jpg" } = Astro.props;
|
||||
---
|
||||
|
||||
|
|
@ -43,7 +35,7 @@ const { title, description, image = "/astro-micro.jpg" } = Astro.props;
|
|||
<meta name="generator" content={Astro.generator} />
|
||||
|
||||
<!-- Canonical URL -->
|
||||
<link rel="canonical" href={finalCanonicalURL} />
|
||||
<link rel="canonical" href={canonicalURL} />
|
||||
|
||||
<!-- Primary Meta Tags -->
|
||||
<title>{title}</title>
|
||||
|
|
@ -52,17 +44,17 @@ const { title, description, image = "/astro-micro.jpg" } = Astro.props;
|
|||
|
||||
<!-- Open Graph / Facebook -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content={finalCanonicalURL} />
|
||||
<meta property="og:url" content={Astro.url} />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={description} />
|
||||
<meta property="og:image" content={new URL(image + '?v=2', Astro.url)} />
|
||||
<meta property="og:image" content={new URL(image, Astro.url)} />
|
||||
|
||||
<!-- Twitter -->
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content={finalCanonicalURL} />
|
||||
<meta property="twitter:url" content={Astro.url} />
|
||||
<meta property="twitter:title" content={title} />
|
||||
<meta property="twitter:description" content={description} />
|
||||
<meta property="twitter:image" content={new URL(image + '?v=2', Astro.url)} />
|
||||
<meta property="twitter:image" content={new URL(image, Astro.url)} />
|
||||
|
||||
<!-- PageFind -->
|
||||
<link href="/pagefind/pagefind-ui.css" rel="stylesheet" />
|
||||
|
|
|
|||