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 86 lines 2.6 kB view raw
1--- 2import '@/styles/global.css' 3import type { PostLayoutProps } from '@/types' 4import FormattedDate from '@/components/widgets/FormattedDate.astro' 5import FootnoteScroll from '@/components/widgets/FootnoteScroll.astro' 6import BaseHead from '@/components/layout/BaseHead.astro' 7import Footer from '@/components/layout/Footer.astro' 8import BackButton from '@/components/ui/BackButton.astro' 9import TableOfContents from '@/components/ui/TableOfContents.astro' 10import GradientMask from '@/components/ui/GradientMask.astro' 11import ImageOptimizer from '@/components/ui/ImageOptimizer.astro' 12import ImageViewer from '@/components/ui/ImageViewer.astro' 13import GitHubCard from '@/components/ui/GitHubCard.astro' 14import LinkCard from '@/components/ui/LinkCard.astro' 15import NeoDBCard from '@/components/ui/NeoDBCard.astro' 16import XPOST from '@/components/ui/XPOST.astro' 17import CopyCode from '@/components/ui/CopyCode.astro' 18import BaseLayout from '@/layouts/BaseLayout.astro' 19 20import { themeConfig } from '@/config' 21 22const { title, pubDate, readingTime, toc } = Astro.props as PostLayoutProps 23 24const postSlug = Astro.url.pathname.split('/').filter(Boolean).pop() || '' 25const ogImage = `/open-graph/${postSlug}.png` 26--- 27 28<BaseLayout 29 title={`${title} · ${themeConfig.site.title}`} 30 description={themeConfig.site.description} 31 type="post" 32> 33 <BaseHead 34 title={`${title} · ${themeConfig.site.title}`} 35 description={themeConfig.site.description} 36 ogImage={ogImage} 37 slot="head" 38 /> 39 <div class="post-container"> 40 <main> 41 <div class="prose"> 42 <GradientMask /> 43 <BackButton /> 44 {themeConfig.post.toc && <TableOfContents toc={toc} />} 45 <div class="title"> 46 <h1>{title}</h1> 47 <div class="date"> 48 <FormattedDate date={pubDate} context="post" /> 49 { 50 themeConfig.post.readingTime && readingTime && ( 51 <span class="reading-time"> 52 <span class="separator">·</span> 53 {readingTime.text} 54 </span> 55 ) 56 } 57 </div> 58 </div> 59 <article class="content"> 60 <slot /> 61 </article> 62 </div> 63 </main> 64 <ImageOptimizer /> 65 <FootnoteScroll /> 66 <CopyCode /> 67 <GitHubCard /> 68 <XPOST /> 69 <NeoDBCard /> 70 {themeConfig.post.imageViewer && <ImageViewer />} 71 {themeConfig.post.linkCard && <LinkCard />} 72 {themeConfig.general.footer && <Footer />} 73 </div> 74</BaseLayout> 75 76<style> 77 .post-container { 78 display: flex; 79 flex-direction: column; 80 flex: 1; 81 } 82 83 .post-container main { 84 flex: 1; 85 } 86</style>