1
Fork 0

Create a basic setup with Astro.

This commit is contained in:
Bauke 2024-03-02 13:32:01 +01:00
parent 264dcac6f2
commit 1ca72f7034
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
5 changed files with 68 additions and 0 deletions

11
astro.config.ts Normal file
View File

@ -0,0 +1,11 @@
import {defineConfig} from "astro/config";
/** Create an absolute path from a given relative one. */
const toPath = (path: string) => new URL(path, import.meta.url).pathname;
export default defineConfig({
outDir: toPath("./out/"),
publicDir: toPath("./source/public"),
srcDir: toPath("./source"),
site: "https://driftingnebula.com",
});

2
source/env.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference types="astro/client" />

24
source/layouts/base.astro Normal file
View File

@ -0,0 +1,24 @@
---
import "./base.scss";
/** Properties for the base layout. */
export interface Props {
frontmatter: {
pageTitle: string;
};
}
const {frontmatter} = Astro.props;
---
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{frontmatter.pageTitle}</title>
</head>
<body>
<slot />
</body>
</html>

18
source/layouts/base.scss Normal file
View File

@ -0,0 +1,18 @@
h1,
h2,
h3,
li,
ol,
p,
ul {
margin: 0;
padding: 0;
}
html {
font-size: 62.5%;
}
body {
font-size: 2rem;
}

13
source/pages/index.astro Normal file
View File

@ -0,0 +1,13 @@
---
import BaseLayout, {type Props as BaseProps} from "../layouts/base.astro";
const props: BaseProps = {
frontmatter: {
pageTitle: "driftingnebula",
},
};
---
<BaseLayout {...props}>
<h1>driftingnebula</h1>
</BaseLayout>