css
This commit is contained in:
parent
4dafc1b3e8
commit
4768a49fce
4 changed files with 16 additions and 4 deletions
|
@ -5,7 +5,7 @@ packages:
|
||||||
- npm
|
- npm
|
||||||
- rsync
|
- rsync
|
||||||
environment:
|
environment:
|
||||||
site: mzhang.srht.site
|
site: mzhang.io
|
||||||
secrets:
|
secrets:
|
||||||
- 0b26b413-7901-41c3-a4e2-3c752228ffcb
|
- 0b26b413-7901-41c3-a4e2-3c752228ffcb
|
||||||
sources:
|
sources:
|
||||||
|
|
|
@ -5,13 +5,14 @@ import { sortBy } from "lodash-es";
|
||||||
import TagList from "./TagList.astro";
|
import TagList from "./TagList.astro";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
className: string;
|
||||||
basePath: string;
|
basePath: string;
|
||||||
drafts?: "exclude" | "include" | "only";
|
drafts?: "exclude" | "include" | "only";
|
||||||
filteredPosts?: Post[];
|
filteredPosts?: Post[];
|
||||||
}
|
}
|
||||||
|
|
||||||
type Post = CollectionEntry<"posts">;
|
type Post = CollectionEntry<"posts">;
|
||||||
const { basePath, drafts: includeDrafts, filteredPosts } = Astro.props;
|
const { className, basePath, drafts: includeDrafts, filteredPosts } = Astro.props;
|
||||||
|
|
||||||
type FilterFn = (_: Post) => boolean;
|
type FilterFn = (_: Post) => boolean;
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@ else allPosts = await getCollection("posts", filter);
|
||||||
const sortedPosts = sortBy(allPosts, (post) => -post.data.date);
|
const sortedPosts = sortBy(allPosts, (post) => -post.data.date);
|
||||||
---
|
---
|
||||||
|
|
||||||
<table class="postListing">
|
<table class={`postListing ${className}`}>
|
||||||
{
|
{
|
||||||
sortedPosts.map((post) => {
|
sortedPosts.map((post) => {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import PostList from "../components/PostList.astro";
|
import PostList from "../components/PostList.astro";
|
||||||
import BaseLayout from "../layouts/BaseLayout.astro";
|
import BaseLayout from "../layouts/BaseLayout.astro";
|
||||||
import { join } from "path";
|
import { join } from "path";
|
||||||
|
import "../styles/home.scss";
|
||||||
|
|
||||||
const currentUrl = Astro.url;
|
const currentUrl = Astro.url;
|
||||||
---
|
---
|
||||||
|
@ -9,5 +10,5 @@ const currentUrl = Astro.url;
|
||||||
<BaseLayout>
|
<BaseLayout>
|
||||||
<h2>Blog</h2>
|
<h2>Blog</h2>
|
||||||
|
|
||||||
<PostList basePath={join(currentUrl.pathname, "posts")} />
|
<PostList className="home" basePath={join(currentUrl.pathname, "posts")} />
|
||||||
</BaseLayout>
|
</BaseLayout>
|
||||||
|
|
10
src/styles/home.scss
Normal file
10
src/styles/home.scss
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
.home.postListing {
|
||||||
|
.tags {
|
||||||
|
gap: 4px;
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
background-color: inherit;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue