Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/flo-bit/shapecraft. flo-bit.dev/shapecraft
Something went wrong. Try again.
2.4 kB · 83 lines
Astro
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384---import { type CollectionEntry } from "astro:content";import DocumentationLayout from "$layouts/DocumentationLayout.astro";import ProseWrapper from "$layouts/ProseWrapper.astro";import { getTitle, getSlug, hasSidebar } from "../content-utils";import { config } from "../../config";import SecondaryButton from "$components/buttons/SecondaryButton.astro";import Footer from "$components/Footer.astro";import ExternalLink from "$components/ExternalLink.astro";
type Props = { post: CollectionEntry<"docs">; next: CollectionEntry<"docs"> | null; previous: CollectionEntry<"docs"> | null; Content: any; headings: any;};
const sidebar = await hasSidebar();
const { post, next, previous, Content, headings } = Astro.props;---
<DocumentationLayout {...post.data} title={getTitle(post) + (config.SITE_NAME ? " | " + config.SITE_NAME : "")} image={post.id + ".png"} id={post.id} headings={headings}> <div class:list={[ "max-w-2xl h-full p-4 mt-8 mb-16", sidebar ? "lg:max-w-4xl mx-auto" : "mx-auto", ]} > <ProseWrapper class="min-h-[40vh]"> <Content components={{ a: ExternalLink }} /> </ProseWrapper>
<div class="flex justify-between my-16"> <div> { previous ? ( <div class="flex flex-col gap-3 items-start"> <SecondaryButton href={config.BASE + "/" + getSlug(previous)}> <span aria-hidden="true">←</span> Previous </SecondaryButton> <a href={config.BASE + "/" + getSlug(previous)} class="text-lg dark:text-base-300 font-semibold" > {getTitle(previous)} </a> </div> ) : null } </div>
<div class="text-right"> { next ? ( <div class="flex flex-col gap-3 items-end"> <SecondaryButton href={config.BASE + "/" + getSlug(next)}> <span aria-hidden="true">→</span> Next </SecondaryButton> <a href={config.BASE + "/" + getSlug(next)} class="text-lg dark:text-base-300 font-semibold" > {getTitle(next)} </a> </div> ) : null } </div> </div>
<Footer /> </div></DocumentationLayout>