~jheckt/PhotographyWebsite

c127ad2e5a6dc71827dac46b86ac57bc0a8b920c — turnipsoup 1 year, 10 months ago 18181fe
Added pubdate to rss feed
1 files changed, 12 insertions(+), 2 deletions(-)

M rss.go
M rss.go => rss.go +12 -2
@@ 4,6 4,8 @@ package main

import (
	"fmt"
	"strings"
	"time"

	"github.com/gorilla/feeds"



@@ 25,9 27,17 @@ func rss() string {
	blog := loadBlogPosts()

	for _, filename := range blog.SortedPosts {
		pdate, error := time.Parse("2006-01-02",
			strings.Replace(blog.PostDateMap[filename], " ", "", -1))

		if error != nil {
			log.Error(error)
		}

		item := feeds.Item{
			Title: blog.PostFiles[filename],
			Link:  &feeds.Link{Href: "https://photography.jeremyheckt.com/blog/" + filename},
			Title:   blog.PostFiles[filename],
			Link:    &feeds.Link{Href: "https://photography.jeremyheckt.com/blog/" + filename},
			Created: pdate,
		}
		feed.Items = append(feed.Items, &item)
	}