mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-12 07:12:52 +01:00
feat: allow collapsing widget content, add categories widget
(cherry picked from commit 9a4ca8f6163d5e1375aa7c612e1338cce5a8c0b5)
This commit is contained in:
@@ -1,24 +1,17 @@
|
||||
---
|
||||
import { getCollection, getEntry } from "astro:content";
|
||||
import MainGridLayout from "../../layouts/MainGridLayout.astro";
|
||||
import TitleCard from "../../components/TitleCardNew.astro";
|
||||
import Pagination from "../../components/control/Pagination.astro";
|
||||
import {getPostUrlBySlug, getSortedPosts} from "../../utils/content-utils";
|
||||
import {getConfig} from "../../utils/config-utils";
|
||||
import {getSortedPosts} from "../../utils/content-utils";
|
||||
import {getPostUrlBySlug} from "../../utils/url-utils";
|
||||
|
||||
export async function getStaticPaths({ paginate }) {
|
||||
// const allBlogPosts = await getCollection("posts");
|
||||
const allBlogPosts = await getSortedPosts();
|
||||
return paginate(allBlogPosts, { pageSize: 6 });
|
||||
}
|
||||
|
||||
const {page} = Astro.props;
|
||||
|
||||
// page.data.map(entry => console.log(entry));
|
||||
// console.log(page)
|
||||
|
||||
// console.log(getConfig());
|
||||
|
||||
---
|
||||
|
||||
<!-- 显示当前页面。也可以使用 Astro.params.page -->
|
||||
|
||||
@@ -4,11 +4,11 @@ import MainGridLayout from "../../layouts/MainGridLayout.astro";
|
||||
import ImageBox from "../../components/misc/ImageBox.astro";
|
||||
import {Icon} from "astro-icon/components";
|
||||
import PostMetadata from "../../components/PostMetadata.astro";
|
||||
import {getPostUrlBySlug} from "../../utils/content-utils";
|
||||
import Button from "../../components/control/Button.astro";
|
||||
import {getConfig} from "../../utils/config-utils";
|
||||
import {i18n} from "../../i18n/translation";
|
||||
import I18nKey from "../../i18n/i18nKey";
|
||||
import {getPostUrlBySlug} from "../../utils/url-utils";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const blogEntries = await getCollection('posts');
|
||||
|
||||
Reference in New Issue
Block a user