diff options
| author | Christine Dodrill <me@christine.website> | 2019-03-27 07:31:57 -0700 |
|---|---|---|
| committer | Christine Dodrill <me@christine.website> | 2019-03-27 07:31:57 -0700 |
| commit | 7e6a1cbd5841b094a7e168f8500075443f31e8e0 (patch) | |
| tree | 24d7d72cdb2113909acd912ab1bc06e5c5259e28 /internal | |
| parent | d0ff1b2d04fc0caf57d99f1d34ce13cf4aae6a1a (diff) | |
| download | xesite-7e6a1cbd5841b094a7e168f8500075443f31e8e0.tar.xz xesite-7e6a1cbd5841b094a7e168f8500075443f31e8e0.zip | |
make logging cleaner, etag more
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/blog/blog.go | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/internal/blog/blog.go b/internal/blog/blog.go index 54d5617..a73f27b 100644 --- a/internal/blog/blog.go +++ b/internal/blog/blog.go @@ -15,12 +15,13 @@ import ( // Post is a single blogpost. type Post struct { - Title string `json:"title"` - Link string `json:"link"` - Summary string `json:"summary,omitifempty"` - Body string `json:"-"` - BodyHTML template.HTML `json:"body"` - Date time.Time `json:"date"` + Title string `json:"title"` + Link string `json:"link"` + Summary string `json:"summary,omitifempty"` + Body string `json:"-"` + BodyHTML template.HTML `json:"body"` + Date time.Time + DateString string `json:"date"` } // Posts implements sort.Interface for a slice of Post objects. @@ -78,11 +79,12 @@ func LoadPosts(path string) (Posts, error) { } p := Post{ - Title: fm.Title, - Date: date, - Link: strings.Split(path, ".")[0], - Body: string(remaining), - BodyHTML: template.HTML(output), + Title: fm.Title, + Date: date, + DateString: fm.Date, + Link: strings.Split(path, ".")[0], + Body: string(remaining), + BodyHTML: template.HTML(output), } result = append(result, p) |
