diff --git a/tools/tmplfunc.go b/tools/tmplfunc.go index 6a250c2..f7abf8b 100644 --- a/tools/tmplfunc.go +++ b/tools/tmplfunc.go @@ -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=") +} diff --git a/website/template/feedTpl.xml b/website/template/feedTpl.xml index 6e3762e..f8c2f44 100644 --- a/website/template/feedTpl.xml +++ b/website/template/feedTpl.xml @@ -15,7 +15,7 @@ https://{{$.Host}}/post/{{.Slug}}.html#comments https://{{$.Host}}/post/{{.Slug}}.html - 本文链接:https://{{$.Host}}/post/{{.Slug}}.html参与评论 »

]]> + 本文链接:https://{{$.Host}}/post/{{.Slug}}.html参与评论 »

]]>
{{dateformat .CreatedAt "Mon, 02 Jan 2006 15:04:05 -0700"}}