diff --git a/main.go b/main.go index 48b84b8..85a6d89 100644 --- a/main.go +++ b/main.go @@ -93,11 +93,12 @@ type pageBaseInfo struct { type indexPage struct { pageBaseInfo - Session *Session - Title string - Name string - Content template.HTML - Backrefs map[string][]Backref + Session *Session + Title string + Name string + Content template.HTML + Backrefs map[string][]Backref + ShowGraph bool } type Node struct { @@ -123,12 +124,13 @@ type graphPage struct { type editPage struct { pageBaseInfo - Session *Session - Title string - Content string - Name string - Editor template.HTML - Backrefs map[string][]Backref + Session *Session + Title string + Content string + Name string + Editor template.HTML + Backrefs map[string][]Backref + ShowGraph bool } type historyPage struct { @@ -447,6 +449,7 @@ func (h *editHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { Editor: editor, Name: page, Backrefs: mpPage.Refs, + ShowGraph: page != "Daily_Notes", } t, err := template.ParseFiles("templates/layout.html", "templates/edit.html") @@ -647,6 +650,7 @@ func (h *indexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { Content: template.HTML(pageText), Name: page, Backrefs: mpPage.Refs, + ShowGraph: page != "Daily_Notes", } t, err := template.ParseFiles("templates/layout.html", "templates/view.html") diff --git a/templates/edit.html b/templates/edit.html index 8aae32f..fd2703d 100644 --- a/templates/edit.html +++ b/templates/edit.html @@ -30,7 +30,9 @@
+ {{ if .ShowGraph }}
+ {{ end }}
{{ end }} diff --git a/templates/view.html b/templates/view.html index 69c4b7a..cc3d36e 100644 --- a/templates/view.html +++ b/templates/view.html @@ -24,7 +24,9 @@
+ {{ if .ShowGraph }}
+ {{ end }}
{{ end }}