diff options
| author | Shulhan <m.shulhan@gmail.com> | 2019-08-14 00:36:16 +0700 |
|---|---|---|
| committer | Shulhan <m.shulhan@gmail.com> | 2019-08-14 00:41:34 +0700 |
| commit | 8ff2e5a522a3089edaa94e0bf7e16c63f5acab8c (patch) | |
| tree | c00a85e80e026f0fff669f5ec4b11d8ac5bff07b /filehtml.go | |
| parent | b1dd2bce666fe8217c35b9fab443035f25bfad26 (diff) | |
| download | ciigo-8ff2e5a522a3089edaa94e0bf7e16c63f5acab8c.tar.xz | |
filehtml: unpack the author and date from document metadata
Diffstat (limited to 'filehtml.go')
| -rw-r--r-- | filehtml.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/filehtml.go b/filehtml.go index d88f2da..fe2a949 100644 --- a/filehtml.go +++ b/filehtml.go @@ -14,6 +14,8 @@ import ( // type fileHTML struct { Title string + Author string + Date string Styles []string Body template.HTML Metadata map[string]string @@ -27,6 +29,8 @@ type fileHTML struct { // func (fhtml *fileHTML) reset() { fhtml.Title = "" + fhtml.Author = "" + fhtml.Date = "" fhtml.Styles = fhtml.Styles[:0] fhtml.Body = template.HTML("") @@ -43,6 +47,10 @@ func (fhtml *fileHTML) unpackMarkup(fa *markupFile) { for k, v := range fa.metadata { switch k { + case "author": + fhtml.Author = v.(string) + case "date": + fhtml.Date = v.(string) case "title": fhtml.Title = v.(string) case "stylesheet": |
