blog/src/layouts/BaseLayout.astro

46 lines
1 KiB
Text
Raw Normal View History

2023-08-31 03:47:22 +00:00
---
2023-08-31 08:07:03 +00:00
import Footer from "../components/Footer.astro";
2023-08-31 03:47:22 +00:00
import LeftNav from "../components/LeftNav.astro";
2023-09-02 00:25:56 +00:00
import classNames from "classnames";
2023-08-31 03:47:22 +00:00
import "../styles/global.scss";
2023-09-01 17:05:29 +00:00
import "katex/dist/katex.min.css";
2023-09-02 00:25:56 +00:00
interface Props {
2023-09-02 03:25:11 +00:00
title?: string;
2023-09-02 00:25:56 +00:00
pad?: boolean;
2023-09-02 03:25:11 +00:00
toc?: boolean;
2023-09-02 00:25:56 +00:00
}
2023-09-02 03:25:11 +00:00
const { title, pad, toc } = Astro.props;
2023-09-02 00:25:56 +00:00
const shouldPad = pad === undefined ? true : pad;
2023-09-02 03:25:11 +00:00
const hasToc = toc ?? false;
2023-08-31 03:47:22 +00:00
---
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2024-06-27 02:04:24 +00:00
<title>{title && `${title} - `} Michael Zhang</title>
2024-05-03 21:08:38 +00:00
<script
data-goatcounter="https://goatcounter.mzhang.io/count"
async
src="//goatcounter.mzhang.io/count.js"></script>
2024-06-27 02:04:24 +00:00
<slot name="head" />
2023-08-31 03:47:22 +00:00
</head>
<body>
<div class="flex-wrapper">
2024-06-27 02:04:24 +00:00
<LeftNav />
2023-08-31 03:47:22 +00:00
2023-08-31 08:07:03 +00:00
<div class="sep"></div>
2023-08-31 03:47:22 +00:00
2023-09-02 03:25:11 +00:00
<main class={classNames(shouldPad && "pad", hasToc && "hasToc")}>
2023-08-31 03:47:22 +00:00
<slot />
2023-08-31 08:07:03 +00:00
</main>
2023-08-31 03:47:22 +00:00
</div>
2023-08-31 08:07:03 +00:00
<Footer />
2023-08-31 03:47:22 +00:00
</body>
</html>