{{- $pages := .Pages -}} {{- /* Front matter: password */ -}} {{- $pages = where $pages "Params.password" "eq" nil -}} {{- /* Front matter: hiddenFromFeed */ -}} {{- $pages = where $pages "Params.hiddenFromFeed" "ne" true -}} {{- if ge .Config.limit 1 -}} {{- $pages = $pages | first .Config.limit -}} {{- end -}} {{- $length := $pages.Len -}} {{- /* TODO 文章内图片链接、分类、标签等处理 */ -}} {{- printf "" | safeHTML }} {{ .Title }} {{ .Permalink }} {{ .Site.Params.description | default .Site.Title }} Hugo {{ hugo.Version }} & FixIt {{ .Version }} {{ .Site.Language.LanguageCode }}{{ with .Site.Params.author.email }} {{.}}{{ with $.Site.Params.author.name }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Params.author.email }} {{ . }}{{ with $.Site.Params.author.name }} ({{ . }}){{ end }}{{ end }}{{ with .Site.Copyright }} {{ . }}{{ end }}{{ if not .Date.IsZero }} {{ (index $pages.ByLastmod.Reverse 0).Lastmod.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} {{- with .OutputFormats.Get "rss" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{- end }} {{- range $page := $pages }} {{- $params := .Params | merge .Site.Params.Page }} {{- $fullText := ((.Params.feed | default dict) | merge $.Config ).fullText }} {{- $author := partial "function/get-author-map.html" .Params.author }} {{- $image := $params.featuredimagepreview | default $params.featuredimage }} {{- with $image }} {{- if not (hasPrefix . "/") }} {{- $image = (printf "%s%s" $page.RelPermalink .) | safeURL }} {{- end }} {{- $image = $image | absURL }} {{- end }} {{- with .Resources.GetMatch "featured-image" }} {{- $image = .Permalink }} {{- end }} {{- with .Resources.GetMatch "featured-image-preview" }} {{- $image = .Permalink }} {{- end }} {{ .Title }} {{ .Permalink }} {{ .PublishDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} {{- with $author.email }}{{ . }}{{ with $author.name }} ({{ . }}){{ end }}{{ end }} {{ .Permalink }} {{- with .GetTerms "categories" }} {{- range . }} {{ .LinkTitle }} {{- end }} {{- end }} {{- if $fullText }} {{- "]*>.*` "" | replaceRE `]*( /)?>` "" | safeHTML -}} */ -}} {{- with $image }} {{- $content = add (printf "%q" . "featured image" "no-referrer") $content | safeHTML }} {{- end }} {{- $content | transform.XMLEscape | safeHTML }} {{- "]]>" | safeHTML -}} {{- else }} {{ (.Summary | default .Description | default .Title) | transform.XMLEscape | safeHTML }} {{- end }} {{- end }}