website-astro/src/components/EditorialContent.astro

56 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-12-26 23:15:27 +01:00
---
2022-12-28 10:36:15 +01:00
import MetaDate from "./MetaDate.astro";
2022-12-26 23:15:27 +01:00
import TOC from "./TOC.astro";
const { content } = Astro.props;
const { Content, headings } = await content.render();
const toc = headings.map((heading) => {
return heading;
});
2022-12-28 10:36:15 +01:00
// if (content.data.code) {
// import "../styles/vendor/one-dark-pro.css";
// }
2022-12-26 23:15:27 +01:00
---
<div class="sidebar region">
<TOC toc={toc} />
<article class="flow editorial">
<h1>{content.data.title}</h1>
2022-12-28 10:36:15 +01:00
<p class="h3">{content.data.subtitle}</p>
<MetaDate item={content.data} />
2022-12-26 23:15:27 +01:00
<div class="flow content">
<Content />
</div>
</article>
</div>
<style>
2022-12-28 10:36:15 +01:00
.sidebar {
--gutter: var(--space-xs-m);
}
.sidebar > :global(:first-child) {
--sidebar-target-width: 16rem;
}
.sidebar > :global(:last-child) {
--sidebar-content-min-width: 60%;
}
2022-12-26 23:15:27 +01:00
h1 {
font-size: var(--size-4);
}
.editorial :global(h2),
.editorial :global(.h2) {
font-size: var(--size-3);
color: var(--color-blue);
}
2022-12-28 10:36:15 +01:00
.editorial :global(img),
.editorial :global(picture) {
margin: var(--space-s-m) 0;
}
2023-02-03 18:39:31 +01:00
.content :global(p + p) {
margin-block-start: var(--space-s);
}
2022-12-26 23:15:27 +01:00
</style>