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 a2f7dec4d7c309420bc9d4e87b4de27dcd8a4142 25 lines 576 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 8 ? aboutEntry.body.replace(/<!--[\s\S]*?-->/g, '').trim().length > 0 9 : false 10const { Content } = hasContent && aboutEntry ? await render(aboutEntry) : { Content: null } 11--- 12 13{ 14 hasContent && Content && ( 15 <div class="about prose"> 16 <Content /> 17 </div> 18 ) 19} 20 21<style> 22 .about:not(:empty) { 23 margin-bottom: 1.25rem; 24 } 25</style>