at main 1.7 kB view raw
1--- 2import Layout from "./Layout.astro"; 3 4interface Props { 5 slug: string; 6 title: string; 7 author: string; 8 // tags: Tag[]; 9 tags: any; 10 createdAt: Date; 11 updatedAt?: Date | null; 12 comments?: boolean; 13 previous?: boolean; 14 next?: boolean; 15} 16 17const { slug, title, author, tags, createdAt, updatedAt, comments, previous, next } = Astro.props; 18--- 19<Layout title={title} skipLink="work-body"> 20 <nav id="work-menu"> 21 {previous && ( 22 // chapterid - 1? 23 <a href="">previous chaptertitle</a> 24 )} 25 <!-- if theres more than one chapter, render this box --> 26 <select name="chapterSelect" id={`${slug}-chapters`} class="select"> 27 <option value="default" selected>Choose chapter...</option> 28 <!-- map each chapter here --> 29 </select> 30 31 {next && ( 32 // chapterid + 1 ? 33 <a href="">next chaptertitle</a> 34 )} 35 </nav> 36 37 <main id="work-body"> 38 <header> 39 <h1>{title}</h1> 40 <h2>{author}</h2> 41 <!-- replace this at some point --> 42 {JSON.stringify(tags)} 43 <time datetime={createdAt.toISOString()}>{createdAt}</time> 44 {updatedAt && ( 45 <time datetime={updatedAt.toISOString()}>{updatedAt}</time> 46 )} 47 48 <div id="summary"> 49 summary 50 </div> 51 </header> 52 53 <section id={`${slug}-content`}> 54 <!-- if work has its own style, render it here somehow --> 55 <details> 56 <summary>Author's notes</summary> 57 this should include author's notes 58 </details> 59 60 <slot /> 61 </section> 62 63 {comments && ( 64 <aside id={`${slug}-comments`}> 65 <!-- use bsky api to render comments here --> 66 <!-- paginate this --> 67 </aside> 68 )} 69 </main> 70</Layout>