diff --git a/web/developerhelp/config.toml b/web/developerhelp/config.toml index a550169c01..b4a7f3c350 100644 --- a/web/developerhelp/config.toml +++ b/web/developerhelp/config.toml @@ -30,6 +30,10 @@ themesDir = "../hugothemes/themes" source = "../hugothemes/static/fonts" target = "static/fonts" + [[module.mounts]] + source = "../hugothemes/static/fonts" + target = "static/js" + [[module.mounts]] source = "static" target = "static" @@ -40,4 +44,9 @@ themesDir = "../hugothemes/themes" # Update security policy to allow asciidoctor [security] [security.exec] - allow = ['asciidoctor'] \ No newline at end of file + allow = ['asciidoctor'] + +[markup] + [markup.goldmark] + [markup.goldmark.renderer] + unsafe = true \ No newline at end of file diff --git a/web/hugothemes/static/js/searchFunction.js b/web/hugothemes/static/js/searchFunction.js index aa4b495d77..5cb2e8c0ef 100644 --- a/web/hugothemes/static/js/searchFunction.js +++ b/web/hugothemes/static/js/searchFunction.js @@ -3,7 +3,13 @@ let currentIndex = -1 document.addEventListener("keydown", (ev) => { if (ev.ctrlKey && ev.key === "f") { - document.body.appendChild(createSearchFeld()) + if (document.getElementById("searchFeld") !== null) { + close() + } else { + document.body.appendChild(createSearchFeld()) + document.getElementById("searchInput").focus() + } + } if (ev.key.toLowerCase() === "enter" && document.activeElement.parentElement === searchFeld) { @@ -19,6 +25,7 @@ function createSearchFeld() { searchFeld.id = "searchFeld" searchFeld.textContent = "\u{1F50D}" const input = document.createElement("input") + input.setAttribute("id", "searchInput") input.type = "text" input.oninput = (ev) => { onSearch(input.value)