website-astro/src/components/EditorialContent.astro

60 lines
1.3 KiB
Plaintext
Raw Normal View History

2022-12-26 23:15:27 +01:00
---
// import { renderContent } from "astro-i18n";
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 { html, headings } = await renderContent(Astro, content);
2022-12-26 23:15:27 +01:00
const toc = headings.map((heading) => {
return heading;
});
2022-12-28 10:36:15 +01:00
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} />
<!-- <div class="flow content" set:html={html}> -->
<Content />
2022-12-26 23:15:27 +01:00
</article>
</div>
<style define:vars={{ permalink: content.data.permalink }}>
@media (prefers-reduced-motion: no-preference) {
article {
view-transition-name: var(--permalink);
}
}
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>