Initial commit from Astro
This commit is contained in:
44
src/layouts/main.astro
Normal file
44
src/layouts/main.astro
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
import Footer from "../components/footer.astro";
|
||||
import Header from "../components/header.astro";
|
||||
import SquareLines from "../components/square-lines.astro";
|
||||
const { title } = Astro.props;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{title}</title>
|
||||
|
||||
<!-- Used to add dark mode right away, adding here prevents any flicker -->
|
||||
<script is:inline>
|
||||
if (typeof Storage !== 'undefined') {
|
||||
if (
|
||||
localStorage.getItem('dark_mode') &&
|
||||
localStorage.getItem('dark_mode') == 'true'
|
||||
) {
|
||||
document.documentElement.classList.add('dark')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.prose img {
|
||||
border-radius: 20px;
|
||||
}
|
||||
</style>
|
||||
<link rel="icon" type="image/x-icon" href="../assets/images/favicon.png" />
|
||||
<script src="../assets/css/main.css"></script>
|
||||
<Fragment set:html={import.meta.env.HEADER_INJECT} />
|
||||
</head>
|
||||
<body class="antialiased bg-white dark:bg-neutral-950">
|
||||
<SquareLines />
|
||||
<Header />
|
||||
<slot />
|
||||
<Footer />
|
||||
<script src="../assets/js/main.js"></script>
|
||||
<Fragment set:html={import.meta.env.FOOTER_INJECT} />
|
||||
</body>
|
||||
</html>
|
||||
34
src/layouts/post.astro
Normal file
34
src/layouts/post.astro
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
import Layout from "./main.astro";
|
||||
const { frontmatter } = Astro.props;
|
||||
---
|
||||
|
||||
<Layout title={frontmatter.title}>
|
||||
<main
|
||||
class="relative z-30 max-w-4xl pb-1 mx-auto mt-10 bg-white dark:bg-neutral-950 md:rounded-t-md text-neutral-900"
|
||||
>
|
||||
<div
|
||||
class="relative flex flex-col px-5 pt-6 border-t border-b-0 md:border-r md:border-l md:pt-20 lg:px-0 justify-stretch md:rounded-t-2xl border-neutral-200 dark:border-neutral-800"
|
||||
>
|
||||
<div
|
||||
class="absolute top-0 left-0 hidden w-px h-full mt-1 -translate-x-px md:block bg-gradient-to-b from-transparent to-white dark:to-neutral-950"
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
class="absolute top-0 right-0 hidden w-px h-full mt-1 translate-x-px md:block bg-gradient-to-b from-transparent to-white dark:to-neutral-950"
|
||||
>
|
||||
</div>
|
||||
<h1
|
||||
class="w-full max-w-2xl mx-auto text-3xl font-bold leading-tight tracking-tighter text-left md:mb-12 md:text-4xl dark:text-neutral-100 lg:text-5xl md:leading-none"
|
||||
>
|
||||
{frontmatter.title}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<article
|
||||
class="w-full max-w-2xl mx-auto mb-20 prose-sm prose px-7 lg:px-0 lg:prose-lg dark:prose-invert"
|
||||
>
|
||||
<slot />
|
||||
</article>
|
||||
</main>
|
||||
</Layout>
|
||||
Reference in New Issue
Block a user