Initial commit
This commit is contained in:
@@ -57,7 +57,7 @@ const html5Template = `
|
|||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<div>
|
<div>
|
||||||
☙ <a href="/">IslamBosna</a>
|
<a href="/">☙ IslamBosna</a>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<content>
|
<content>
|
||||||
|
|||||||
@@ -19,12 +19,15 @@ type Post struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *Post) GemtextPage() string {
|
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 {
|
func (p *Post) HTMLPage() string {
|
||||||
extensions := blackfriday.CommonExtensions | blackfriday.HardLineBreak
|
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) {
|
func GetPost(id int) (*Post, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user