Fork of Chiri for Astro for my blog
0
fork

Configure Feed

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

at c1ddc22aeb5d413d714699c1f7d8cd84a225615e 23 lines 572 B view raw
1--- 2import { getEntry } from 'astro:content' 3import { render } from 'astro:content' 4 5const aboutEntry = await getEntry('about', 'about') 6// Check if there is actual content (excluding comments) 7const hasContent = aboutEntry?.body ? aboutEntry.body.replace(/<!--[\s\S]*?-->/g, '').trim().length > 0 : false 8const { Content } = hasContent && aboutEntry ? await render(aboutEntry) : { Content: null } 9--- 10 11{ 12 hasContent && Content && ( 13 <div class="about prose"> 14 <Content /> 15 </div> 16 ) 17} 18 19<style> 20 .about:not(:empty) { 21 margin-bottom: 1.25rem; 22 } 23</style>