set up Biome
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
---
|
||||
import { getCollection, render } from 'astro:content';
|
||||
|
||||
import Layout from '@layouts/Layout.astro';
|
||||
import BlogHeader from '@components/BlogHeader.astro';
|
||||
import Tags from '@components/Tags.astro';
|
||||
import { getCollection, render } from "astro:content";
|
||||
import BlogHeader from "@components/BlogHeader.astro";
|
||||
import Tags from "@components/Tags.astro";
|
||||
import Layout from "@layouts/Layout.astro";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog');
|
||||
const posts = await getCollection("blog");
|
||||
return posts.map((post) => ({
|
||||
params: { slug: post.id },
|
||||
props: { post },
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
import { getCollection, type CollectionEntry } from 'astro:content';
|
||||
import type { Page } from 'astro';
|
||||
|
||||
import { type CollectionEntry, getCollection } from 'astro:content';
|
||||
import PostPreview from '@components/PostPreview.astro';
|
||||
|
||||
import Layout from '@layouts/Layout.astro';
|
||||
import PostPreview from '@components/PostPreview.astro';
|
||||
import type { Page } from 'astro';
|
||||
|
||||
export async function getStaticPaths({ paginate }) {
|
||||
const allPosts = await getCollection('blog');
|
||||
@@ -52,8 +53,8 @@ const { page } = Astro.props;
|
||||
.pagination {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 2rem;
|
||||
margin: auto;
|
||||
margin-top: 2rem;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
---
|
||||
import { format, add } from 'date-fns';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
import { getCollection } from 'astro:content';
|
||||
import Layout from '@layouts/Layout.astro';
|
||||
import { add, format } from 'date-fns';
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const posts = await getCollection('blog');
|
||||
|
||||
const tags = ['all'];
|
||||
|
||||
posts.forEach((post) =>
|
||||
posts.forEach((post) => {
|
||||
post.data.tags.forEach((tag) => {
|
||||
if (!tags.includes(tag)) {
|
||||
tags.push(tag);
|
||||
}
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
return tags.map((tag) => ({
|
||||
params: { tag },
|
||||
|
||||
Reference in New Issue
Block a user