Fork of Chiri for Astro for my blog
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: refactor post layout for atUri

- Added `atUri` to `content.config.ts`
- Updated types for `BaseHead`
- Passed `atUri` through post layout and base head to create `<link>`
tags when present

authored by

Steve and committed by tangled.org 4ca1cc96 bcd31bfa

+9 -5
-1
package.json
··· 7 7 "dev": "astro dev", 8 8 "prebuild": "pnpm exec tsx scripts/toggle-proxy.ts", 9 9 "build": "pnpm run prebuild && astro build", 10 - "postbuild": "sequoia inject", 11 10 "preview": "astro preview", 12 11 "astro": "astro", 13 12 "lint": "eslint .",
+4 -2
src/components/layout/BaseHead.astro
··· 7 7 8 8 const canonicalURL = new URL(Astro.url.pathname, Astro.site) 9 9 10 - const { title, description, ogImage } = Astro.props as BaseHeadProps 10 + const { title, description, ogImage, atUri } = Astro.props as BaseHeadProps 11 11 const imageUrl = ogImage ? new URL(ogImage, Astro.url) : new URL('/og/chiri-og.png', Astro.url) 12 12 --- 13 13 ··· 24 24 25 25 <!-- Canonical URL --> 26 26 <link rel="canonical" href={canonicalURL} /> 27 + 28 + {atUri && <link rel="site.standard.document" href={atUri} />} 27 29 28 30 <!-- Primary Meta Tags --> 29 31 <title> ··· 55 57 gtag('js', new Date()); 56 58 57 59 gtag('config', 'G-QG1BRT6R0V'); 58 - </script> 60 + </script>
+2 -1
src/content.config.ts
··· 10 10 title: z.string(), 11 11 // Transform string to Date object 12 12 pubDate: z.coerce.date(), 13 - image: z.string().optional() 13 + image: z.string().optional(), 14 + atUri: z.string().optional() 14 15 }) 15 16 }) 16 17
+2 -1
src/layouts/PostLayout.astro
··· 19 19 20 20 import { themeConfig } from '@/config' 21 21 22 - const { title, pubDate, readingTime, toc, image} = Astro.props as PostLayoutProps 22 + const { title, pubDate, readingTime, toc, image, atUri} = Astro.props as PostLayoutProps 23 23 24 24 const postSlug = Astro.url.pathname.split('/').filter(Boolean).pop() || '' 25 25 const backupImage = `/open-graph/${postSlug}.png` ··· 31 31 description={themeConfig.site.description} 32 32 ogImage={image ? image : backupImage} 33 33 slot="head" 34 + atUri={atUri} 34 35 /> 35 36 <div class="post-container"> 36 37 <main>
+1
src/types/component.types.ts
··· 31 31 title: string 32 32 description: string 33 33 ogImage?: string 34 + atUri?: string 34 35 } 35 36 36 37 // ImageOptimizer component props interface