Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/trueberryless/the-thinking-hub. The central knowledge hub for 8 key Computer Science thinking modes. the-thinking-hub.felixs.dev
Something went wrong. Try again.
2.5 kB · 82 lines
Astro
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283---import '@/styles/global.css'import type { PostLayoutProps } from '@/types'import FormattedDate from '@/components/widgets/FormattedDate.astro'import FootnoteScroll from '@/components/widgets/FootnoteScroll.astro'import BaseHead from '@/components/layout/BaseHead.astro'import Footer from '@/components/layout/Footer.astro'import BackButton from '@/components/ui/BackButton.astro'import TableOfContents from '@/components/ui/TableOfContents.astro'import GradientMask from '@/components/ui/GradientMask.astro'import ImageOptimizer from '@/components/ui/ImageOptimizer.astro'import ImageViewer from '@/components/ui/ImageViewer.astro'import GitHubCard from '@/components/ui/GitHubCard.astro'import LinkCard from '@/components/ui/LinkCard.astro'import NeoDBCard from '@/components/ui/NeoDBCard.astro'import XPOST from '@/components/ui/XPOST.astro'import CopyCode from '@/components/ui/CopyCode.astro'import BaseLayout from '@/layouts/BaseLayout.astro'
import { themeConfig } from '@/config'
const { title, pubDate, readingTime, toc } = Astro.props as PostLayoutProps
const postSlug = Astro.url.pathname.split('/').filter(Boolean).pop() || ''const ogImage = `/open-graph/${postSlug}.png`---
<BaseLayout title={`${title} · ${themeConfig.site.title}`} description={themeConfig.site.description} type="post"> <BaseHead title={`${title} · ${themeConfig.site.title}`} description={themeConfig.site.description} ogImage={ogImage} slot="head" /> <div class="post-container"> <main> <div class="prose"> <GradientMask /> <BackButton /> {themeConfig.post.toc && <TableOfContents toc={toc} />} <div class="title"> <h1>{title}</h1> <div class="date"> <FormattedDate date={pubDate} context="post" /> {themeConfig.post.readingTime && readingTime && ( <span class="reading-time"> <span class="separator">·</span> {readingTime.text} </span> )} </div> </div> <slot /> </div> </main> <ImageOptimizer /> <FootnoteScroll /> <CopyCode /> <GitHubCard /> <XPOST /> <NeoDBCard /> {themeConfig.post.imageViewer && <ImageViewer />} {themeConfig.post.linkCard && <LinkCard />} {themeConfig.general.footer && <Footer />} </div></BaseLayout>
<style> .post-container { display: flex; flex-direction: column; flex: 1; }
.post-container main { flex: 1; }</style>