Prefill Empty pages

This commit is contained in:
2026-04-23 14:34:07 +02:00
parent dedeeb77a8
commit 60b514eae7
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -123,7 +123,10 @@
document.addEventListener('keydown', function (e) {
if (!e.altKey || !e.shiftKey) return;
var action = keyMap[e.key];
// Shift+digit produces a layout-dependent character in e.key (e.g. "!"
// on US, "!" on DE), so fall back to e.code for digit rows.
var key = /^Digit[0-9]$/.test(e.code) ? e.code.slice(5) : e.key;
var action = keyMap[key];
if (action) {
e.preventDefault();
action();
+2
View File
@@ -187,6 +187,8 @@ func (h *handler) serveDir(w http.ResponseWriter, r *http.Request, urlPath, fsPa
if sectionIndex < len(sections) {
rawContent = string(sections[sectionIndex])
}
} else if editMode && rawContent == "" && urlPath != "/" {
rawContent = "# " + pageTitle(urlPath) + "\n\n"
}
data := pageData{