prettier config
This commit is contained in:
@@ -1,23 +1,29 @@
|
||||
---
|
||||
import { format } from 'date-fns';
|
||||
import { Markup } from 'astro-remote';
|
||||
import { format } from "date-fns";
|
||||
import { Markup } from "astro-remote";
|
||||
|
||||
import Layout from '../../layouts/Layout.astro';
|
||||
import Layout from "../../layouts/Layout.astro";
|
||||
|
||||
const { slug } = Astro.params;
|
||||
|
||||
const response = await fetch(`https://api.cosmicjs.com/v2/buckets/${import.meta.env.BUCKET_SLUG}/objects?pretty=true&query=%7B%22type%22%3A%22blog-posts%22%7D&read_key=${import.meta.env.BUCKET_READ_KEY}&limit=20&slug=${slug}`)
|
||||
const response = await fetch(
|
||||
`https://api.cosmicjs.com/v2/buckets/${
|
||||
import.meta.env.BUCKET_SLUG
|
||||
}/objects?pretty=true&query=%7B%22type%22%3A%22blog-posts%22%7D&read_key=${
|
||||
import.meta.env.BUCKET_READ_KEY
|
||||
}&limit=20&slug=${slug}`
|
||||
);
|
||||
|
||||
const posts = await response.json();
|
||||
const post = posts.objects[0];
|
||||
|
||||
---
|
||||
|
||||
<Layout title={post.title}>
|
||||
<article>
|
||||
<div style={{display: 'flex', justifyContent: 'space-between'}}>
|
||||
<h4>{post.title}</h4>
|
||||
<h5>{`🗓️ ${format(new Date(post.published_at), 'MMM do, y')}`}</h5>
|
||||
</div>
|
||||
<Markup content={post.content} />
|
||||
</article>
|
||||
</Layout>
|
||||
<article>
|
||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||
<h4>{post.title}</h4>
|
||||
<h5>{`🗓️ ${format(new Date(post.published_at), "MMM do, y")}`}</h5>
|
||||
</div>
|
||||
<Markup content={post.content} />
|
||||
</article>
|
||||
</Layout>
|
||||
|
||||
Reference in New Issue
Block a user