diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 7544d62..4740dd6 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -191,6 +191,7 @@ func (p *Parser) AddFile(baseDirPath string, dirEntryPath string, frontmatter Fr MarkdownBody: markdownContent, // preallocating the slice LinkedNoteURLs: make([]template.URL, 0, 5), + LiveReload: p.LiveReload, } p.Notes[note.CompleteURL] = note diff --git a/pkg/parser/zettel_parser.go b/pkg/parser/zettel_parser.go index 182fb65..bd3902a 100644 --- a/pkg/parser/zettel_parser.go +++ b/pkg/parser/zettel_parser.go @@ -17,6 +17,7 @@ type Note struct { Body template.HTML MarkdownBody string LinkedNoteURLs []template.URL + LiveReload bool } var backlinkRE = regexp.MustCompile(`\[[^\]]*\]\]`) diff --git a/site/layout/note.html b/site/layout/note.html index 9bf1160..48cd19d 100644 --- a/site/layout/note.html +++ b/site/layout/note.html @@ -1,6 +1,6 @@ {{ define "note"}} {{$PageData := index .DeepDataMerge.Notes .PageURL}} -{{ template "head" .}} +{{ template "head-note" .}}
diff --git a/site/layout/partials/head-note.html b/site/layout/partials/head-note.html new file mode 100644 index 0000000..70889f5 --- /dev/null +++ b/site/layout/partials/head-note.html @@ -0,0 +1,56 @@ +{{ define "head-note" }} + +{{ $PageData := index .DeepDataMerge.Notes .PageURL }} +{{if eq $PageData nil }} +{{ $PageData = .TemplateData }} +{{end}} + + + + + + + +