From cc9a580fe6a1f188de9ca89778cf113984c4327b Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Thu, 11 Dec 2025 14:22:12 +0000 Subject: style changes --- website/src/components/BlogFeed.astro | 44 ++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'website/src/components/BlogFeed.astro') diff --git a/website/src/components/BlogFeed.astro b/website/src/components/BlogFeed.astro index 5d5f727..ce011ba 100644 --- a/website/src/components/BlogFeed.astro +++ b/website/src/components/BlogFeed.astro @@ -6,10 +6,11 @@ import FormattedDate from './FormattedDate.astro'; export interface Props { headingLevel?: 1 | 2 | 3 | 4 | 5 | 6, hideAuthor?: boolean, + hideSubheadings?: boolean, maxEntries?: number, }; -const { headingLevel = 2, hideAuthor = false, maxEntries } = Astro.props; +const { headingLevel = 2, hideSubheadings = false, hideAuthor = false, maxEntries } = Astro.props; const allPosts = (await getCollection('blog')).filter((post) => !post.data.hidden); @@ -32,41 +33,46 @@ function sortByPubDateDescending(post1: CollectionEntry<'blog'>, post2: Collecti return date2 - date1; } -const headingElem = `h${headingLevel}`; -const subHeadingElem = `h${headingLevel + 1}` +const HeadingElem = `h${headingLevel} class="p-name"`; +const SubHeadingElem = `h${headingLevel + 1}`; +const AuthorElem = `p${hideAuthor ? " hidden" : ""}`; const canonicalBlogUrl = new URL('blog', Astro.site) ---
- - My blog - - `} /> + + My blog + - { distinctYears.map(year => ( - - ${year} - - `} /> + { hideSubheadings + ?
    + { posts.sort(sortByPubDateDescending).map(post => ( +
  • + {post.data.title} +

    + +

  • + )) } +
+ : distinctYears.map(year => ( + {year} -- cgit v1.2.3