From 4768a49fce103902998fa62a464944c761455387 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Tue, 2 Apr 2024 10:01:06 -0500 Subject: [PATCH] css --- .build.yml | 2 +- src/components/PostList.astro | 5 +++-- src/pages/index.astro | 3 ++- src/styles/home.scss | 10 ++++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/styles/home.scss diff --git a/.build.yml b/.build.yml index e1bb958..cced875 100644 --- a/.build.yml +++ b/.build.yml @@ -5,7 +5,7 @@ packages: - npm - rsync environment: - site: mzhang.srht.site + site: mzhang.io secrets: - 0b26b413-7901-41c3-a4e2-3c752228ffcb sources: diff --git a/src/components/PostList.astro b/src/components/PostList.astro index 33ce2eb..72c0518 100644 --- a/src/components/PostList.astro +++ b/src/components/PostList.astro @@ -5,13 +5,14 @@ import { sortBy } from "lodash-es"; import TagList from "./TagList.astro"; interface Props { + className: string; basePath: string; drafts?: "exclude" | "include" | "only"; filteredPosts?: Post[]; } type Post = CollectionEntry<"posts">; -const { basePath, drafts: includeDrafts, filteredPosts } = Astro.props; +const { className, basePath, drafts: includeDrafts, filteredPosts } = Astro.props; type FilterFn = (_: Post) => boolean; @@ -40,7 +41,7 @@ else allPosts = await getCollection("posts", filter); const sortedPosts = sortBy(allPosts, (post) => -post.data.date); --- - +
{ sortedPosts.map((post) => { return ( diff --git a/src/pages/index.astro b/src/pages/index.astro index 9a01b71..9b75ea5 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -2,6 +2,7 @@ import PostList from "../components/PostList.astro"; import BaseLayout from "../layouts/BaseLayout.astro"; import { join } from "path"; +import "../styles/home.scss"; const currentUrl = Astro.url; --- @@ -9,5 +10,5 @@ const currentUrl = Astro.url;

Blog

- +
diff --git a/src/styles/home.scss b/src/styles/home.scss new file mode 100644 index 0000000..84e30c7 --- /dev/null +++ b/src/styles/home.scss @@ -0,0 +1,10 @@ +.home.postListing { + .tags { + gap: 4px; + + .tag { + background-color: inherit; + padding: 0; + } + } +}