DisplayTitle dynamically generates a title from the Post's contents if it doesn't already have an explicit title.
()
| 212 | // DisplayTitle dynamically generates a title from the Post's contents if it |
| 213 | // doesn't already have an explicit title. |
| 214 | func (p *Post) DisplayTitle() string { |
| 215 | if p.Title.String != "" { |
| 216 | return p.Title.String |
| 217 | } |
| 218 | t := friendlyPostTitle(p.Content, p.ID) |
| 219 | return t |
| 220 | } |
| 221 | |
| 222 | // PlainDisplayTitle dynamically generates a title from the Post's contents if it |
| 223 | // doesn't already have an explicit title. |
no test coverage detected