prettier config
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["./node_modules/prettier-plugin-astro"]
|
||||
}
|
||||
Generated
+11
-7
@@ -12,7 +12,11 @@
|
||||
"@picocss/pico": "^1.5.6",
|
||||
"astro": "^1.6.13",
|
||||
"astro-remote": "^0.2.3",
|
||||
"date-fns": "^2.29.3"
|
||||
"date-fns": "^2.29.3",
|
||||
"prettier": "^2.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier-plugin-astro": "^0.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@ampproject/remapping": {
|
||||
@@ -4258,9 +4262,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz",
|
||||
"integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==",
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz",
|
||||
"integrity": "sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg==",
|
||||
"bin": {
|
||||
"prettier": "bin-prettier.js"
|
||||
},
|
||||
@@ -8504,9 +8508,9 @@
|
||||
}
|
||||
},
|
||||
"prettier": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz",
|
||||
"integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA=="
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.1.tgz",
|
||||
"integrity": "sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg=="
|
||||
},
|
||||
"prettier-plugin-astro": {
|
||||
"version": "0.7.0",
|
||||
|
||||
@@ -16,5 +16,9 @@
|
||||
"astro": "^1.6.13",
|
||||
"astro-remote": "^0.2.3",
|
||||
"date-fns": "^2.29.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "^2.8.1",
|
||||
"prettier-plugin-astro": "^0.7.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
<footer>
|
||||
@@ -7,6 +6,8 @@
|
||||
Copyright 2022 - <a href="https://ghall.dev">Graham Hall</a>
|
||||
</p>
|
||||
<p>
|
||||
Built with <a href="https://astro.build">Astro</a> and <a href="https://picocss.com">Pico.css</a>
|
||||
Built with <a href="https://astro.build">Astro</a> and <a
|
||||
href="https://picocss.com">Pico.css</a
|
||||
>
|
||||
</p>
|
||||
</footer>
|
||||
@@ -1,12 +1,11 @@
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
<div>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<span style={{ fontSize: '1.6rem' }}>Graham Hall</span>
|
||||
<span style={{ fontSize: "1.6rem" }}>Graham Hall</span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
---
|
||||
import '@picocss/pico'
|
||||
import "@picocss/pico";
|
||||
|
||||
import Header from '../components/Header.astro'
|
||||
import Footer from '../components/Footer.astro'
|
||||
import Header from "../components/Header.astro";
|
||||
import Footer from "../components/Footer.astro";
|
||||
|
||||
export interface Props {
|
||||
title: string;
|
||||
}
|
||||
|
||||
const title = Astro.props.frontmatter ? Astro.props.frontmatter.title : Astro.props.title;
|
||||
|
||||
const title = Astro.props.frontmatter
|
||||
? Astro.props.frontmatter.title
|
||||
: Astro.props.title;
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
@@ -27,4 +28,3 @@ const title = Astro.props.frontmatter ? Astro.props.frontmatter.title : Astro.pr
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: ../layouts/Layout.astro
|
||||
title: 'About'
|
||||
title: "About"
|
||||
---
|
||||
|
||||
## Hello World!
|
||||
|
||||
+22
-10
@@ -1,26 +1,38 @@
|
||||
---
|
||||
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 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=10`)
|
||||
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=10`
|
||||
);
|
||||
|
||||
const posts = await response.json();
|
||||
|
||||
---
|
||||
|
||||
<Layout title="Blog">
|
||||
<div>
|
||||
{posts.objects.map(post => (
|
||||
{
|
||||
posts.objects.map((post) => (
|
||||
<article>
|
||||
<div style={{display: 'flex', justifyContent: 'space-between'}}>
|
||||
<div>
|
||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||
<h4>{post.title}</h4>
|
||||
<h5>{`🗓️ ${format(new Date(post.published_at), 'MMM do, y')}`}</h5>
|
||||
<h5>{`🗓️ ${format(
|
||||
new Date(post.published_at),
|
||||
"MMM do, y"
|
||||
)}`}</h5>
|
||||
</div>
|
||||
<Markup content={`<p>${post.content.split('</p>')[0]}`} />
|
||||
<Markup content={`<p>${post.content.split("</p>")[0]}`} />
|
||||
<a href={`/posts/${post.slug}`}>Read More</a>
|
||||
</div>
|
||||
</article>
|
||||
))}
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</Layout>
|
||||
|
||||
@@ -1,22 +1,28 @@
|
||||
---
|
||||
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'}}>
|
||||
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
||||
<h4>{post.title}</h4>
|
||||
<h5>{`🗓️ ${format(new Date(post.published_at), 'MMM do, y')}`}</h5>
|
||||
<h5>{`🗓️ ${format(new Date(post.published_at), "MMM do, y")}`}</h5>
|
||||
</div>
|
||||
<Markup content={post.content} />
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user