diff options
-rw-r--r-- | config.toml | 44 | ||||
-rw-r--r-- | layouts/index.atom.xml | 23 |
2 files changed, 35 insertions, 32 deletions
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 @@ +<feed xmlns="http://www.w3.org/2005/Atom"> + <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link href="{{ .Permalink }}index.xml" rel="self"/> + <link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }} + <updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }} + <id>{{ .Permalink }}</id>{{ with .Site.Author.name }} + <author> + <name>{{.}}</name>{{ with $.Site.Author.email }} + <email>{{.}}</email>{{end}} + </author>{{end}} + <generator>Hugo -- gohugo.io</generator>{{ range .Data.Pages }} + <entry> + {{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title> + <link href="{{ .Permalink }}"/> + <id>{{ .Permalink }}</id>{{ with .Site.Params.Author }} + <author> + <name>{{.}}</name> + </author>{{end}} + <published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published> + <updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated> + {{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content> + </entry>{{ end }} +</feed> |