mirror of
https://github.com/eiblog/eiblog.git
synced 2026-02-04 13:52:26 +08:00
fix: rss image path incorrect: data-src -> src
This commit is contained in:
@@ -25,6 +25,7 @@ func init() {
|
||||
TplFuncMap["join"] = Join
|
||||
TplFuncMap["isnotzero"] = IsNotZero
|
||||
TplFuncMap["getavatar"] = GetAvatar
|
||||
TplFuncMap["imgtonormal"] = ImgToNormal
|
||||
}
|
||||
|
||||
// Str2html string to html
|
||||
@@ -73,3 +74,8 @@ func GetAvatar(domain string) string {
|
||||
|
||||
return avatar
|
||||
}
|
||||
|
||||
// ImgToNormal replace lazy image attr data-src to src
|
||||
func ImgToNormal(content string) string {
|
||||
return strings.ReplaceAll(content, "data-src=", "src=")
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<comments>https://{{$.Host}}/post/{{.Slug}}.html#comments</comments>
|
||||
<guid>https://{{$.Host}}/post/{{.Slug}}.html</guid>
|
||||
<description>
|
||||
<![CDATA[{{.Content}}<p>本文链接:<a href="https://{{$.Host}}/post/{{.Slug}}.html">https://{{$.Host}}/post/{{.Slug}}.html</a>,<a href="https://{{$.Host}}/post/{{.Slug}}.html#comments">参与评论 »</a></p>]]>
|
||||
<![CDATA[{{imgtonormal .Content}}<p>本文链接:<a href="https://{{$.Host}}/post/{{.Slug}}.html">https://{{$.Host}}/post/{{.Slug}}.html</a>,<a href="https://{{$.Host}}/post/{{.Slug}}.html#comments">参与评论 »</a></p>]]>
|
||||
</description>
|
||||
<pubDate>{{dateformat .CreatedAt "Mon, 02 Jan 2006 15:04:05 -0700"}}</pubDate>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user