prettier config
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
<footer>
|
||||
<p>
|
||||
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>
|
||||
</p>
|
||||
</footer>
|
||||
<p>
|
||||
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
|
||||
>
|
||||
</p>
|
||||
</footer>
|
||||
|
||||
+16
-17
@@ -1,21 +1,20 @@
|
||||
---
|
||||
|
||||
---
|
||||
|
||||
<div>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<span style={{ fontSize: '1.6rem' }}>Graham Hall</span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/">📝 Blog</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/about">👨💻 About</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<span style={{ fontSize: "1.6rem" }}>Graham Hall</span>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/">📝 Blog</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/about">👨💻 About</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
+19
-19
@@ -1,30 +1,30 @@
|
||||
---
|
||||
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;
|
||||
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>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{title}</title>
|
||||
</head>
|
||||
<body class="container">
|
||||
<Header />
|
||||
<slot />
|
||||
<Footer />
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{title}</title>
|
||||
</head>
|
||||
<body class="container">
|
||||
<Header />
|
||||
<slot />
|
||||
<Footer />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
---
|
||||
layout: ../layouts/Layout.astro
|
||||
title: 'About'
|
||||
title: "About"
|
||||
---
|
||||
|
||||
## Hello World!
|
||||
|
||||
+29
-17
@@ -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 => (
|
||||
<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={`<p>${post.content.split('</p>')[0]}`} />
|
||||
<a href={`/posts/${post.slug}`}>Read More</a>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
<div>
|
||||
{
|
||||
posts.objects.map((post) => (
|
||||
<article>
|
||||
<div>
|
||||
<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={`<p>${post.content.split("</p>")[0]}`} />
|
||||
<a href={`/posts/${post.slug}`}>Read More</a>
|
||||
</div>
|
||||
</article>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</Layout>
|
||||
|
||||
@@ -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