css, templates: make post headers sticky

master
urosm 2024-08-13 16:30:19 +02:00
parent d8a495bcb5
commit e98ef23e8c
3 changed files with 19 additions and 5 deletions

View File

@ -21,15 +21,16 @@ $endif$
</head>
<body$if(slug)$ id="$slug$"$endif$>
<main>
<article id="verso" class="post head">
<article id="verso" class="post">
<header>
<h1>$if(index)$$else$<a href="index.html">bavbavhaus.net</a>/$endif$<a href="$slug$.html">$pagetitle$</a></h1>
</header>
<div class="content">
$if(description)$
<div class="description">
$description$
</div>
$endif$
</header>
$if(toc)$
<nav>
$if(toc-title)$
@ -50,6 +51,7 @@ $body$
$for(parts)$
$it$
$endfor$
</div>
</article>
</main>
</body>

View File

@ -1,12 +1,13 @@
<article$if(slug)$ id="$slug$"$endif$ class="post tail">
<header>
<h1><a href="$slug$.html">$pagetitle$</a></h1>
</header>
<div class="content">
$if(description)$
<div class="description">
$description$
</div>
$endif$
</header>
$if(toc)$
<nav>
$if(toc-title)$
@ -22,4 +23,5 @@ $abstract$
</div>
$endif$
$body$
</div>
</article>

View File

@ -98,7 +98,7 @@ h6::before { content: "######"; }
color: var(--md-formatting-color);
}
article :is(h1, h2, h3, h4, h5, h6) {
article :is(h2, h3, h4, h5, h6) {
margin-top: 2rlh;
}
@ -367,6 +367,8 @@ body {
height: round(down, 100vh, 1rlh);
margin-left: auto;
margin-right: auto;
padding-top: 1rlh;
padding-bottom: 1rlh;
}
main {
@ -389,7 +391,15 @@ main>article#recto>* {
}
main>article#verso,
main>article#recto>* {
main>article#recto>article.post {
height: 100%;
display: grid;
grid-template-rows: auto 1fr;
overflow: hidden;
}
main>article#verso>div.content,
main>article#recto>article.post>div.content {
overflow-y: scroll;
}