Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xaprb/story.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaron Schwartz <xaprb@users.noreply.github.com>2018-09-15 21:57:36 +0300
committerBaron Schwartz <xaprb@users.noreply.github.com>2018-09-15 21:57:36 +0300
commit6e31bfaf5afbabfcb184447454d7e2801f67fd9c (patch)
tree033809d1fc4617d513a64970d63de8dd35a52a56
parentda21174a8044a028952946e8799f41f36f41d49a (diff)
Add mailchimp feed
-rw-r--r--exampleSite/content/mailchimp.md6
-rw-r--r--layouts/_default/mailchimp.xml22
2 files changed, 28 insertions, 0 deletions
diff --git a/exampleSite/content/mailchimp.md b/exampleSite/content/mailchimp.md
new file mode 100644
index 0000000..4593e53
--- /dev/null
+++ b/exampleSite/content/mailchimp.md
@@ -0,0 +1,6 @@
+---
+skip: true
+layout: mailchimp
+outputs:
+- rss
+---
diff --git a/layouts/_default/mailchimp.xml b/layouts/_default/mailchimp.xml
new file mode 100644
index 0000000..bc4855d
--- /dev/null
+++ b/layouts/_default/mailchimp.xml
@@ -0,0 +1,22 @@
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>{{ .Site.Title }} </title>
+ <link>{{ .Permalink }}</link>
+ <generator>Hugo -- gohugo.io</generator>
+ <language>en-us</language>
+ <author>{{ .Site.Params.Author }}</author>
+ <rights>Copyright (c) {{ .Site.LastChange.Year }}</rights>
+ <updated>{{ .Date }}</updated>
+ {{ range first 20 (where (where .Site.RegularPages "Section" "ne" "slides") ".Params.skip" "ne" "true") }}
+ <item>
+ <title>{{ cond (eq .Site.Params.titlecase true) (.Title | title | markdownify) (.Title | markdownify) }}</title>
+ <link>{{ .Permalink }}</link>
+ <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 MST" }}</pubDate>
+ <author>{{ .Site.Params.Author }}</author>
+ <guid>{{ .Permalink }}</guid>
+ <media:content xmlns:media="http://search.yahoo.com/mrss/" url="{{ (absURL (default (default "img/default-header-img.jpg" .Params.image) .Params.thumbnail)) }}" medium="image" type="image/jpg" width="100" height="100" />
+ <description>{{ (printf "%s<br>%s" .Params.description .Summary) | html }}</description>
+ </item>
+ {{ end }}
+ </channel>
+</rss>