I get told to shut up a lot by my friend. This is the microsite that documents this in detail. shutup.jp
postcards microsite
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Further RSS validation fixes

+18 -8
+10 -7
feed.xml.tmpl
··· 1 1 <?xml version="1.0" encoding="utf-8" standalone="yes"?> 2 - <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"> 2 + <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom"> 3 3 <channel> 4 4 <title>Shut up JP</title> 5 5 <link>https://shutup.jp/</link> ··· 9 9 <webMaster>hello@shutup.jp (JP Hastings-Spital)</webMaster> 10 10 <copyright>CC BY-NC-SA 4.0</copyright> 11 11 <lastBuildDate>{{ now.Format "Mon, 02 Jan 2006 15:04:05 -0700" }}</lastBuildDate> 12 + <atom:link href="https://shutup.jp/feed.xml" rel="self" type="application/rss+xml" /> 12 13 {{ range . }} 13 14 <item> 14 15 <title>{{ with .Location }}{{ .Name }}{{ end }}{{ with .SentOn }} ({{ .Format "January 2, 2006" }}){{ end }}</title> 15 16 <link>https://shutup.jp/#{{ .Name }}</link> 16 17 <pubDate>{{ with .SentOn }}{{ .Format "Mon, 02 Jan 2006 15:04:05 -0700" }}{{ end }}</pubDate> 17 - <guid>{{ .Name }}</guid> 18 - <description>{{- .Back.Transcription | plainify -}}</description> 18 + <guid isPermaLink="false">{{ .Name }}</guid> 19 + <description>{{- .Back.Transcription | safeHTML -}}</description> 19 20 <content:encoded> 20 - <img src="https://shutup.jp/{{.Name}}.webp" /> 21 - <p>Another delightfully curt postcard I received from Claire on {{ with .SentOn }}{{ .Format "January 1, 2006" }}{{ end }}. It reads:</p> 22 - <pre>{{- .Back.Transcription | safeHTML -}}</pre> 21 + <![CDATA[ 22 + <img src="https://shutup.jp/{{.Name}}.webp" /> 23 + <p>Another delightfully curt postcard I received from Claire on {{ with .SentOn }}{{ .Format "January 1, 2006" }}{{ end }}. It reads:</p> 24 + <pre>{{- .Back.Transcription | safeHTML -}}</pre> 25 + ]]> 23 26 </content:encoded> 24 - <enclosure url="https://shutup.jp/{{.Name}}.webp" type="image/webp"/> 27 + <enclosure url="https://shutup.jp/{{.Name}}.webp" type="image/webp" length="{{ .ImgSize }}"/> 25 28 </item> 26 29 {{ end }} 27 30 </channel>
+7 -1
main.go
··· 31 31 check(json.NewDecoder(f).Decode(&pc)) 32 32 33 33 pc.Name = filepath.Base(file)[:len(filepath.Base(file))-5] 34 + 35 + imgName := "postcards/" + pc.Name + ".webp" 36 + fs, err := os.Stat(imgName) 37 + check(err) 38 + pc.ImgSize = fs.Size() 39 + 34 40 pcs = append(pcs, pc) 35 - toCopy = append(toCopy, "postcards/"+pc.Name+".webp") 41 + toCopy = append(toCopy, imgName) 36 42 } 37 43 sort.Sort(BySentOn(pcs)) 38 44
+1
types.go
··· 14 14 Back Side `json:"back,omitempty"` 15 15 FrontDimensions Size `json:"frontSize" yaml:"front_size,omitempty"` 16 16 Context Context `json:"context,omitempty"` 17 + ImgSize int64 `json:"-"` 17 18 } 18 19 19 20 type Location struct {