()
| 1193 | } |
| 1194 | |
| 1195 | func (p *Post) processPost() PublicPost { |
| 1196 | res := &PublicPost{Post: p, Views: 0} |
| 1197 | res.Views = p.ViewCount |
| 1198 | res.Likes = p.LikeCount |
| 1199 | // TODO: move to own function |
| 1200 | loc := monday.FuzzyLocale(p.Language.String) |
| 1201 | res.DisplayDate = monday.Format(p.Created, monday.LongFormatsByLocale[loc], loc) |
| 1202 | |
| 1203 | return *res |
| 1204 | } |
| 1205 | |
| 1206 | func (p *PublicPost) CanonicalURL(hostName string) string { |
| 1207 | if p.Collection == nil || p.Collection.Alias == "" { |
no test coverage detected