diff options
author | Adam Mathes <adam@trenchant.org> | 2017-12-20 18:31:36 -0800 |
---|---|---|
committer | Adam Mathes <adam@trenchant.org> | 2017-12-20 18:31:36 -0800 |
commit | e826734316f306df0cea38c9c234010c75b18290 (patch) | |
tree | e333e235b2d8e252614cf1096f32e26483bdced2 /post | |
parent | b739f5a6534a065d7ac63e71bf0fce6b0fd58de9 (diff) | |
download | snkt-e826734316f306df0cea38c9c234010c75b18290.tar.gz snkt-e826734316f306df0cea38c9c234010c75b18290.tar.bz2 snkt-e826734316f306df0cea38c9c234010c75b18290.zip |
comments in post.go
Diffstat (limited to 'post')
-rw-r--r-- | post/post.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/post/post.go b/post/post.go index 8f96c8d..4644a50 100644 --- a/post/post.go +++ b/post/post.go @@ -215,7 +215,7 @@ func NormalizeTag(tag string) string { } /* -splitText splits up p.Unparsed into p.Text and p.Meta[attr][value] +splitText splits p.Unparsed into p.Text and p.Meta[attr][value] */ func (p *Post) splitTextMeta() { if p.Unparsed == "" { @@ -297,7 +297,7 @@ func (p *Post) parseDates() { } /* -Given p.Time is correct, create the other derived date fields +Given p.Time, create the other derived date fields */ func (p *Post) fillDates() { p.Year, p.Month, p.Day = p.Time.Date() @@ -366,6 +366,9 @@ func (posts Posts) Limit(limit int) Posts { } } +/* +ContainsTag returns true if Post `p` has `tag` in its set of tags. +*/ func (p *Post) ContainsTag(tag string) bool { for _, t := range p.Tags { if t == tag { |