diff --git a/.prettierrc b/.prettierrc index a8296aa..691fb63 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,12 +1,5 @@ { - "overrides": [ - { - "files": ["**/*.astro"], - "options": { - "parser": "astro" - } - } - ], + "plugins": ["prettier-plugin-astro"], "semi": true, "singleQuote": false, "tabWidth": 2, diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index c484d49..3f59dcb 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -1,5 +1,5 @@ --- -import '../styles/global.css'; +import "../styles/global.css"; export interface Props { title: string; @@ -9,7 +9,7 @@ export interface Props { const canonicalURL = new URL(Astro.url.pathname, Astro.site); -const { title, description, image = '/placeholder-social.jpg' } = Astro.props; +const { title, description, image = "/placeholder-social.jpg" } = Astro.props; --- @@ -39,10 +39,10 @@ const { title, description, image = '/placeholder-social.jpg' } = Astro.props; (function () { const prefersDark = window.matchMedia && - window.matchMedia('(prefers-color-scheme: dark)').matches; - const setting = localStorage.getItem('starheart-color-scheme') || 'auto'; - if (setting === 'dark' || (prefersDark && setting !== 'light')) - document.documentElement.classList.toggle('dark', true); + window.matchMedia("(prefers-color-scheme: dark)").matches; + const setting = localStorage.getItem("starheart-color-scheme") || "auto"; + if (setting === "dark" || (prefersDark && setting !== "light")) + document.documentElement.classList.toggle("dark", true); })(); diff --git a/src/components/FormattedDate.astro b/src/components/FormattedDate.astro index 604629c..e9b61fd 100644 --- a/src/components/FormattedDate.astro +++ b/src/components/FormattedDate.astro @@ -8,9 +8,9 @@ const { date } = Astro.props; diff --git a/src/components/IconLinkGroup.astro b/src/components/IconLinkGroup.astro index d6b5490..c9cd5c6 100644 --- a/src/components/IconLinkGroup.astro +++ b/src/components/IconLinkGroup.astro @@ -1,5 +1,5 @@ --- -import IconLink from './IconLink.astro'; +import IconLink from "./IconLink.astro"; export interface Link { icon: (props: astroHTML.JSX.SVGAttributes) => astroHTML.JSX.Element; diff --git a/src/layouts/BlogPost.astro b/src/layouts/BlogPost.astro index 59c67ea..16eff5c 100644 --- a/src/layouts/BlogPost.astro +++ b/src/layouts/BlogPost.astro @@ -1,6 +1,6 @@ --- -import FormattedDate from '../components/FormattedDate.astro'; -import BaseLayout from './BaseLayout.astro'; +import FormattedDate from "../components/FormattedDate.astro"; +import BaseLayout from "./BaseLayout.astro"; const { title, description, pubDate, updatedDate, minutesRead } = Astro.props; --- @@ -15,7 +15,7 @@ const { title, description, pubDate, updatedDate, minutesRead } = Astro.props; ) } - {minutesRead ? ` · ${minutesRead}` : ''} + {minutesRead ? ` · ${minutesRead}` : ""}

{title}

diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index 86d7ff4..39e136c 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -1,51 +1,51 @@ --- -import { getCollection, type CollectionEntry } from 'astro:content'; -import BlogPost from '../../layouts/BlogPost.astro'; +import { getCollection, type CollectionEntry } from "astro:content"; +import BlogPost from "../../layouts/BlogPost.astro"; export async function getStaticPaths() { - const posts = await getCollection('blog'); + const posts = await getCollection("blog"); return posts.map((post) => ({ params: { slug: post.slug }, props: post, })); } -type Props = CollectionEntry<'blog'>; +type Props = CollectionEntry<"blog">; const post = Astro.props; const { Content, remarkPluginFrontmatter } = await post.render(); ---