fix: dates
This commit is contained in:
parent
b81f0fa3c4
commit
ffc8ce9a4c
8 changed files with 1132 additions and 18535 deletions
|
|
@ -2,17 +2,9 @@
|
|||
import Header from "../components/Header.astro";
|
||||
import Footer from "../components/Footer.astro";
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
description?: string;
|
||||
useKatex?: boolean;
|
||||
bodyClass?: string;
|
||||
}
|
||||
|
||||
const {
|
||||
title,
|
||||
description = "Barrett Ruth's personal website",
|
||||
useKatex = false,
|
||||
bodyClass = "graph-background",
|
||||
} = Astro.props;
|
||||
---
|
||||
|
|
|
|||
|
|
@ -8,21 +8,27 @@ interface Props {
|
|||
description?: string;
|
||||
date?: string;
|
||||
useKatex?: boolean;
|
||||
useD3?: boolean;
|
||||
scripts?: string[];
|
||||
};
|
||||
}
|
||||
|
||||
const { frontmatter, post } = Astro.props;
|
||||
const { title, description, useKatex = false } = frontmatter;
|
||||
const { title, description, useKatex = false, useD3 = false } = frontmatter;
|
||||
|
||||
const filePath = post?.id || "";
|
||||
const category = filePath.split("/")[0];
|
||||
|
||||
const topicColor = getTopicColor(category);
|
||||
|
||||
console.log(frontmatter)
|
||||
|
||||
---
|
||||
|
||||
<BaseLayout title={title} description={description} useKatex={useKatex}>
|
||||
<BaseLayout title={title} description={description} useKatex={useKatex}, useD3={useD3}>
|
||||
<slot name="head" slot="head">
|
||||
<link rel="stylesheet" href="/styles/posts.css" />
|
||||
<link rel="stylesheet" href="/styles/graph.css" />
|
||||
{
|
||||
useKatex && (
|
||||
<link
|
||||
|
|
@ -33,6 +39,11 @@ const topicColor = getTopicColor(category);
|
|||
/>
|
||||
)
|
||||
}
|
||||
{
|
||||
useD3 && (
|
||||
<script src="https://d3js.org/d3.v7.min.js"></script>
|
||||
)
|
||||
}
|
||||
</slot>
|
||||
|
||||
<div class="post-container" style={`--topic-color: ${topicColor};`}>
|
||||
|
|
@ -48,5 +59,8 @@ const topicColor = getTopicColor(category);
|
|||
|
||||
<slot name="scripts" slot="scripts">
|
||||
<script src="/scripts/dateHeadings.js" is:inline></script>
|
||||
{frontmatter.scripts?.map(script => (
|
||||
<script src={script} type="module"></script>
|
||||
))}
|
||||
</slot>
|
||||
</BaseLayout>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue