From 239be7235f509849d377d3678c41a33fec857637 Mon Sep 17 00:00:00 2001 From: "Florine W. Dekker" Date: Sat, 19 Nov 2022 19:13:09 +0100 Subject: [PATCH] Ensure proper toc wrapping --- src/main/css/snippets/common.css | 5 +++++ src/main/js/template.js | 2 +- src/test/index.html | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/css/snippets/common.css b/src/main/css/snippets/common.css index e185c1f..9e8dde9 100644 --- a/src/main/css/snippets/common.css +++ b/src/main/css/snippets/common.css @@ -55,6 +55,11 @@ a[target="_blank"]::after { .container-with-toc { display: grid; grid-template-columns: 200px auto; + grid-column-gap: calc(var(--block-spacing-horizontal) * 3); + } + + .container-with-toc nav { + max-width: 200px; } } diff --git a/src/main/js/template.js b/src/main/js/template.js index c8be4fa..43aadcb 100644 --- a/src/main/js/template.js +++ b/src/main/js/template.js @@ -103,7 +103,7 @@ const nav = function(highlightPath = "", cb = undefined) { */ const unpackEntry = function(entry, path = "/", highlightPath = "") { const shouldHighlight = highlightPath.startsWith(`${path + entry.name}/`); - const isExternalLink = !(/^https:\/\/.*fwdekker.com/.test(entry.link)) && entry.link !== "#"; + const isExternalLink = !(/^https:\/\/.*fwdekker.com/i.test(entry.link)) && entry.link !== "#"; if (entry.entries.length === 0) return "" + diff --git a/src/test/index.html b/src/test/index.html index f9bc8a9..c5e24fd 100644 --- a/src/test/index.html +++ b/src/test/index.html @@ -67,6 +67,21 @@
Test

Here is some text you may want to read.

+ +

Test

+

Here is some text you may want to read.

+ +

Test

+

Here is some text you may want to read.

+ +

Test

+

Here is some text you may want to read.

+ +

Test

+

Here is some text you may want to read.

+ +

Test

+

Here is some text you may want to read.