Flatpages: Move table of contents to the top on mobile

Fixes #459
This commit is contained in:
rubenwardy 2023-09-02 22:05:11 +01:00
parent d4ecaee5f2
commit 30722020c8
4 changed files with 14 additions and 19 deletions

@ -172,13 +172,10 @@ blockquote {
} }
.toc { .toc {
.nav-link { flex-basis: 25%;
color: #ADADAD;
padding: 0.25rem 0.5rem;
&:hover, &.active { .nav-link {
color: #DDD; padding: 0.25rem 0.5rem;
}
} }
.nav .nav { .nav .nav {

@ -1,5 +1,7 @@
:root { :root {
--bs-link-color: rgb(99, 163, 230);
--bs-link-color-rgb: 99, 163, 230; --bs-link-color-rgb: 99, 163, 230;
--bs-link-hover-color: rgb(88, 145, 204);
--bs-link-hover-color-rgb: 88, 145, 204; --bs-link-hover-color-rgb: 88, 145, 204;
} }
@ -166,10 +168,6 @@ pre {
border-color: #00b05c; border-color: #00b05c;
} }
.btn-download:focus, .btn-download.focus {
-webkit-box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.5);
box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.5);
}
.ranks-table tr { .ranks-table tr {
th, td { th, td {

@ -16,7 +16,7 @@
{%- endif %} {%- endif %}
<link rel="stylesheet" type="text/css" href="/static/libs/bootstrap.min.css?v=3"> <link rel="stylesheet" type="text/css" href="/static/libs/bootstrap.min.css?v=3">
<link rel="stylesheet" type="text/css" href="/static/custom.css?v=48"> <link rel="stylesheet" type="text/css" href="/static/custom.css?v=49">
<link rel="search" type="application/opensearchdescription+xml" href="/static/opensearch.xml" title="ContentDB" /> <link rel="search" type="application/opensearchdescription+xml" href="/static/opensearch.xml" title="ContentDB" />
{% if noindex -%} {% if noindex -%}

@ -11,14 +11,8 @@
{% set html = page.html %} {% set html = page.html %}
{% if page.meta.get("toc", True) %} {% if page.meta.get("toc", True) %}
<div class="container mt-4"> <div class="container mt-4">
<main class="row"> <main class="d-flex gap-5 flex-column flex-md-row-reverse">
<article class="col-md-9 content"> <nav class="flex-grow-0 flex-shrink-0 toc" style="flex-basis: 25%;">
<h1 class="mb-4">{{ page['title'] }}</h1>
{{ html | safe }}
</article>
<nav class="col-md-3 toc">
{% set headings = get_headings(html) %} {% set headings = get_headings(html) %}
<ul class="nav flex-column" role="menu"> <ul class="nav flex-column" role="menu">
{% for item in headings recursive %} {% for item in headings recursive %}
@ -35,6 +29,12 @@
{% endfor %} {% endfor %}
</ul> </ul>
</nav> </nav>
<article class="flex-grow-1 content">
<h1 class="mb-4">{{ page['title'] }}</h1>
{{ html | safe }}
</article>
</main> </main>
</div> </div>
{% else %} {% else %}