Skip to content

Commit

Permalink
feature: setup aliases for components, layouts, and images
Browse files Browse the repository at this point in the history
  • Loading branch information
justin1dennison committed Nov 18, 2024
1 parent 63f2f36 commit fc66c2d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
Empty file added src/components/.gitkeep
Empty file.
Empty file added src/images/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import Layout from "../layouts/Layout.astro";
import Layout from "@layouts/Layout.astro";
const baseUrl = import.meta.env.BASE_URL;
---
Expand Down
2 changes: 1 addition & 1 deletion src/pages/posts/index.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
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;
Expand Down
8 changes: 7 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"strictNullChecks": true
"strictNullChecks": true,
"baseUrl": ".",
"paths": {
"@components/*": ["src/components/*"],
"@images/*": ["src/images/*"],
"@layouts/*": ["src/layouts/*"]
}
}
}

0 comments on commit fc66c2d

Please sign in to comment.