Calendar widget v1

This commit is contained in:
2026-04-23 10:48:10 +02:00
parent 314fe4600f
commit 910be60ed5
7 changed files with 471 additions and 15 deletions
+5
View File
@@ -22,9 +22,11 @@ var tmpl = template.Must(template.New("page.html").ParseFS(assets, "assets/page.
// specialPage is the result returned by a pageTypeHandler.
// Content is injected into the page after the standard markdown content.
// SuppressListing hides the default file/folder listing.
// Widget is a persistent sidebar widget rendered outside the main content area.
type specialPage struct {
Content template.HTML
SuppressListing bool
Widget template.HTML
}
// pageTypeHandler is implemented by each special folder type (diary, gallery, …).
@@ -168,8 +170,10 @@ func (h *handler) serveDir(w http.ResponseWriter, r *http.Request, urlPath, fsPa
}
var specialContent template.HTML
var diaryWidget template.HTML
if special != nil {
specialContent = special.Content
diaryWidget = special.Widget
}
rawContent := string(rawMD)
@@ -192,6 +196,7 @@ func (h *handler) serveDir(w http.ResponseWriter, r *http.Request, urlPath, fsPa
Content: rendered,
Entries: entries,
SpecialContent: specialContent,
DiaryWidget: diaryWidget,
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")