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.

Make dist folder if necessary

+8 -2
+1
TODO.md
··· 9 9 ### Ideas 10 10 11 11 - [ ] Include a map, blocking off the parts of the world that I've received a postcard from. Voronoi colouring for countries with more than one? 12 + - [ ] Add RSS feed for postcards
+7 -2
main.go
··· 4 4 "encoding/json" 5 5 "io" 6 6 "os" 7 + "path" 7 8 "path/filepath" 8 9 "sort" 9 10 ) 11 + 12 + const outDir = "dist/" 10 13 11 14 func check(e error) { 12 15 if e != nil { ··· 32 35 toCopy = append(toCopy, "postcards/"+pc.Name+".webp") 33 36 } 34 37 35 - indexF, err := os.OpenFile("dist/index.html", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) 38 + os.Mkdir("dist/", 0755) 39 + 40 + indexF, err := os.OpenFile(path.Join(outDir, "index.html"), os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) 36 41 check(err) 37 42 38 43 sort.Sort(BySentOn(pcs)) ··· 42 47 src, err := os.Open(tc) 43 48 check(err) 44 49 45 - dst, err := os.OpenFile("dist/"+filepath.Base(tc), os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) 50 + dst, err := os.OpenFile(path.Join(outDir, filepath.Base(tc)), os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) 46 51 check(err) 47 52 48 53 _, err = io.Copy(dst, src)