---
import config from 'virtual:starlight-ghostcms/config'
import Metadata from '../components/Metadata.astro'
import Page from '../components/Page.astro'
//import PrevNextLinks from '../components/PrevNextLinks.astro'
import { getPageProps } from '../utils/page'
import { getSluggedPage } from '../utils/api'
import { Markup } from 'astro-remote'
import * as render from '../components/astro-remote';

const aboutPage = await getSluggedPage("about");

//const { entries, nextLink, prevLink } = Astro.props

const pageProps = getPageProps(aboutPage ? aboutPage.post.title : "")
---

<Page {...pageProps}>
  {config.supportGhost && (
    <div id="pghost">Powered by <a href="https://ghost.org">Ghost</a></div>
  )}
  {aboutPage && 
      <Metadata entry={aboutPage.post} />
      <Markup 
        content={aboutPage.post.html} 
        sanitize={{ 
          allowComponents: true, 
        }}
        components={{
          pre: render.CodeSlot
        }} />
  }
  <footer class="not-content">
    <!--PrevNextLinks next={nextLink} prev={prevLink} /-->
  </footer>
</Page>

<style>
  #pghost {
    color: gray;
    position: absolute;
    top: 4rem;
  }
  #pghost a {
    color: gray;
  }
</style>