Skip to content

Commit

Permalink
feat: tag article beginning and end
Browse files Browse the repository at this point in the history
  • Loading branch information
movsb committed Jun 1, 2019
1 parent 39c658d commit 852adea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions themes/blog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ func (b *Blog) render(w io.Writer, name string, data interface{}) {

func (b *Blog) loadTemplates() {
funcs := template.FuncMap{
// https://github.com/golang/go/issues/14256
"raw": func(s string) template.HTML {
return template.HTML(s)
},
"get_config": func(name string) string {
return b.service.GetStringOption(name)
},
Expand Down
4 changes: 3 additions & 1 deletion themes/blog/templates/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ <h1 itemprop="name">{{ .Title }}</h1>
</div>

<div class="entry clearfix" itemprop="articleBody">
{{ .Content }}
{{raw `<!--article begins here-->`}}
{{ .Content }}
{{raw `<!--article ends here-->`}}
<div class="meta clearfix">
<p>
发表于:<span class="value" title="发表时间:{{.DateString}}
Expand Down

0 comments on commit 852adea

Please sign in to comment.