Skip to content

Commit

Permalink
Adds Twitter rss feed for auto-tweeting.
Browse files Browse the repository at this point in the history
  • Loading branch information
osis committed May 31, 2017
1 parent 8666300 commit 7f38a10
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
13 changes: 13 additions & 0 deletions content/tweet/placeholder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
authors:
- flavorjones
- forde
categories:
- Agile
- Humans
date: 2017-12-18T12:55:40-05:00
draft: false
short: |
Placeholder short.
title: Placeholder Title
---
2 changes: 1 addition & 1 deletion themes/pivotal-ui/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="pan">
<div id="posts">
<ol class="list-timeline">
{{ range .Data.Pages }}
{{ range where .Data.Pages "Section" "!=" "tweet"}}
<li class="list-timeline-item post">
<div class="list-timeline-date">
<ul class="authors">
Expand Down
33 changes: 33 additions & 0 deletions themes/pivotal-ui/layouts/section/tweet.rss.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
<atom:link href="{{.Permalink}}" rel="self" type="application/rss+xml" />
{{ range where .Site.Pages "Section" "post" }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ $all := .Site.Data.authors}}
{{ $authors := .Params.authors}}
<author>
{{ range $i, $author := $authors }}
{{ with $a := (index $all $author)}}
{{if (and $i $a.Name)}} and {{end}}
{{ if $a.Twitter}}@{{$a.Twitter}}{{else}}{{$a.Name}}{{ end }}
{{end}}
{{end}}
</author>
<guid>{{ .Permalink }}</guid>
<description>{{ .Params.short | html }}</description>
</item>
{{ end }}
</channel>
</rss>

0 comments on commit 7f38a10

Please sign in to comment.