-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: added prettier and formatted all of the files in the project
- Loading branch information
1 parent
43c1269
commit 08d10b4
Showing
7 changed files
with
120 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// .prettierrc.mjs | ||
/** @type {import("prettier").Config} */ | ||
export default { | ||
plugins: ["prettier-plugin-astro"], | ||
overrides: [ | ||
{ | ||
files: "*.astro", | ||
options: { | ||
parser: "astro", | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,16 @@ | |
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@astrojs/check": "^0.9.4", | ||
"@astrojs/mdx": "^3.1.8", | ||
"@astrojs/rss": "^4.0.9", | ||
"@astrojs/sitemap": "^3.2.1", | ||
"astro": "^4.16.7", | ||
"@astrojs/check": "^0.9.4", | ||
"typescript": "^5.6.3" | ||
}, | ||
"packageManager": "[email protected]" | ||
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"prettier": "^3.3.3", | ||
"prettier-plugin-astro": "^0.14.1" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
--- | ||
import { ViewTransitions } from "astro:transitions"; | ||
interface Props { | ||
title: string; | ||
title: string; | ||
} | ||
const { title } = Astro.props; | ||
--- | ||
|
||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="description" content="Astro description" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> | ||
<meta name="generator" content={Astro.generator} /> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="description" content="Astro description" /> | ||
<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> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" | ||
integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" | ||
crossorigin="anonymous" | ||
/> | ||
/> | ||
<ViewTransitions /> | ||
</head> | ||
<body> | ||
<slot /> | ||
</body> | ||
</head> | ||
<body> | ||
<slot /> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
--- | ||
import Layout from '../layouts/Layout.astro'; | ||
import Layout from "../layouts/Layout.astro"; | ||
const baseUrl = import.meta.env.BASE_URL; | ||
--- | ||
|
||
<Layout title="Welcome to JD."> | ||
<main> | ||
<h1>Welcome to <span class="text-gradient">JD's</span> page.</h1> | ||
<main> | ||
<h1>Welcome to <span class="text-gradient">JD's</span> page.</h1> | ||
</main> | ||
<ul> | ||
<li><a href=`${baseUrl}/posts`>Blog Posts</a></li> | ||
<li><a href={`${baseUrl}/posts`}>Blog Posts</a></li> | ||
</ul> | ||
</Layout> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
--- | ||
import { getCollection } from "astro:content"; | ||
export async function getStaticPaths() { | ||
const postEntries = await getCollection("posts", ({ data }) => { | ||
return import.meta.env.PROD ? data.draft !== true : true; | ||
}); | ||
return postEntries.map(entry => ({ params: { slug: entry.slug }, props: { entry }})) | ||
const postEntries = await getCollection("posts", ({ data }) => { | ||
return import.meta.env.PROD ? data.draft !== true : true; | ||
}); | ||
return postEntries.map((entry) => ({ | ||
params: { slug: entry.slug }, | ||
props: { entry }, | ||
})); | ||
} | ||
const { entry } = Astro.props; | ||
const { Content } = await entry.render() | ||
const { Content } = await entry.render(); | ||
--- | ||
|
||
<h1>{entry.data.title}</h1> | ||
<Content /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
--- | ||
import Layout from '../../layouts/Layout.astro'; | ||
import Layout from "../../layouts/Layout.astro"; | ||
import { getCollection } from "astro:content"; | ||
const postEntries = await getCollection("posts", ({ data }) => { | ||
return import.meta.env.PROD ? data.draft !== true : true; | ||
}); | ||
const baseUrl = import.meta.env.BASE_URL; | ||
--- | ||
|
||
<Layout title="Posts"> | ||
<main> | ||
<ul> | ||
{postEntries.map((entry) => | ||
( | ||
<li> | ||
<a href=`${baseUrl}/posts/${entry.slug}`>{ entry.data.title }</a> | ||
</li> | ||
))} | ||
{ | ||
postEntries.map((entry) => ( | ||
<li> | ||
<a href={`${baseUrl}/posts/${entry.slug}`}>{entry.data.title}</a> | ||
</li> | ||
)) | ||
} | ||
</ul> | ||
</main> | ||
</main> | ||
</Layout> | ||
|
||
|
||
|
||
|