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["join"] = Join
|
||||||
TplFuncMap["isnotzero"] = IsNotZero
|
TplFuncMap["isnotzero"] = IsNotZero
|
||||||
TplFuncMap["getavatar"] = GetAvatar
|
TplFuncMap["getavatar"] = GetAvatar
|
||||||
|
TplFuncMap["imgtonormal"] = ImgToNormal
|
||||||
}
|
}
|
||||||
|
|
||||||
// Str2html string to html
|
// Str2html string to html
|
||||||
@@ -73,3 +74,8 @@ func GetAvatar(domain string) string {
|
|||||||
|
|
||||||
return avatar
|
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>
|
<comments>https://{{$.Host}}/post/{{.Slug}}.html#comments</comments>
|
||||||
<guid>https://{{$.Host}}/post/{{.Slug}}.html</guid>
|
<guid>https://{{$.Host}}/post/{{.Slug}}.html</guid>
|
||||||
<description>
|
<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>
|
</description>
|
||||||
<pubDate>{{dateformat .CreatedAt "Mon, 02 Jan 2006 15:04:05 -0700"}}</pubDate>
|
<pubDate>{{dateformat .CreatedAt "Mon, 02 Jan 2006 15:04:05 -0700"}}</pubDate>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user