From 0997eafb438738d632a55a112826123e8ccd4043 Mon Sep 17 00:00:00 2001 From: Julio Capote Date: Tue, 6 Nov 2018 15:16:44 -0500 Subject: atom feed --- config.toml | 44 ++++++++++++-------------------------------- layouts/index.atom.xml | 23 +++++++++++++++++++++++ 2 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 layouts/index.atom.xml diff --git a/config.toml b/config.toml index 35894f3..ebf7dbd 100644 --- a/config.toml +++ b/config.toml @@ -13,6 +13,16 @@ disqusShortname = "" # disqus_shortname googleAnalytics = "" # UA-XXXXXXXX-X copyright = "" # default: author.name ↓ # 默认为下面配置的author.name ↓ + +[mediaTypes] +[mediaTypes."application/atom"] + suffixes = ["xml"] + +[outputFormats.Atom] + mediaType = "application/atom" + baseName = "atom" + isPlainText = false + [author] # essential # 必需 name = "Julio Capote" @@ -145,35 +155,5 @@ copyright = "" # default: author.name ↓ # 默认为下面配 wechat = "/path/to/your/wechat-qr-code.png" # 微信二维码 alipay = "/path/to/your/alipay-qr-code.png" # 支付宝二维码 - # [params.social] # 社交链接 - # a-email = "mailto:your@email.com" - # b-stack-overflow = "http://localhost:1313" - # c-twitter = "http://localhost:1313" - # d-facebook = "http://localhost:1313" - # e-linkedin = "http://localhost:1313" - # f-google = "http://localhost:1313" - # g-github = "http://localhost:1313" - # h-weibo = "http://localhost:1313" - # i-zhihu = "http://localhost:1313" - # j-douban = "http://localhost:1313" - # k-pocket = "http://localhost:1313" - # l-tumblr = "http://localhost:1313" - # m-instagram = "http://localhost:1313" - -# 将下面这段配置取消注释可以使 hugo 生成 .md 文件 -# Uncomment these options to make hugo output .md files. -#[mediaTypes] -# [mediaTypes."text/plain"] -# suffix = "md" -# -#[outputFormats.MarkDown] -# mediaType = "text/plain" -# isPlainText = true -# isHTML = false -# -#[outputs] -# home = ["HTML", "RSS"] -# page = ["HTML", "MarkDown"] -# section = ["HTML", "RSS"] -# taxonomy = ["HTML", "RSS"] -# taxonomyTerm = ["HTML"] +[outputs] + home = [ "HTML", "Atom" ] diff --git a/layouts/index.atom.xml b/layouts/index.atom.xml new file mode 100644 index 0000000..1ef68e1 --- /dev/null +++ b/layouts/index.atom.xml @@ -0,0 +1,23 @@ + + {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + + {{ if not .Date.IsZero }} + {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}{{ end }} + {{ .Permalink }}{{ with .Site.Author.name }} + + {{.}}{{ with $.Site.Author.email }} + {{.}}{{end}} + {{end}} + Hugo -- gohugo.io{{ range .Data.Pages }} + + {{ `<![CDATA[` | safeHTML }}{{ .Title }}]]> + + {{ .Permalink }}{{ with .Site.Params.Author }} + + {{.}} + {{end}} + {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }} + {{ ` + {{ end }} + -- cgit v1.2.3