diff --git a/main.go b/main.go index 61230d8..8dfd23e 100644 --- a/main.go +++ b/main.go @@ -232,7 +232,7 @@ func (*authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if r.Method == http.MethodGet { if r.URL.Path == "/auth/login" { - templates := baseTemplate + templates := []string{"templates/layout_no_sidebar.html"} templates = append(templates, "templates/login.html") t, err := template.ParseFiles(templates...) if err != nil { @@ -895,7 +895,7 @@ func (h *indexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { ShowGraph: page != "Daily_Notes", TodayPage: "Today", } - templates := baseTemplate + templates := []string{"templates/layout_no_sidebar.html"} templates = append(templates, "templates/view.html") t, err := template.ParseFiles(templates...) if err != nil { @@ -1118,6 +1118,7 @@ func main() { return } + // FIXME: loads the whole page to save one new block page := mp.Get(id) log.Println(page.Content) var listItems []ListItem diff --git a/templates/layout_no_sidebar.html b/templates/layout_no_sidebar.html new file mode 100644 index 0000000..43403f8 --- /dev/null +++ b/templates/layout_no_sidebar.html @@ -0,0 +1,83 @@ + + + + + + + + + + + + {{ .Title }} - Wiki + {{ block "content_head" . }} {{ end }} + + + + +
+ + + + +
+
+ {{ template "content" . }} +
+
+ + + +
+ +{{ block "footer_scripts" . }} +{{ end }} +
+ +
+ + + + diff --git a/templates/view.html b/templates/view.html index fd1387b..4515dca 100644 --- a/templates/view.html +++ b/templates/view.html @@ -22,12 +22,6 @@ - -
- {{ if .ShowGraph }} -
- {{ end }} -
{{ end }}