Skip to content

Commit bf8c825

Browse files
committed
fix: added missing publish date in atom
1 parent eb2fb30 commit bf8c825

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

atom.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ func newAtomEntry(i *Item) *AtomEntry {
120120
Links: []AtomLink{{Href: link.Href, Rel: link_rel, Type: link.Type}},
121121
Id: id,
122122
Updated: anyTimeFormat(time.RFC3339, i.Updated, i.Created),
123+
Published: anyTimeFormat(time.RFC3339, i.Created, i.Updated),
123124
}
124125

125126
// if there's a description, assume it's html

feed_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var atomOutput = `<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.
2222
<updated>2013-01-16T21:52:35-05:00</updated>
2323
<id>tag:jmoiron.net,2013-01-16:/blog/limiting-concurrency-in-go/</id>
2424
<content type="html">&lt;p&gt;Go&#39;s goroutines make it easy to make &lt;a href=&#34;http://collectiveidea.com/blog/archives/2012/12/03/playing-with-go-embarrassingly-parallel-scripts/&#34;&gt;embarrassingly parallel programs&lt;/a&gt;, but in many &amp;quot;real world&amp;quot; cases resources can be limited and attempting to do everything at once can exhaust your access to them.&lt;/p&gt;</content>
25+
<published>2013-01-16T21:52:35-05:00</published>
2526
<link href="http://jmoiron.net/blog/limiting-concurrency-in-go/" rel="alternate"></link>
2627
<summary type="html">A discussion on controlled parallelism in golang</summary>
2728
<author>
@@ -33,13 +34,15 @@ var atomOutput = `<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.
3334
<title>Logic-less Template Redux</title>
3435
<updated>2013-01-16T21:52:35-05:00</updated>
3536
<id>tag:jmoiron.net,2013-01-16:/blog/logicless-template-redux/</id>
37+
<published>2013-01-16T21:52:35-05:00</published>
3638
<link href="http://jmoiron.net/blog/logicless-template-redux/" rel="alternate"></link>
3739
<summary type="html">More thoughts on logicless templates</summary>
3840
</entry>
3941
<entry>
4042
<title>Idiomatic Code Reuse in Go</title>
4143
<updated>2013-01-16T21:52:35-05:00</updated>
4244
<id>tag:jmoiron.net,2013-01-16:/blog/idiomatic-code-reuse-in-go/</id>
45+
<published>2013-01-16T21:52:35-05:00</published>
4346
<link href="http://jmoiron.net/blog/idiomatic-code-reuse-in-go/" rel="alternate"></link>
4447
<link href="http://example.com/cover.jpg" rel="enclosure" type="image/jpg" length="123456"></link>
4548
<summary type="html">How to use interfaces &lt;em&gt;effectively&lt;/em&gt;</summary>
@@ -48,6 +51,7 @@ var atomOutput = `<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.
4851
<title>Never Gonna Give You Up Mp3</title>
4952
<updated>2013-01-16T21:52:35-05:00</updated>
5053
<id>tag:example.com,2013-01-16:/RickRoll.mp3</id>
54+
<published>2013-01-16T21:52:35-05:00</published>
5155
<link href="http://example.com/RickRoll.mp3" rel="alternate"></link>
5256
<link href="http://example.com/RickRoll.mp3" rel="enclosure" type="audio/mpeg" length="123456"></link>
5357
<summary type="html">Never gonna give you up - Never gonna let you down.</summary>
@@ -56,6 +60,7 @@ var atomOutput = `<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.
5660
<title>String formatting in Go</title>
5761
<updated>2013-01-16T21:52:35-05:00</updated>
5862
<id>tag:example.com,2013-01-16:/strings</id>
63+
<published>2013-01-16T21:52:35-05:00</published>
5964
<link href="http://example.com/strings" rel="alternate"></link>
6065
<summary type="html">How to use things like %s, %v, %d, etc.</summary>
6166
</entry>
@@ -64,6 +69,7 @@ var atomOutput = `<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.
6469
<updated>2013-01-16T21:52:35-05:00</updated>
6570
<id>tag:go-proverbs.github.io,2013-01-16:/</id>
6671
<content type="html">Don&#39;t communicate by sharing memory, share memory by communicating.</content>
72+
<published>2013-01-16T21:52:35-05:00</published>
6773
<link href="https://go-proverbs.github.io/" rel="alternate"></link>
6874
</entry>
6975
</feed>`
@@ -309,30 +315,35 @@ var atomOutputSorted = `<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http:
309315
<title>Limiting Concurrency in Go</title>
310316
<updated>2013-01-18T21:52:35-05:00</updated>
311317
<id>tag:jmoiron.net,2013-01-18:/blog/limiting-concurrency-in-go/</id>
318+
<published>2013-01-18T21:52:35-05:00</published>
312319
<link href="http://jmoiron.net/blog/limiting-concurrency-in-go/" rel="alternate"></link>
313320
</entry>
314321
<entry>
315322
<title>Logic-less Template Redux</title>
316323
<updated>2013-01-17T21:52:35-05:00</updated>
317324
<id>tag:jmoiron.net,2013-01-17:/blog/logicless-template-redux/</id>
325+
<published>2013-01-17T21:52:35-05:00</published>
318326
<link href="http://jmoiron.net/blog/logicless-template-redux/" rel="alternate"></link>
319327
</entry>
320328
<entry>
321329
<title>Idiomatic Code Reuse in Go</title>
322330
<updated>2013-01-17T09:52:35-05:00</updated>
323331
<id>tag:jmoiron.net,2013-01-17:/blog/idiomatic-code-reuse-in-go/</id>
332+
<published>2013-01-17T09:52:35-05:00</published>
324333
<link href="http://jmoiron.net/blog/idiomatic-code-reuse-in-go/" rel="alternate"></link>
325334
</entry>
326335
<entry>
327336
<title>Never Gonna Give You Up Mp3</title>
328337
<updated>2013-01-17T07:52:35-05:00</updated>
329338
<id>tag:example.com,2013-01-17:/RickRoll.mp3</id>
339+
<published>2013-01-17T07:52:35-05:00</published>
330340
<link href="http://example.com/RickRoll.mp3" rel="alternate"></link>
331341
</entry>
332342
<entry>
333343
<title>String formatting in Go</title>
334344
<updated>2013-01-16T21:52:35-05:00</updated>
335345
<id>tag:example.com,2013-01-16:/strings</id>
346+
<published>2013-01-16T21:52:35-05:00</published>
336347
<link href="http://example.com/strings" rel="alternate"></link>
337348
</entry>
338349
</feed>`

0 commit comments

Comments
 (0)