Initial commit
This commit is contained in:
@@ -57,7 +57,7 @@ const html5Template = `
|
||||
<body>
|
||||
<header>
|
||||
<div>
|
||||
☙ <a href="/">IslamBosna</a>
|
||||
<a href="/">☙ IslamBosna</a>
|
||||
</div>
|
||||
</header>
|
||||
<content>
|
||||
|
||||
@@ -19,12 +19,15 @@ type Post struct {
|
||||
}
|
||||
|
||||
func (p *Post) GemtextPage() string {
|
||||
return fmt.Sprintf("# %s\n\n", p.Title) + p.GemtextContent.String
|
||||
return fmt.Sprintf("# %s\n\n", p.Title) + p.GemtextContent.String + "\n\n" + p.Date
|
||||
|
||||
}
|
||||
|
||||
func (p *Post) HTMLPage() string {
|
||||
extensions := blackfriday.CommonExtensions | blackfriday.HardLineBreak
|
||||
return fmt.Sprintf("<h1>%s</h1>\n%s", p.Title, blackfriday.Run([]byte(p.MarkdownContent), blackfriday.WithExtensions(extensions)))
|
||||
result := fmt.Sprintf("<h1>%s</h1>\n%s", p.Title, blackfriday.Run([]byte(p.MarkdownContent), blackfriday.WithExtensions(extensions)))
|
||||
result += fmt.Sprintf("%s", p.Date)
|
||||
return result
|
||||
}
|
||||
|
||||
func GetPost(id int) (*Post, error) {
|
||||
|
||||
Reference in New Issue
Block a user