Skip to content

Commit 42977e8

Browse files
committed
Format more files
1 parent 29960f9 commit 42977e8

8 files changed

Lines changed: 120 additions & 46 deletions

File tree

.prettierrc.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// .prettierrc.mjs
2+
// recommended astro config:
3+
// https://github.com/withastro/prettier-plugin-astro/tree/1f2b7de2900df251cb9f8674405acbb80d8542b1?tab=readme-ov-file#recommended-configuration
4+
/** @type {import("prettier").Config} */
5+
export default {
6+
plugins: ['prettier-plugin-astro'],
7+
overrides: [
8+
{
9+
files: '*.astro',
10+
options: {
11+
parser: 'astro',
12+
},
13+
},
14+
],
15+
};

package-lock.json

Lines changed: 83 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build": "astro check && tsc --noEmit && astro build",
1010
"preview": "astro preview",
1111
"astro": "astro",
12-
"format": "bash -c 'prettier --ignore-path <(cat .gitignore .git/info/exclude) --write .'"
12+
"format": "prettier --write astro.config.ts package.json plugins public README.md src tsconfig.json"
1313
},
1414
"dependencies": {
1515
"astro": "4.13.4",
@@ -24,11 +24,12 @@
2424
"@types/hast": "^3.0.4",
2525
"hast-util-classnames": "^3.0.0",
2626
"hast-util-is-element": "^3.0.0",
27-
"prettier": "^2.8.3",
27+
"prettier": "3.3.3",
28+
"prettier-plugin-astro": "^0.14.1",
2829
"rehype-katex": "^6.0.3",
30+
"rehype-raw": "7.0.0",
2931
"remark-math": "6.0.0",
3032
"typescript": "5.5",
31-
"rehype-raw": "7.0.0",
3233
"unist-util-visit": "^5.0.0"
3334
}
3435
}

src/blog.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ export const entries = async () => {
99
const blogEntries = await getCollection(
1010
"blog",
1111
// Only build draft pages in dev mode
12-
({ data }) => import.meta.env.DEV || data.draft !== true
12+
({ data }) => import.meta.env.DEV || data.draft !== true,
1313
);
1414
blogEntries.sort(
15-
(a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()
15+
(a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime(),
1616
);
1717
return blogEntries;
1818
};

src/components/Default.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const {
1717
}: Props = Astro.props;
1818
---
1919

20-
<!--?xml version="1.0" encoding="UTF-8"?--><!DOCTYPE html>
20+
<!--?xml version="1.0" encoding="UTF-8"?--><!doctype html>
2121
<html lang="en">
2222
<Head
2323
title={title}

src/content/blog/astro-suggestions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ const allEntries = await getCollection("blog");
130130
allEntries.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
131131

132132
const similarEntries = allEntries.filter(
133-
(e) => tags.some((t) => e.data.tags?.includes(t)) && e.slug !== entry.slug // [sh! highlight]
133+
(e) => tags.some((t) => e.data.tags?.includes(t)) && e.slug !== entry.slug, // [sh! highlight]
134134
);
135135

136136
const suggestedEntries = similarEntries.slice(0, 2);
@@ -146,7 +146,7 @@ allEntries.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
146146
const similarEntries = allEntries.filter(
147147
(e) =>
148148
tags.some((t) => e.data.tags?.includes(t)) &&
149-
e.data.pubDate.getTime() < entry.data.pubDate.getTime() // [sh! highlight]
149+
e.data.pubDate.getTime() < entry.data.pubDate.getTime(), // [sh! highlight]
150150
);
151151

152152
const suggestedEntries = similarEntries.slice(0, 2);

src/pages/posts/[slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const allEntries = await entries();
4040
const similarEntries = allEntries.filter(
4141
(e) =>
4242
e.data.pubDate.getTime() < entry.data.pubDate.getTime() &&
43-
tags.some((t) => e.data.tags?.includes(t))
43+
tags.some((t) => e.data.tags?.includes(t)),
4444
);
4545
4646
const suggestedEntries = similarEntries.slice(0, 2);

src/styles/global.css

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,18 @@ a:visited {
203203

204204
a:link::selection,
205205
a:link::-moz-selection {
206-
text-shadow: 0.03em 0 #b4d5fe, -0.03em 0 #b4d5fe, 0 0.03em #b4d5fe,
207-
0 -0.03em #b4d5fe, 0.06em 0 #b4d5fe, -0.06em 0 #b4d5fe, 0.09em 0 #b4d5fe,
208-
-0.09em 0 #b4d5fe, 0.12em 0 #b4d5fe, -0.12em 0 #b4d5fe, 0.15em 0 #b4d5fe,
206+
text-shadow:
207+
0.03em 0 #b4d5fe,
208+
-0.03em 0 #b4d5fe,
209+
0 0.03em #b4d5fe,
210+
0 -0.03em #b4d5fe,
211+
0.06em 0 #b4d5fe,
212+
-0.06em 0 #b4d5fe,
213+
0.09em 0 #b4d5fe,
214+
-0.09em 0 #b4d5fe,
215+
0.12em 0 #b4d5fe,
216+
-0.12em 0 #b4d5fe,
217+
0.15em 0 #b4d5fe,
209218
-0.15em 0 #b4d5fe;
210219
background: #b4d5fe;
211220
}

0 commit comments

Comments
 (0)