diff options
author | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-07-27 12:34:14 -0300 |
---|---|---|
committer | João Augusto Costa Branco Marado Torres <torres.dev@disroot.org> | 2025-07-27 12:34:14 -0300 |
commit | bd27bbb073465be77e4e752e6bf9bc4cf5e84c60 (patch) | |
tree | aeca59ee65177259a71f6068269451a3a4512001 /src/pages/blog/micro | |
parent | 9f3b746f72bc7895d3f659a7201969349f5e5298 (diff) |
feat: styling microblogs
Signed-off-by: João Augusto Costa Branco Marado Torres <torres.dev@disroot.org>
Diffstat (limited to 'src/pages/blog/micro')
-rw-r--r-- | src/pages/blog/micro/[page].astro | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/src/pages/blog/micro/[page].astro b/src/pages/blog/micro/[page].astro index 9fb04f1..72ccdcf 100644 --- a/src/pages/blog/micro/[page].astro +++ b/src/pages/blog/micro/[page].astro @@ -1,6 +1,7 @@ --- import MicroBlog from "@components/templates/MicroBlog.astro"; import Base from "@layouts/Base.astro"; +import PrevNext from "@layouts/PrevNext.astro"; import { fromPosts, isMicro } from "@lib/collection/helpers"; import { identity } from "@utils/anonymous"; import type { @@ -19,14 +20,39 @@ export type Params = InferGetStaticParamsType<typeof getStaticPaths>; export type Props = InferGetStaticPropsType<typeof getStaticPaths>; const { page } = Astro.props; + +const { prev, next, first, last } = page.url; --- <Base title="Micro Blogue"> - <h1>Page {page.currentPage}</h1> - <ul> - {page.data.map((micro) => <li><MicroBlog {...micro} /></li>)} - </ul> - {page.url.first ? <a href={page.url.first}>First</a> : null} - {page.url.prev ? <a href={page.url.prev}>Previous</a> : null} - {page.url.next ? <a href={page.url.next}>Next</a> : null} - {page.url.last ? <a href={page.url.last}>Last</a> : null} + <main + itemprop="mainContentOfPage" + itemscope + itemtype="https://schema.org/WebPageElement" + > + <section + id="posts" + itemprop="citation" + itemscope + itemtype="http://schema.org/Blog" + > + <h2 itemprop="name description">Página {page.currentPage}</h2> + <PrevNext previous={prev} {next} {first} {last}> + <ul>{page.data.map((micro) => <li><MicroBlog {micro} /></li>)}</ul> + </PrevNext> + </section> + </main> </Base> +<style> + ul { + max-width: 40ch; + margin-inline: auto; + margin-block: calc(var(--size-7) * 1em); + padding-inline: 0; + list-style-type: none; + & > li { + width: 100%; + margin-block: calc(var(--size-0) * 1em); + margin-inline: auto; + } + } +</style> |