These awesome people donate to me on Patreon.
+If you would like to show up in this list, please donate to me on Patreon. This
+is refreshed every time the site is deployed.
+
+
+
+ @for user in users {
+
@user.attributes.full_name
+ }
+
+
+
+@:footer_html()
+```
+
+The templates compile down to Rust, which lets me include other parts of the
+program into the templates. Here I use that to take a list of users from the
+incredibly hacky Patreon API client I wrote for this website and iterate over
+it, making a list of every patron by name.
+
+## Build Process
+
+As a nice side effect of this rewrite, my website is now completely built using
+[Nix](https://nixos.org/). This allows the website to be built reproducibly, as
+well as a full development environment setup for free for anyone that checks out
+the repo and runs `nix-shell`. Check out
+[naersk](https://github.com/nmattia/naersk) for the secret sauce that enables my
+docker image build. See [this blogpost](/blog/drone-kubernetes-cd-2020-07-10)
+for more information about this build process (though my site uses GitHub
+Actions instead of Drone).
+
+## `jsonfeed` Go package
+
+I used to have a [JSONFeed](https://www.jsonfeed.org/) package publicly visible
+at the go import path `christine.website/jsonfeed`. As far as I know I'm the
+only person who ended up using it; but in case there are any private repos that
+I don't know about depending on it, I have made the jsonfeed package available
+at its old location as well as its source code
+[here](https://tulpa.dev/Xe/jsonfeed). You may have to update your `go.mod` file
+to import `christine.website/jsonfeed` instead of `christine.website`. If
+something ends up going wrong as a result of this, please [file a GitHub issue
+here](https://github.com/Xe/site/issues/new) and I can attempt to assist
+further.
+
+## `go_vanity` crate
+
+I have written a small go vanity import crate and exposed it in my Git repo. If
+you want to use it, add it to your `Cargo.toml` like this:
+
+```toml
+[dependencies]
+go_vanity = { git = "https://github.com/Xe/site", branch = "master" }
+```
+
+You can then use it from any warp application by calling `go_vanity::github` or
+`go_vanity::gitea` like this:
+
+```rust
+let go_vanity_jsonfeed = warp::path("jsonfeed")
+ .and(warp::any().map(move || "christine.website/jsonfeed"))
+ .and(warp::any().map(move || "https://tulpa.dev/Xe/jsonfeed"))
+ .and_then(go_vanity::gitea);
+```
+
+I plan to add full documentation to this crate soon as well as release it
+properly on crates.io.
+
+## `patreon` crate
+
+I have also written a small [Patreon](https://www.patreon.com/) API client and
+made it available in my Git repo. If you want to use it, add it to your
+`Cargo.toml` like this:
+
+```toml
+[dependencies]
+patreon = { git = "https://github.com/Xe/site", branch = "master" }
+```
+
+This client is _incredibly limited_ and only supports the minimum parts of the
+Patreon API that are required for my website to function. Patreon has also
+apparently started to phase out support for its API anyways, so I don't know how
+long this will be useful.
+
+But this is there should you need it!
+
+## Dhall Kubernetes Manifest
+
+I also took the time to port the kubernetes manifest to
+[Dhall](https://dhall-lang.org/). This allows me to have a type-safe kubernetes
+manifest that will correctly have all of the secrets injected for me from the
+environment of the deploy script.
+
+---
+
+These are the biggest giants that my website now sits on. The code for this
+rewrite is still a bit messy. I'm working on making it better, but my goal is to
+have this website's code shine as an example of how to best write this kind of
+website in Rust. Check out the code [here](https://github.com/Xe/site).
diff --git a/cmd/site/clacks.go b/cmd/site/clacks.go
deleted file mode 100644
index 3415d14..0000000
--- a/cmd/site/clacks.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package main
-
-import (
- "math/rand"
- "net/http"
- "time"
-)
-
-type ClackSet []string
-
-func (cs ClackSet) Name() string {
- return "GNU " + cs[rand.Intn(len(cs))]
-}
-
-func (cs ClackSet) Middleware(next http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Header().Add("X-Clacks-Overhead", cs.Name())
-
- next.ServeHTTP(w, r)
- })
-}
-
-func init() {
- rand.Seed(time.Now().Unix())
-}
diff --git a/cmd/site/html.go b/cmd/site/html.go
deleted file mode 100644
index 37acba8..0000000
--- a/cmd/site/html.go
+++ /dev/null
@@ -1,245 +0,0 @@
-package main
-
-import (
- "context"
- "fmt"
- "html/template"
- "net/http"
- "path/filepath"
- "strings"
- "time"
-
- "christine.website/cmd/site/internal"
- "christine.website/cmd/site/internal/blog"
- "github.com/prometheus/client_golang/prometheus"
- "github.com/prometheus/client_golang/prometheus/promauto"
- "within.website/ln"
- "within.website/ln/opname"
-)
-
-var (
- templateRenderTime = promauto.NewHistogramVec(prometheus.HistogramOpts{
- Name: "template_render_time",
- Help: "Template render time in nanoseconds",
- }, []string{"name"})
-)
-
-func logTemplateTime(ctx context.Context, name string, f ln.F, from time.Time) {
- dur := time.Since(from)
- templateRenderTime.With(prometheus.Labels{"name": name}).Observe(float64(dur))
- ln.Log(ctx, f, ln.F{"dur": dur, "name": name})
-}
-
-func (s *Site) renderTemplatePage(templateFname string, data interface{}) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- ctx := opname.With(r.Context(), "renderTemplatePage")
- fetag := "W/" + internal.Hash(templateFname, etag) + "-1"
-
- f := ln.F{"etag": fetag, "if_none_match": r.Header.Get("If-None-Match")}
-
- if r.Header.Get("If-None-Match") == fetag {
- http.Error(w, "Cached data OK", http.StatusNotModified)
- ln.Log(ctx, f, ln.Info("Cache hit"))
- return
- }
-
- defer logTemplateTime(ctx, templateFname, f, time.Now())
-
- var t *template.Template
- var err error
-
- t, err = template.ParseFiles("templates/base.html", "templates/"+templateFname)
- if err != nil {
- w.WriteHeader(http.StatusInternalServerError)
- ln.Error(ctx, err, ln.F{"action": "renderTemplatePage", "page": templateFname})
- fmt.Fprintf(w, "error: %v", err)
- }
-
- w.Header().Set("ETag", fetag)
- w.Header().Set("Cache-Control", "max-age=432000")
-
- err = t.Execute(w, data)
- if err != nil {
- panic(err)
- }
- })
-}
-
-var postView = promauto.NewCounterVec(prometheus.CounterOpts{
- Name: "posts_viewed",
- Help: "The number of views per post or talk",
-}, []string{"base"})
-
-func (s *Site) listSeries(w http.ResponseWriter, r *http.Request) {
- s.renderTemplatePage("series.html", s.Series).ServeHTTP(w, r)
-}
-
-func (s *Site) showSeries(w http.ResponseWriter, r *http.Request) {
- if r.RequestURI == "/blog/series/" {
- http.Redirect(w, r, "/blog/series", http.StatusSeeOther)
- return
- }
-
- series := filepath.Base(r.URL.Path)
- var posts []blog.Post
-
- for _, p := range s.Posts {
- if p.Series == series {
- posts = append(posts, p)
- }
- }
-
- s.renderTemplatePage("serieslist.html", struct {
- Name string
- Posts []blog.Post
- }{
- Name: series,
- Posts: posts,
- }).ServeHTTP(w, r)
-}
-
-func (s *Site) showGallery(w http.ResponseWriter, r *http.Request) {
- if r.RequestURI == "/gallery/" {
- http.Redirect(w, r, "/gallery", http.StatusSeeOther)
- return
- }
-
- cmp := r.URL.Path[1:]
- var p blog.Post
- var found bool
- for _, pst := range s.Gallery {
- if pst.Link == cmp {
- p = pst
- found = true
- }
- }
-
- if !found {
- w.WriteHeader(http.StatusNotFound)
- s.renderTemplatePage("error.html", "no such post found: "+r.RequestURI).ServeHTTP(w, r)
- return
- }
-
- var tags string
- if len(p.Tags) != 0 {
- for _, t := range p.Tags {
- tags = tags + " #" + strings.ReplaceAll(t, "-", "")
- }
- }
-
- h := s.renderTemplatePage("gallerypost.html", struct {
- Title string
- Link string
- BodyHTML template.HTML
- Date string
- Tags string
- Image string
- }{
- Title: p.Title,
- Link: p.Link,
- BodyHTML: p.BodyHTML,
- Date: internal.IOS13Detri(p.Date),
- Tags: tags,
- Image: p.ImageURL,
- })
-
- if h == nil {
- panic("how did we get here?")
- }
-
- h.ServeHTTP(w, r)
- postView.With(prometheus.Labels{"base": filepath.Base(p.Link)}).Inc()
-}
-
-func (s *Site) showTalk(w http.ResponseWriter, r *http.Request) {
- if r.RequestURI == "/talks/" {
- http.Redirect(w, r, "/talks", http.StatusSeeOther)
- return
- }
-
- cmp := r.URL.Path[1:]
- var p blog.Post
- var found bool
- for _, pst := range s.Talks {
- if pst.Link == cmp {
- p = pst
- found = true
- }
- }
-
- if !found {
- w.WriteHeader(http.StatusNotFound)
- s.renderTemplatePage("error.html", "no such post found: "+r.RequestURI).ServeHTTP(w, r)
- return
- }
-
- h := s.renderTemplatePage("talkpost.html", struct {
- Title string
- Link string
- BodyHTML template.HTML
- Date string
- SlidesLink string
- }{
- Title: p.Title,
- Link: p.Link,
- BodyHTML: p.BodyHTML,
- Date: internal.IOS13Detri(p.Date),
- SlidesLink: p.SlidesLink,
- })
-
- if h == nil {
- panic("how did we get here?")
- }
-
- h.ServeHTTP(w, r)
- postView.With(prometheus.Labels{"base": filepath.Base(p.Link)}).Inc()
-}
-
-func (s *Site) showPost(w http.ResponseWriter, r *http.Request) {
- if r.RequestURI == "/blog/" {
- http.Redirect(w, r, "/blog", http.StatusSeeOther)
- return
- }
-
- cmp := r.URL.Path[1:]
- var p blog.Post
- var found bool
- for _, pst := range s.Posts {
- if pst.Link == cmp {
- p = pst
- found = true
- }
- }
-
- if !found {
- w.WriteHeader(http.StatusNotFound)
- s.renderTemplatePage("error.html", "no such post found: "+r.RequestURI).ServeHTTP(w, r)
- return
- }
-
- var tags string
-
- if len(p.Tags) != 0 {
- for _, t := range p.Tags {
- tags = tags + " #" + strings.ReplaceAll(t, "-", "")
- }
- }
-
- s.renderTemplatePage("blogpost.html", struct {
- Title string
- Link string
- BodyHTML template.HTML
- Date string
- Series, SeriesTag string
- Tags string
- }{
- Title: p.Title,
- Link: p.Link,
- BodyHTML: p.BodyHTML,
- Date: internal.IOS13Detri(p.Date),
- Series: p.Series,
- SeriesTag: strings.ReplaceAll(p.Series, "-", ""),
- Tags: tags,
- }).ServeHTTP(w, r)
- postView.With(prometheus.Labels{"base": filepath.Base(p.Link)}).Inc()
-}
diff --git a/cmd/site/internal/blog/blog.go b/cmd/site/internal/blog/blog.go
deleted file mode 100644
index 93a77c2..0000000
--- a/cmd/site/internal/blog/blog.go
+++ /dev/null
@@ -1,137 +0,0 @@
-package blog
-
-import (
- "html/template"
- "io/ioutil"
- "os"
- "path/filepath"
- "sort"
- "strings"
- "time"
-
- "christine.website/cmd/site/internal/front"
- "github.com/russross/blackfriday"
-)
-
-// Post is a single blogpost.
-type Post struct {
- Title string `json:"title"`
- Link string `json:"link"`
- Summary string `json:"summary,omitifempty"`
- Body string `json:"-"`
- BodyHTML template.HTML `json:"body"`
- Series string `json:"series"`
- Tags []string `json:"tags"`
- SlidesLink string `json:"slides_link"`
- ImageURL string `json:"image_url"`
- ThumbURL string `json:"thumb_url"`
- Date time.Time
- DateString string `json:"date"`
-}
-
-// Posts implements sort.Interface for a slice of Post objects.
-type Posts []Post
-
-func (p Posts) Series() []string {
- names := map[string]struct{}{}
-
- for _, ps := range p {
- if ps.Series != "" {
- names[ps.Series] = struct{}{}
- }
- }
-
- var result []string
-
- for name := range names {
- result = append(result, name)
- }
-
- return result
-}
-
-func (p Posts) Len() int { return len(p) }
-func (p Posts) Less(i, j int) bool {
- iDate := p[i].Date
- jDate := p[j].Date
-
- return iDate.Unix() < jDate.Unix()
-}
-func (p Posts) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
-
-// LoadPosts loads posts for a given directory.
-func LoadPosts(path string, prepend string) (Posts, error) {
- type postFM struct {
- Title string
- Date string
- Series string
- Tags []string
- SlidesLink string `yaml:"slides_link"`
- Image string
- Thumb string
- Show string
- }
- var result Posts
-
- err := filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
- if err != nil {
- return err
- }
-
- if info.IsDir() {
- return nil
- }
-
- fin, err := os.Open(path)
- if err != nil {
- return err
- }
- defer fin.Close()
-
- content, err := ioutil.ReadAll(fin)
- if err != nil {
- return err
- }
-
- var fm postFM
- remaining, err := front.Unmarshal(content, &fm)
- if err != nil {
- return err
- }
-
- output := blackfriday.Run(remaining)
-
- const timeFormat = `2006-01-02`
- date, err := time.Parse(timeFormat, fm.Date)
- if err != nil {
- return err
- }
-
- fname := filepath.Base(path)
- fname = strings.TrimSuffix(fname, filepath.Ext(fname))
-
- p := Post{
- Title: fm.Title,
- Date: date,
- DateString: fm.Date,
- Link: filepath.Join(prepend, fname),
- Body: string(remaining),
- BodyHTML: template.HTML(output),
- SlidesLink: fm.SlidesLink,
- Series: fm.Series,
- Tags: fm.Tags,
- ImageURL: fm.Image,
- ThumbURL: fm.Thumb,
- }
- result = append(result, p)
-
- return nil
- })
- if err != nil {
- return nil, err
- }
-
- sort.Sort(sort.Reverse(result))
-
- return result, nil
-}
diff --git a/cmd/site/internal/blog/blog_test.go b/cmd/site/internal/blog/blog_test.go
deleted file mode 100644
index 6f44a30..0000000
--- a/cmd/site/internal/blog/blog_test.go
+++ /dev/null
@@ -1,66 +0,0 @@
-package blog
-
-import (
- "testing"
-)
-
-func TestLoadPosts(t *testing.T) {
- posts, err := LoadPosts("../../../../blog", "blog")
- if err != nil {
- t.Fatal(err)
- }
-
- for _, post := range posts {
- t.Run(post.Link, post.test)
- }
-}
-
-func TestLoadTalks(t *testing.T) {
- talks, err := LoadPosts("../../../../talks", "talks")
- if err != nil {
- t.Fatal(err)
- }
-
- for _, talk := range talks {
- t.Run(talk.Link, talk.test)
- if talk.SlidesLink == "" {
- t.Errorf("talk %s (%s) doesn't have a slides link", talk.Title, talk.DateString)
- }
- }
-}
-
-func TestLoadGallery(t *testing.T) {
- gallery, err := LoadPosts("../../../../gallery", "gallery")
- if err != nil {
- t.Fatal(err)
- }
-
- for _, art := range gallery {
- t.Run(art.Link, art.test)
- if art.ImageURL == "" {
- t.Errorf("art %s (%s) doesn't have an image link", art.Title, art.DateString)
- }
- if art.ThumbURL == "" {
- t.Errorf("art %s (%s) doesn't have a thumbnail link", art.Title, art.DateString)
- }
-
- }
-}
-
-func (p Post) test(t *testing.T) {
- if p.Title == "" {
- t.Error("no post title")
- }
-
- if p.DateString == "" {
- t.Error("no date")
- }
-
- if p.Link == "" {
- t.Error("no link")
- }
-
- if p.Body == "" {
- t.Error("no body")
- }
-}
diff --git a/cmd/site/internal/date.go b/cmd/site/internal/date.go
deleted file mode 100644
index 960cdc2..0000000
--- a/cmd/site/internal/date.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package internal
-
-import "time"
-
-const iOS13DetriFormat = `2006 M1 2`
-
-// IOS13Detri formats a datestamp like iOS 13 does with the Lojban locale.
-func IOS13Detri(t time.Time) string {
- return t.Format(iOS13DetriFormat)
-}
diff --git a/cmd/site/internal/date_test.go b/cmd/site/internal/date_test.go
deleted file mode 100644
index 60254f9..0000000
--- a/cmd/site/internal/date_test.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package internal
-
-import (
- "fmt"
- "testing"
- "time"
-)
-
-func TestIOS13Detri(t *testing.T) {
- cases := []struct {
- in time.Time
- out string
- }{
- {
- in: time.Date(2019, time.March, 30, 0, 0, 0, 0, time.FixedZone("UTC", 0)),
- out: "2019 M3 30",
- },
- }
-
- for _, cs := range cases {
- t.Run(fmt.Sprintf("%s -> %s", cs.in.Format(time.RFC3339), cs.out), func(t *testing.T) {
- result := IOS13Detri(cs.in)
- if result != cs.out {
- t.Fatalf("wanted: %s, got: %s", cs.out, result)
- }
- })
- }
-}
diff --git a/cmd/site/internal/front/LICENSE b/cmd/site/internal/front/LICENSE
deleted file mode 100644
index e8152bb..0000000
--- a/cmd/site/internal/front/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2017 TJ Holowaychuk
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
\ No newline at end of file
diff --git a/cmd/site/internal/front/front.go b/cmd/site/internal/front/front.go
deleted file mode 100644
index b2c7f0e..0000000
--- a/cmd/site/internal/front/front.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// Package front provides YAML frontmatter unmarshalling.
-package front
-
-import (
- "bytes"
-
- "gopkg.in/yaml.v2"
-)
-
-// Delimiter.
-var delim = []byte("---")
-
-// Unmarshal parses YAML frontmatter and returns the content. When no
-// frontmatter delimiters are present the original content is returned.
-func Unmarshal(b []byte, v interface{}) (content []byte, err error) {
- if !bytes.HasPrefix(b, delim) {
- return b, nil
- }
-
- parts := bytes.SplitN(b, delim, 3)
- content = parts[2]
- err = yaml.Unmarshal(parts[1], v)
- return
-}
diff --git a/cmd/site/internal/front/front_test.go b/cmd/site/internal/front/front_test.go
deleted file mode 100644
index bdc56d1..0000000
--- a/cmd/site/internal/front/front_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package front_test
-
-import (
- "fmt"
- "log"
-
- "christine.website/cmd/site/internal/front"
-)
-
-var markdown = []byte(`---
-title: Ferrets
-authors:
- - Tobi
- - Loki
- - Jane
----
-Some content here, so
-interesting, you just
-want to keep reading.`)
-
-type article struct {
- Title string
- Authors []string
-}
-
-func Example() {
- var a article
-
- content, err := front.Unmarshal(markdown, &a)
- if err != nil {
- log.Fatalf("error unmarshalling: %s", err)
- }
-
- fmt.Printf("%#v\n", a)
- fmt.Printf("%s\n", string(content))
- // Output:
- // front_test.article{Title:"Ferrets", Authors:[]string{"Tobi", "Loki", "Jane"}}
- //
- // Some content here, so
- // interesting, you just
- // want to keep reading.
-}
diff --git a/cmd/site/internal/hash.go b/cmd/site/internal/hash.go
deleted file mode 100644
index ee333da..0000000
--- a/cmd/site/internal/hash.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package internal
-
-import (
- "crypto/md5"
- "fmt"
-)
-
-// Hash is a simple wrapper around the MD5 algorithm implementation in the
-// Go standard library. It takes in data and a salt and returns the hashed
-// representation.
-func Hash(data string, salt string) string {
- output := md5.Sum([]byte(data + salt))
- return fmt.Sprintf("%x", output)
-}
diff --git a/cmd/site/internal/middleware/metrics.go b/cmd/site/internal/middleware/metrics.go
deleted file mode 100644
index f9d7e0f..0000000
--- a/cmd/site/internal/middleware/metrics.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package middleware
-
-import (
- "net/http"
-
- "github.com/prometheus/client_golang/prometheus"
- "github.com/prometheus/client_golang/prometheus/promhttp"
-)
-
-var (
- requestCounter = prometheus.NewCounterVec(
- prometheus.CounterOpts{
- Name: "handler_requests_total",
- Help: "Total number of request/responses by HTTP status code.",
- }, []string{"handler", "code"})
-
- requestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
- Name: "handler_request_duration",
- Help: "Handler request duration.",
- }, []string{"handler", "method"})
-
- requestInFlight = prometheus.NewGaugeVec(prometheus.GaugeOpts{
- Name: "handler_requests_in_flight",
- Help: "Current number of requests being served.",
- }, []string{"handler"})
-)
-
-func init() {
- _ = prometheus.Register(requestCounter)
- _ = prometheus.Register(requestDuration)
- _ = prometheus.Register(requestInFlight)
-}
-
-// Metrics captures request duration, request count and in-flight request count
-// metrics for HTTP handlers. The family field is used to discriminate handlers.
-func Metrics(family string, next http.Handler) http.Handler {
- return promhttp.InstrumentHandlerDuration(
- requestDuration.MustCurryWith(prometheus.Labels{"handler": family}),
- promhttp.InstrumentHandlerCounter(requestCounter.MustCurryWith(prometheus.Labels{"handler": family}),
- promhttp.InstrumentHandlerInFlight(requestInFlight.With(prometheus.Labels{"handler": family}), next),
- ),
- )
-}
diff --git a/cmd/site/internal/middleware/requestid.go b/cmd/site/internal/middleware/requestid.go
deleted file mode 100644
index 6914137..0000000
--- a/cmd/site/internal/middleware/requestid.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package middleware
-
-import (
- "net/http"
-
- "github.com/celrenheit/sandflake"
- "within.website/ln"
-)
-
-// RequestID appends a unique (sandflake) request ID to each request's
-// X-Request-Id header field, much like Heroku's router does.
-func RequestID(next http.Handler) http.Handler {
- var g sandflake.Generator
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- id := g.Next().String()
-
- if rid := r.Header.Get("X-Request-Id"); rid != "" {
- id = rid + "," + id
- }
-
- ctx := ln.WithF(r.Context(), ln.F{
- "request_id": id,
- })
- r = r.WithContext(ctx)
-
- w.Header().Set("X-Request-Id", id)
- r.Header.Set("X-Request-Id", id)
-
- next.ServeHTTP(w, r)
- })
-}
diff --git a/cmd/site/main.go b/cmd/site/main.go
deleted file mode 100644
index 53f7a8d..0000000
--- a/cmd/site/main.go
+++ /dev/null
@@ -1,296 +0,0 @@
-package main
-
-import (
- "context"
- "html/template"
- "io/ioutil"
- "net/http"
- "os"
- "sort"
- "strings"
- "time"
-
- "christine.website/cmd/site/internal/blog"
- "christine.website/cmd/site/internal/middleware"
- "christine.website/jsonfeed"
- "github.com/gorilla/feeds"
- _ "github.com/joho/godotenv/autoload"
- "github.com/povilasv/prommod"
- "github.com/prometheus/client_golang/prometheus"
- "github.com/prometheus/client_golang/prometheus/promhttp"
- blackfriday "github.com/russross/blackfriday"
- "github.com/sebest/xff"
- "github.com/snabb/sitemap"
- "within.website/ln"
- "within.website/ln/ex"
- "within.website/ln/opname"
-)
-
-var port = os.Getenv("PORT")
-
-func main() {
- if port == "" {
- port = "29384"
- }
-
- ctx := ln.WithF(opname.With(context.Background(), "main"), ln.F{
- "port": port,
- "git_rev": gitRev,
- })
-
- _ = prometheus.Register(prommod.NewCollector("christine"))
-
- s, err := Build()
- if err != nil {
- ln.FatalErr(ctx, err, ln.Action("Build"))
- }
-
- mux := http.NewServeMux()
- mux.HandleFunc("/.within/health", func(w http.ResponseWriter, r *http.Request) {
- http.Error(w, "OK", http.StatusOK)
- })
- mux.Handle("/", s)
-
- ln.Log(ctx, ln.Action("http_listening"))
- ln.FatalErr(ctx, http.ListenAndServe(":"+port, mux))
-}
-
-// Site is the parent object for https://christine.website's backend.
-type Site struct {
- Posts blog.Posts
- Talks blog.Posts
- Gallery blog.Posts
- Resume template.HTML
- Series []string
- SignalBoost []Person
-
- clacks ClackSet
- patrons []string
- rssFeed *feeds.Feed
- jsonFeed *jsonfeed.Feed
-
- mux *http.ServeMux
- xffmw *xff.XFF
-}
-
-var gitRev = os.Getenv("GIT_REV")
-
-func envOr(key, or string) string {
- if result, ok := os.LookupEnv(key); ok {
- return result
- }
-
- return or
-}
-
-func (s *Site) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- ctx := opname.With(r.Context(), "site.ServeHTTP")
- ctx = ln.WithF(ctx, ln.F{
- "user_agent": r.Header.Get("User-Agent"),
- })
- r = r.WithContext(ctx)
- if gitRev != "" {
- w.Header().Add("X-Git-Rev", gitRev)
- }
-
- w.Header().Add("X-Hacker", "If you are reading this, check out /signalboost to find people for your team")
-
- s.clacks.Middleware(
- middleware.RequestID(
- s.xffmw.Handler(
- ex.HTTPLog(s.mux),
- ),
- ),
- ).ServeHTTP(w, r)
-}
-
-var arbDate = time.Date(2020, time.May, 21, 0, 0, 0, 0, time.UTC)
-
-// Build creates a new Site instance or fails.
-func Build() (*Site, error) {
- pc, err := NewPatreonClient()
- if err != nil {
- return nil, err
- }
-
- pledges, err := GetPledges(pc)
- if err != nil {
- return nil, err
- }
-
- people, err := loadPeople("./signalboost.dhall")
- if err != nil {
- return nil, err
- }
-
- smi := sitemap.New()
- smi.Add(&sitemap.URL{
- Loc: "https://christine.website/resume",
- LastMod: &arbDate,
- ChangeFreq: sitemap.Monthly,
- })
-
- smi.Add(&sitemap.URL{
- Loc: "https://christine.website/contact",
- LastMod: &arbDate,
- ChangeFreq: sitemap.Monthly,
- })
-
- smi.Add(&sitemap.URL{
- Loc: "https://christine.website/",
- LastMod: &arbDate,
- ChangeFreq: sitemap.Monthly,
- })
-
- smi.Add(&sitemap.URL{
- Loc: "https://christine.website/patrons",
- LastMod: &arbDate,
- ChangeFreq: sitemap.Weekly,
- })
-
- smi.Add(&sitemap.URL{
- Loc: "https://christine.website/blog",
- LastMod: &arbDate,
- ChangeFreq: sitemap.Weekly,
- })
-
- xffmw, err := xff.Default()
- if err != nil {
- return nil, err
- }
-
- s := &Site{
- rssFeed: &feeds.Feed{
- Title: "Christine Dodrill's Blog",
- Link: &feeds.Link{Href: "https://christine.website/blog"},
- Description: "My blog posts and rants about various technology things.",
- Author: &feeds.Author{Name: "Christine Dodrill", Email: "me@christine.website"},
- Created: bootTime,
- Copyright: "This work is copyright Christine Dodrill. My viewpoints are my own and not the view of any employer past, current or future.",
- },
- jsonFeed: &jsonfeed.Feed{
- Version: jsonfeed.CurrentVersion,
- Title: "Christine Dodrill's Blog",
- HomePageURL: "https://christine.website",
- FeedURL: "https://christine.website/blog.json",
- Description: "My blog posts and rants about various technology things.",
- UserComment: "This is a JSON feed of my blogposts. For more information read: https://jsonfeed.org/version/1",
- Icon: icon,
- Favicon: icon,
- Author: jsonfeed.Author{
- Name: "Christine Dodrill",
- Avatar: icon,
- },
- },
- mux: http.NewServeMux(),
- xffmw: xffmw,
-
- clacks: ClackSet(strings.Split(envOr("CLACK_SET", "Ashlynn"), ",")),
- patrons: pledges,
- SignalBoost: people,
- }
-
- posts, err := blog.LoadPosts("./blog/", "blog")
- if err != nil {
- return nil, err
- }
- s.Posts = posts
- s.Series = posts.Series()
- sort.Strings(s.Series)
-
- talks, err := blog.LoadPosts("./talks", "talks")
- if err != nil {
- return nil, err
- }
- s.Talks = talks
-
- gallery, err := blog.LoadPosts("./gallery", "gallery")
- if err != nil {
- return nil, err
- }
- s.Gallery = gallery
-
- var everything blog.Posts
- everything = append(everything, posts...)
- everything = append(everything, talks...)
- everything = append(everything, gallery...)
-
- sort.Sort(sort.Reverse(everything))
-
- resumeData, err := ioutil.ReadFile("./static/resume/resume.md")
- if err != nil {
- return nil, err
- }
-
- s.Resume = template.HTML(blackfriday.Run(resumeData))
-
- for _, item := range everything {
- s.rssFeed.Items = append(s.rssFeed.Items, &feeds.Item{
- Title: item.Title,
- Link: &feeds.Link{Href: "https://christine.website/" + item.Link},
- Description: item.Summary,
- Created: item.Date,
- Content: string(item.BodyHTML),
- })
-
- s.jsonFeed.Items = append(s.jsonFeed.Items, jsonfeed.Item{
- ID: "https://christine.website/" + item.Link,
- URL: "https://christine.website/" + item.Link,
- Title: item.Title,
- DatePublished: item.Date,
- ContentHTML: string(item.BodyHTML),
- Tags: item.Tags,
- })
-
- smi.Add(&sitemap.URL{
- Loc: "https://christine.website/" + item.Link,
- LastMod: &item.Date,
- ChangeFreq: sitemap.Monthly,
- })
- }
-
- // Add HTTP routes here
- s.mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
- if r.URL.Path != "/" {
- w.WriteHeader(http.StatusNotFound)
- s.renderTemplatePage("error.html", "can't find "+r.URL.Path).ServeHTTP(w, r)
- return
- }
-
- s.renderTemplatePage("index.html", nil).ServeHTTP(w, r)
- })
- s.mux.Handle("/metrics", promhttp.Handler())
- s.mux.Handle("/feeds", middleware.Metrics("feeds", s.renderTemplatePage("feeds.html", nil)))
- s.mux.Handle("/patrons", middleware.Metrics("patrons", s.renderTemplatePage("patrons.html", s.patrons)))
- s.mux.Handle("/signalboost", middleware.Metrics("signalboost", s.renderTemplatePage("signalboost.html", s.SignalBoost)))
- s.mux.Handle("/resume", middleware.Metrics("resume", s.renderTemplatePage("resume.html", s.Resume)))
- s.mux.Handle("/blog", middleware.Metrics("blog", s.renderTemplatePage("blogindex.html", s.Posts)))
- s.mux.Handle("/talks", middleware.Metrics("talks", s.renderTemplatePage("talkindex.html", s.Talks)))
- s.mux.Handle("/gallery", middleware.Metrics("gallery", s.renderTemplatePage("galleryindex.html", s.Gallery)))
- s.mux.Handle("/contact", middleware.Metrics("contact", s.renderTemplatePage("contact.html", nil)))
- s.mux.Handle("/blog.rss", middleware.Metrics("blog.rss", http.HandlerFunc(s.createFeed)))
- s.mux.Handle("/blog.atom", middleware.Metrics("blog.atom", http.HandlerFunc(s.createAtom)))
- s.mux.Handle("/blog.json", middleware.Metrics("blog.json", http.HandlerFunc(s.createJSONFeed)))
- s.mux.Handle("/blog/", middleware.Metrics("blogpost", http.HandlerFunc(s.showPost)))
- s.mux.Handle("/blog/series", http.HandlerFunc(s.listSeries))
- s.mux.Handle("/blog/series/", http.HandlerFunc(s.showSeries))
- s.mux.Handle("/talks/", middleware.Metrics("talks", http.HandlerFunc(s.showTalk)))
- s.mux.Handle("/gallery/", middleware.Metrics("gallery", http.HandlerFunc(s.showGallery)))
- s.mux.Handle("/css/", http.FileServer(http.Dir(".")))
- s.mux.Handle("/static/", http.FileServer(http.Dir(".")))
- s.mux.HandleFunc("/sw.js", func(w http.ResponseWriter, r *http.Request) {
- http.ServeFile(w, r, "./static/js/sw.js")
- })
- s.mux.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) {
- http.ServeFile(w, r, "./static/robots.txt")
- })
- s.mux.Handle("/sitemap.xml", middleware.Metrics("sitemap", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- w.Header().Set("Content-Type", "application/xml")
- _, _ = smi.WriteTo(w)
- })))
- s.mux.HandleFunc("/api/pageview-timer", handlePageViewTimer)
-
- return s, nil
-}
-
-const icon = "https://christine.website/static/img/avatar.png"
diff --git a/cmd/site/pageview.go b/cmd/site/pageview.go
deleted file mode 100644
index 5154659..0000000
--- a/cmd/site/pageview.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package main
-
-import (
- "encoding/json"
- "io/ioutil"
- "net/http"
- "time"
-
- "github.com/prometheus/client_golang/prometheus"
- "within.website/ln"
-)
-
-var (
- readTimes = prometheus.NewHistogramVec(prometheus.HistogramOpts{
- Name: "blogpage_read_times",
- Help: "This tracks how much time people spend reading articles on my blog",
- }, []string{"path"})
-)
-
-func init() {
- _ = prometheus.Register(readTimes)
-}
-
-func handlePageViewTimer(w http.ResponseWriter, r *http.Request) {
- if r.Header.Get("DNT") == "1" {
- http.NotFound(w, r)
- return
- }
-
- data, err := ioutil.ReadAll(r.Body)
- if err != nil {
- ln.Error(r.Context(), err, ln.Info("while reading data"))
- http.Error(w, "oopsie whoopsie uwu", http.StatusInternalServerError)
- return
- }
- r.Body.Close()
-
- type metricsData struct {
- Path string `json:"path"`
- StartTime time.Time `json:"start_time"`
- EndTime time.Time `json:"end_time"`
- }
- var md metricsData
- err = json.Unmarshal(data, &md)
- if err != nil {
- http.NotFound(w, r)
- return
- }
-
- diff := md.EndTime.Sub(md.StartTime).Seconds()
-
- readTimes.WithLabelValues(md.Path).Observe(float64(diff))
-}
diff --git a/cmd/site/patreon.go b/cmd/site/patreon.go
deleted file mode 100644
index c8e7dba..0000000
--- a/cmd/site/patreon.go
+++ /dev/null
@@ -1,112 +0,0 @@
-package main
-
-import (
- "context"
- "fmt"
- "net/http"
- "os"
- "sort"
- "time"
-
- "github.com/mxpv/patreon-go"
- "golang.org/x/oauth2"
- "within.website/ln"
-)
-
-func NewPatreonClient() (*patreon.Client, error) {
- for _, name := range []string{"CLIENT_ID", "CLIENT_SECRET", "ACCESS_TOKEN", "REFRESH_TOKEN"} {
- if os.Getenv("PATREON_"+name) == "" {
- return nil, fmt.Errorf("wanted envvar PATREON_%s", name)
- }
- }
-
- config := oauth2.Config{
- ClientID: os.Getenv("PATREON_CLIENT_ID"),
- ClientSecret: os.Getenv("PATREON_CLIENT_SECRET"),
- Endpoint: oauth2.Endpoint{
- AuthURL: patreon.AuthorizationURL,
- TokenURL: patreon.AccessTokenURL,
- },
- Scopes: []string{"users", "campaigns", "pledges", "pledges-to-me", "my-campaign"},
- }
-
- token := oauth2.Token{
- AccessToken: os.Getenv("PATREON_ACCESS_TOKEN"),
- RefreshToken: os.Getenv("PATREON_REFRESH_TOKEN"),
- // Must be non-nil, otherwise token will not be expired
- Expiry: time.Now().Add(90 * 24 * time.Hour),
- }
-
- tc := config.Client(context.Background(), &token)
-
- trans := tc.Transport
- tc.Transport = lnLoggingTransport{next: trans}
- client := patreon.NewClient(tc)
-
- return client, nil
-}
-
-func GetPledges(pc *patreon.Client) ([]string, error) {
- campaign, err := pc.FetchCampaign()
- if err != nil {
- return nil, fmt.Errorf("campaign fetch error: %w", err)
- }
-
- campaignID := campaign.Data[0].ID
-
- cursor := ""
- var result []string
-
- for {
- pledgesResponse, err := pc.FetchPledges(campaignID, patreon.WithPageSize(25), patreon.WithCursor(cursor))
- if err != nil {
- return nil, err
- }
-
- users := make(map[string]*patreon.User)
- for _, item := range pledgesResponse.Included.Items {
- u, ok := item.(*patreon.User)
- if !ok {
- continue
- }
-
- users[u.ID] = u
- }
-
- for _, pledge := range pledgesResponse.Data {
- pid := pledge.Relationships.Patron.Data.ID
- patronFullName := users[pid].Attributes.FullName
-
- result = append(result, patronFullName)
- }
-
- cursor = pledgesResponse.Links.Next
- if cursor == "" {
- break
- }
- }
-
- sort.Strings(result)
- return result, nil
-}
-
-type lnLoggingTransport struct{ next http.RoundTripper }
-
-func (l lnLoggingTransport) RoundTrip(r *http.Request) (*http.Response, error) {
- ctx := r.Context()
- f := ln.F{
- "url": r.URL.String(),
- "has_token": r.Header.Get("Authorization") != "",
- }
-
- resp, err := l.next.RoundTrip(r)
- if err != nil {
- return nil, err
- }
-
- f["status"] = resp.Status
-
- ln.Log(ctx, f)
-
- return resp, nil
-}
diff --git a/cmd/site/rss.go b/cmd/site/rss.go
deleted file mode 100644
index cd99bde..0000000
--- a/cmd/site/rss.go
+++ /dev/null
@@ -1,91 +0,0 @@
-package main
-
-import (
- "encoding/json"
- "net/http"
- "time"
-
- "christine.website/cmd/site/internal"
- "within.website/ln"
- "within.website/ln/opname"
-)
-
-var bootTime = time.Now()
-var etag = internal.Hash(bootTime.String(), IncrediblySecureSalt)
-
-// IncrediblySecureSalt *******
-const IncrediblySecureSalt = "hunter2"
-
-func (s *Site) createFeed(w http.ResponseWriter, r *http.Request) {
- ctx := opname.With(r.Context(), "rss-feed")
- fetag := "W/" + internal.Hash(bootTime.String(), IncrediblySecureSalt)
- w.Header().Set("ETag", fetag)
-
- if r.Header.Get("If-None-Match") == fetag {
- http.Error(w, "Cached data OK", http.StatusNotModified)
- ln.Log(ctx, ln.Info("cache hit"))
- return
- }
-
- w.Header().Set("Content-Type", "application/rss+xml")
- err := s.rssFeed.WriteRss(w)
- if err != nil {
- http.Error(w, "Internal server error", http.StatusInternalServerError)
- ln.Error(r.Context(), err, ln.F{
- "remote_addr": r.RemoteAddr,
- "action": "generating_rss",
- "uri": r.RequestURI,
- "host": r.Host,
- })
- }
-}
-
-func (s *Site) createAtom(w http.ResponseWriter, r *http.Request) {
- ctx := opname.With(r.Context(), "atom-feed")
- fetag := "W/" + internal.Hash(bootTime.String(), IncrediblySecureSalt)
- w.Header().Set("ETag", fetag)
-
- if r.Header.Get("If-None-Match") == fetag {
- http.Error(w, "Cached data OK", http.StatusNotModified)
- ln.Log(ctx, ln.Info("cache hit"))
- return
- }
-
- w.Header().Set("Content-Type", "application/atom+xml")
- err := s.rssFeed.WriteAtom(w)
- if err != nil {
- http.Error(w, "Internal server error", http.StatusInternalServerError)
- ln.Error(ctx, err, ln.F{
- "remote_addr": r.RemoteAddr,
- "action": "generating_atom",
- "uri": r.RequestURI,
- "host": r.Host,
- })
- }
-}
-
-func (s *Site) createJSONFeed(w http.ResponseWriter, r *http.Request) {
- ctx := opname.With(r.Context(), "atom-feed")
- fetag := "W/" + internal.Hash(bootTime.String(), IncrediblySecureSalt)
- w.Header().Set("ETag", fetag)
-
- if r.Header.Get("If-None-Match") == fetag {
- http.Error(w, "Cached data OK", http.StatusNotModified)
- ln.Log(ctx, ln.Info("cache hit"))
- return
- }
-
- w.Header().Set("Content-Type", "application/json")
- e := json.NewEncoder(w)
- e.SetIndent("", "\t")
- err := e.Encode(s.jsonFeed)
- if err != nil {
- http.Error(w, "Internal server error", http.StatusInternalServerError)
- ln.Error(ctx, err, ln.F{
- "remote_addr": r.RemoteAddr,
- "action": "generating_jsonfeed",
- "uri": r.RequestURI,
- "host": r.Host,
- })
- }
-}
diff --git a/cmd/site/signalboost.go b/cmd/site/signalboost.go
deleted file mode 100644
index c242711..0000000
--- a/cmd/site/signalboost.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package main
-
-import (
- "io/ioutil"
-
- "github.com/philandstuff/dhall-golang"
-)
-
-type Person struct {
- Name string `dhall:"name"`
- GitLink string `dhall:"gitLink"`
- Twitter string `dhall:"twitter"`
- Tags []string `dhall:"tags"`
-}
-
-func loadPeople(path string) ([]Person, error) {
- data, err := ioutil.ReadFile(path)
- if err != nil {
- return nil, err
- }
-
- var people []Person
- err = dhall.Unmarshal(data, &people)
- if err != nil {
- return nil, err
- }
-
- return people, nil
-}
diff --git a/cmd/site/signalboost_test.go b/cmd/site/signalboost_test.go
deleted file mode 100644
index 7f53943..0000000
--- a/cmd/site/signalboost_test.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package main
-
-import "testing"
-
-func TestLoadPeople(t *testing.T) {
- people, err := loadPeople("../../signalboost.dhall")
- if err != nil {t.Fatal(err)}
-
- for _, person := range people {
- t.Run(person.Name, func(t *testing.T) {
- if person.Name == "" {
- t.Error("missing name")
- }
-
- if len(person.Tags) == 0 {
- t.Error("missing tags")
- }
-
- if person.Twitter == "" {
- t.Error("missing twitter")
- }
-
- if person.GitLink == "" {
- t.Error("missing git link")
- }
- })
- }
-}
diff --git a/config.dhall b/config.dhall
new file mode 100644
index 0000000..f461134
--- /dev/null
+++ b/config.dhall
@@ -0,0 +1,27 @@
+let Person =
+ { Type = { name : Text, tags : List Text, gitLink : Text, twitter : Text }
+ , default =
+ { name = "", tags = [] : List Text, gitLink = "", twitter = "" }
+ }
+
+let defaultPort = env:PORT ? 3030
+
+let Config =
+ { Type =
+ { signalboost : List Person.Type
+ , port : Natural
+ , clackSet : List Text
+ , resumeFname : Text
+ }
+ , default =
+ { signalboost = [] : List Person.Type
+ , port = defaultPort
+ , clackSet = [ "Ashlynn" ]
+ , resumeFname = "./static/resume/resume.md"
+ }
+ }
+
+in Config::{
+ , signalboost = ./signalboost.dhall
+ , clackSet = [ "Ashlynn", "Terry Davis", "Dennis Ritchie" ]
+ }
diff --git a/css/shim.css b/css/shim.css
new file mode 100644
index 0000000..6cca7ab
--- /dev/null
+++ b/css/shim.css
@@ -0,0 +1,20 @@
+.main {
+ padding: 20px 10px;
+}
+
+.hack h1 {
+ padding-top: 0;
+}
+
+footer.footer {
+ border-top: 1px solid #ccc;
+ margin-top: 80px;
+ margin-top: 5rem;
+ padding: 48px 0;
+ padding: 3rem 0;
+}
+
+img {
+ max-width: 100%;
+ padding: 1em;
+}
diff --git a/default.nix b/default.nix
index 901845d..866cfe5 100644
--- a/default.nix
+++ b/default.nix
@@ -1,6 +1,23 @@
-{ }:
+{ system ? builtins.currentSystem }:
let
sources = import ./nix/sources.nix;
- pkgs = import sources.nixpkgs { };
-in pkgs.callPackage ./site.nix { inherit pkgs; }
+ pkgs = import sources.nixpkgs { inherit system; };
+ callPackage = pkgs.lib.callPackageWith pkgs;
+ site = callPackage ./site.nix { };
+
+ dockerImage = pkg:
+ pkgs.dockerTools.buildLayeredImage {
+ name = "xena/christinewebsite";
+ tag = "latest";
+
+ contents = [ pkgs.cacert pkg ];
+
+ config = {
+ Cmd = [ "${pkg}/bin/xesite" ];
+ Env = [ "CONFIG_FNAME=${pkg}/config.dhall" "RUST_LOG=info" ];
+ WorkingDir = "/";
+ };
+ };
+
+in dockerImage site
diff --git a/docker.nix b/docker.nix
deleted file mode 100644
index 034f3ff..0000000
--- a/docker.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ system ? builtins.currentSystem }:
-
-let
- pkgs = import (import ./nix/sources.nix).nixpkgs { inherit system; };
- callPackage = pkgs.lib.callPackageWith pkgs;
- site = callPackage ./site.nix { };
-
- dockerImage = pkg:
- pkgs.dockerTools.buildLayeredImage {
- name = "xena/christinewebsite";
- tag = pkg.version;
-
- contents = [ pkg pkgs.cacert ];
-
- config = {
- Cmd = [ "/bin/site" ];
- WorkingDir = "/";
- };
- };
-
-in dockerImage site
diff --git a/go.mod b/go.mod
deleted file mode 100644
index 0f329f2..0000000
--- a/go.mod
+++ /dev/null
@@ -1,21 +0,0 @@
-module christine.website
-
-require (
- github.com/celrenheit/sandflake v0.0.0-20190410195419-50a943690bc2
- github.com/gorilla/feeds v1.1.1
- github.com/joho/godotenv v1.3.0
- github.com/mxpv/patreon-go v0.0.0-20190917022727-646111f1d983
- github.com/philandstuff/dhall-golang v1.0.0
- github.com/povilasv/prommod v0.0.12
- github.com/prometheus/client_golang v1.7.1
- github.com/russross/blackfriday v2.0.0+incompatible
- github.com/sebest/xff v0.0.0-20160910043805-6c115e0ffa35
- github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
- github.com/snabb/sitemap v1.0.0
- github.com/stretchr/testify v1.6.1
- golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
- gopkg.in/yaml.v2 v2.3.0
- within.website/ln v0.9.1
-)
-
-go 1.13
diff --git a/go.sum b/go.sum
deleted file mode 100644
index 1fcb28e..0000000
--- a/go.sum
+++ /dev/null
@@ -1,211 +0,0 @@
-cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
-github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0=
-github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
-github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
-github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
-github.com/celrenheit/sandflake v0.0.0-20190410195419-50a943690bc2 h1:/BpnZPo/sk1vPlt62dLya5KCn7PN9ZBDrpTGlQzgUZI=
-github.com/celrenheit/sandflake v0.0.0-20190410195419-50a943690bc2/go.mod h1:7L8gY0+4GYeBc9TvqVuDUq7tXuM6Sj7llnt7HkVwWlQ=
-github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
-github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
-github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
-github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
-github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
-github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
-github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
-github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
-github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
-github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
-github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
-github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ=
-github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
-github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
-github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
-github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
-github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/gorilla/feeds v1.1.1 h1:HwKXxqzcRNg9to+BbvJog4+f3s/xzvtZXICcQGutYfY=
-github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBbaightA=
-github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
-github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
-github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
-github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
-github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
-github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
-github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
-github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
-github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
-github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
-github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
-github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
-github.com/leanovate/gopter v0.2.5-0.20190402064358-634a59d12406/go.mod h1:gNcbPWNEWRe4lm+bycKqxUYoH5uoVje5SkOJ3uoLer8=
-github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
-github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/mxpv/patreon-go v0.0.0-20190917022727-646111f1d983 h1:r32TFg+FHLnoF8PCqCQNp+R9EjMBuP62FXkD/Eqp9Us=
-github.com/mxpv/patreon-go v0.0.0-20190917022727-646111f1d983/go.mod h1:ksYjm2GAbGlgIP7jO9Q5/AdyE4MwwEbgQ+lFMx3hyiM=
-github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
-github.com/philandstuff/dhall-golang v1.0.0 h1:4iYE+OfVjpXtwB6todsw5w+rnBvAhufgpNzAo9K0ljw=
-github.com/philandstuff/dhall-golang v1.0.0/go.mod h1:nYfzcKjqq6UDCStpXV6UxRwD0HX9IK9z/MuHmHghbEY=
-github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
-github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
-github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/povilasv/prommod v0.0.12 h1:0bk9QJ7kD6SmSsk9MeHhz5Qe6OpQl11Fvo7cvvmNUQM=
-github.com/povilasv/prommod v0.0.12/go.mod h1:GnuK7wLoVBwZXj8bhbJNx/xFSldy7Q49A44RJKNM8XQ=
-github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
-github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM=
-github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
-github.com/prometheus/client_golang v1.4.1 h1:FFSuS004yOQEtDdTq+TAOLP5xUq63KqAFYyOi8zA+Y8=
-github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
-github.com/prometheus/client_golang v1.5.0 h1:Ctq0iGpCmr3jeP77kbF2UxgvRwzWWz+4Bh9/vJTyg1A=
-github.com/prometheus/client_golang v1.5.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
-github.com/prometheus/client_golang v1.5.1 h1:bdHYieyGlH+6OLEk2YQha8THib30KP0/yD0YH9m6xcA=
-github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
-github.com/prometheus/client_golang v1.6.0 h1:YVPodQOcK15POxhgARIvnDRVpLcuK8mglnMrWfyrw6A=
-github.com/prometheus/client_golang v1.6.0/go.mod h1:ZLOG9ck3JLRdB5MgO8f+lLTe83AXG6ro35rLTxvnIl4=
-github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U=
-github.com/prometheus/client_golang v1.7.0/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
-github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA=
-github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
-github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE=
-github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
-github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/common v0.4.1 h1:K0MGApIoQvMw27RTdJkPbr3JZ7DNbtxQNyi5STVM6Kw=
-github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U=
-github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
-github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc=
-github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
-github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs=
-github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
-github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8=
-github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
-github.com/prometheus/procfs v0.0.11 h1:DhHlBtkHWPYi8O2y31JkK0TF+DGM+51OopZjH/Ia5qI=
-github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
-github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
-github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
-github.com/russross/blackfriday v2.0.0+incompatible h1:cBXrhZNUf9C+La9/YpS+UHpUT8YD6Td9ZMSU9APFcsk=
-github.com/russross/blackfriday v2.0.0+incompatible/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
-github.com/sebest/xff v0.0.0-20160910043805-6c115e0ffa35 h1:eajwn6K3weW5cd1ZXLu2sJ4pvwlBiCWY4uDejOr73gM=
-github.com/sebest/xff v0.0.0-20160910043805-6c115e0ffa35/go.mod h1:wozgYq9WEBQBaIJe4YZ0qTSFAMxmcwBhQH0fO0R34Z0=
-github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
-github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
-github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
-github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
-github.com/snabb/diagio v1.0.0 h1:kovhQ1rDXoEbmpf/T5N2sUp2iOdxEg+TcqzbYVHV2V0=
-github.com/snabb/diagio v1.0.0/go.mod h1:ZyGaWFhfBVqstGUw6laYetzeTwZ2xxVPqTALx1QQa1w=
-github.com/snabb/sitemap v1.0.0 h1:7vJeNPAaaj7fQSRS3WYuJHzUjdnhLdSLLpvVtnhbzC0=
-github.com/snabb/sitemap v1.0.0/go.mod h1:Id8uz1+WYdiNmSjEi4BIvL5UwNPYLsTHzRbjmDwNDzA=
-github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
-github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
-github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
-github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
-github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho=
-github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
-github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-github.com/ugorji/go v1.1.5-0.20190603013658-a2c9fa250719 h1:UW5IeyWBDAPQ+Qu1hT/lwtxL7pP3L+ETA8WuBvvvBWU=
-github.com/ugorji/go v1.1.5-0.20190603013658-a2c9fa250719/go.mod h1:RaaajvHwnCbhlqWLTIB78hyPWp24YUXhQ3YXM7Hg7os=
-golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
-golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU=
-golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw=
-golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
-golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
-golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200122134326-e047566fdf82 h1:ywK/j/KkyTHcdyYSZNXGjMwgmDSfjglYZ3vStQ/gSCU=
-golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f h1:gWF768j/LaZugp8dyS4UwsslYCYz9XgFxvlgsn0n9H8=
-golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 h1:ogLJMz+qpzav7lGMh10LMvAkM/fAoGlaiiHYiFYdm80=
-golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
-golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
-google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
-google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
-google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
-google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
-google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
-google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw=
-google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
-google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
-google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
-gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
-gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
-gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
-gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
-gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
-gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
-gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
-gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
-gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-within.website/ln v0.8.0 h1:NX6Eo3LkM9RU8lLRbWpmR5/jQRYKtZ8zuiYi7mmKa6w=
-within.website/ln v0.8.0/go.mod h1:I+Apk8qxMStNXTZdyDMqDqe6CB8Hn6+W/Gyf5QbY+2E=
-within.website/ln v0.9.0 h1:165zpOgw5Rq278x+u2j3o4662BW/pjavL0vsAzyumxk=
-within.website/ln v0.9.0/go.mod h1:I+Apk8qxMStNXTZdyDMqDqe6CB8Hn6+W/Gyf5QbY+2E=
-within.website/ln v0.9.1 h1:Qi8IjeCnU43jXijKtr5qtcbjuiCVAudOIxqTim7svnc=
-within.website/ln v0.9.1/go.mod h1:I+Apk8qxMStNXTZdyDMqDqe6CB8Hn6+W/Gyf5QbY+2E=
diff --git a/jsonfeed/.travis.yml b/jsonfeed/.travis.yml
deleted file mode 100644
index e872c60..0000000
--- a/jsonfeed/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/
-
-language: go
-
-go:
- - 1.8.1
-
-before_install:
- - go get -t -v ./...
-
-script:
- - go test -race -coverprofile=coverage.txt -covermode=atomic
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
diff --git a/jsonfeed/LICENSE b/jsonfeed/LICENSE
deleted file mode 100644
index e87a115..0000000
--- a/jsonfeed/LICENSE
+++ /dev/null
@@ -1,363 +0,0 @@
-Mozilla Public License, version 2.0
-
-1. Definitions
-
-1.1. "Contributor"
-
- means each individual or legal entity that creates, contributes to the
- creation of, or owns Covered Software.
-
-1.2. "Contributor Version"
-
- means the combination of the Contributions of others (if any) used by a
- Contributor and that particular Contributor's Contribution.
-
-1.3. "Contribution"
-
- means Covered Software of a particular Contributor.
-
-1.4. "Covered Software"
-
- means Source Code Form to which the initial Contributor has attached the
- notice in Exhibit A, the Executable Form of such Source Code Form, and
- Modifications of such Source Code Form, in each case including portions
- thereof.
-
-1.5. "Incompatible With Secondary Licenses"
- means
-
- a. that the initial Contributor has attached the notice described in
- Exhibit B to the Covered Software; or
-
- b. that the Covered Software was made available under the terms of
- version 1.1 or earlier of the License, but not also under the terms of
- a Secondary License.
-
-1.6. "Executable Form"
-
- means any form of the work other than Source Code Form.
-
-1.7. "Larger Work"
-
- means a work that combines Covered Software with other material, in a
- separate file or files, that is not Covered Software.
-
-1.8. "License"
-
- means this document.
-
-1.9. "Licensable"
-
- means having the right to grant, to the maximum extent possible, whether
- at the time of the initial grant or subsequently, any and all of the
- rights conveyed by this License.
-
-1.10. "Modifications"
-
- means any of the following:
-
- a. any file in Source Code Form that results from an addition to,
- deletion from, or modification of the contents of Covered Software; or
-
- b. any new file in Source Code Form that contains any Covered Software.
-
-1.11. "Patent Claims" of a Contributor
-
- means any patent claim(s), including without limitation, method,
- process, and apparatus claims, in any patent Licensable by such
- Contributor that would be infringed, but for the grant of the License,
- by the making, using, selling, offering for sale, having made, import,
- or transfer of either its Contributions or its Contributor Version.
-
-1.12. "Secondary License"
-
- means either the GNU General Public License, Version 2.0, the GNU Lesser
- General Public License, Version 2.1, the GNU Affero General Public
- License, Version 3.0, or any later versions of those licenses.
-
-1.13. "Source Code Form"
-
- means the form of the work preferred for making modifications.
-
-1.14. "You" (or "Your")
-
- means an individual or a legal entity exercising rights under this
- License. For legal entities, "You" includes any entity that controls, is
- controlled by, or is under common control with You. For purposes of this
- definition, "control" means (a) the power, direct or indirect, to cause
- the direction or management of such entity, whether by contract or
- otherwise, or (b) ownership of more than fifty percent (50%) of the
- outstanding shares or beneficial ownership of such entity.
-
-
-2. License Grants and Conditions
-
-2.1. Grants
-
- Each Contributor hereby grants You a world-wide, royalty-free,
- non-exclusive license:
-
- a. under intellectual property rights (other than patent or trademark)
- Licensable by such Contributor to use, reproduce, make available,
- modify, display, perform, distribute, and otherwise exploit its
- Contributions, either on an unmodified basis, with Modifications, or
- as part of a Larger Work; and
-
- b. under Patent Claims of such Contributor to make, use, sell, offer for
- sale, have made, import, and otherwise transfer either its
- Contributions or its Contributor Version.
-
-2.2. Effective Date
-
- The licenses granted in Section 2.1 with respect to any Contribution
- become effective for each Contribution on the date the Contributor first
- distributes such Contribution.
-
-2.3. Limitations on Grant Scope
-
- The licenses granted in this Section 2 are the only rights granted under
- this License. No additional rights or licenses will be implied from the
- distribution or licensing of Covered Software under this License.
- Notwithstanding Section 2.1(b) above, no patent license is granted by a
- Contributor:
-
- a. for any code that a Contributor has removed from Covered Software; or
-
- b. for infringements caused by: (i) Your and any other third party's
- modifications of Covered Software, or (ii) the combination of its
- Contributions with other software (except as part of its Contributor
- Version); or
-
- c. under Patent Claims infringed by Covered Software in the absence of
- its Contributions.
-
- This License does not grant any rights in the trademarks, service marks,
- or logos of any Contributor (except as may be necessary to comply with
- the notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
- No Contributor makes additional grants as a result of Your choice to
- distribute the Covered Software under a subsequent version of this
- License (see Section 10.2) or under the terms of a Secondary License (if
- permitted under the terms of Section 3.3).
-
-2.5. Representation
-
- Each Contributor represents that the Contributor believes its
- Contributions are its original creation(s) or it has sufficient rights to
- grant the rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
- This License is not intended to limit any rights You have under
- applicable copyright doctrines of fair use, fair dealing, or other
- equivalents.
-
-2.7. Conditions
-
- Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
- Section 2.1.
-
-
-3. Responsibilities
-
-3.1. Distribution of Source Form
-
- All distribution of Covered Software in Source Code Form, including any
- Modifications that You create or to which You contribute, must be under
- the terms of this License. You must inform recipients that the Source
- Code Form of the Covered Software is governed by the terms of this
- License, and how they can obtain a copy of this License. You may not
- attempt to alter or restrict the recipients' rights in the Source Code
- Form.
-
-3.2. Distribution of Executable Form
-
- If You distribute Covered Software in Executable Form then:
-
- a. such Covered Software must also be made available in Source Code Form,
- as described in Section 3.1, and You must inform recipients of the
- Executable Form how they can obtain a copy of such Source Code Form by
- reasonable means in a timely manner, at a charge no more than the cost
- of distribution to the recipient; and
-
- b. You may distribute such Executable Form under the terms of this
- License, or sublicense it under different terms, provided that the
- license for the Executable Form does not attempt to limit or alter the
- recipients' rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
- You may create and distribute a Larger Work under terms of Your choice,
- provided that You also comply with the requirements of this License for
- the Covered Software. If the Larger Work is a combination of Covered
- Software with a work governed by one or more Secondary Licenses, and the
- Covered Software is not Incompatible With Secondary Licenses, this
- License permits You to additionally distribute such Covered Software
- under the terms of such Secondary License(s), so that the recipient of
- the Larger Work may, at their option, further distribute the Covered
- Software under the terms of either this License or such Secondary
- License(s).
-
-3.4. Notices
-
- You may not remove or alter the substance of any license notices
- (including copyright notices, patent notices, disclaimers of warranty, or
- limitations of liability) contained within the Source Code Form of the
- Covered Software, except that You may alter any license notices to the
- extent required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
- You may choose to offer, and to charge a fee for, warranty, support,
- indemnity or liability obligations to one or more recipients of Covered
- Software. However, You may do so only on Your own behalf, and not on
- behalf of any Contributor. You must make it absolutely clear that any
- such warranty, support, indemnity, or liability obligation is offered by
- You alone, and You hereby agree to indemnify every Contributor for any
- liability incurred by such Contributor as a result of warranty, support,
- indemnity or liability terms You offer. You may include additional
- disclaimers of warranty and limitations of liability specific to any
- jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
-
- If it is impossible for You to comply with any of the terms of this License
- with respect to some or all of the Covered Software due to statute,
- judicial order, or regulation then You must: (a) comply with the terms of
- this License to the maximum extent possible; and (b) describe the
- limitations and the code they affect. Such description must be placed in a
- text file included with all distributions of the Covered Software under
- this License. Except to the extent prohibited by statute or regulation,
- such description must be sufficiently detailed for a recipient of ordinary
- skill to be able to understand it.
-
-5. Termination
-
-5.1. The rights granted under this License will terminate automatically if You
- fail to comply with any of its terms. However, if You become compliant,
- then the rights granted under this License from a particular Contributor
- are reinstated (a) provisionally, unless and until such Contributor
- explicitly and finally terminates Your grants, and (b) on an ongoing
- basis, if such Contributor fails to notify You of the non-compliance by
- some reasonable means prior to 60 days after You have come back into
- compliance. Moreover, Your grants from a particular Contributor are
- reinstated on an ongoing basis if such Contributor notifies You of the
- non-compliance by some reasonable means, this is the first time You have
- received notice of non-compliance with this License from such
- Contributor, and You become compliant prior to 30 days after Your receipt
- of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
- infringement claim (excluding declaratory judgment actions,
- counter-claims, and cross-claims) alleging that a Contributor Version
- directly or indirectly infringes any patent, then the rights granted to
- You by any and all Contributors for the Covered Software under Section
- 2.1 of this License shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
- license agreements (excluding distributors and resellers) which have been
- validly granted by You or Your distributors under this License prior to
- termination shall survive termination.
-
-6. Disclaimer of Warranty
-
- Covered Software is provided under this License on an "as is" basis,
- without warranty of any kind, either expressed, implied, or statutory,
- including, without limitation, warranties that the Covered Software is free
- of defects, merchantable, fit for a particular purpose or non-infringing.
- The entire risk as to the quality and performance of the Covered Software
- is with You. Should any Covered Software prove defective in any respect,
- You (not any Contributor) assume the cost of any necessary servicing,
- repair, or correction. This disclaimer of warranty constitutes an essential
- part of this License. No use of any Covered Software is authorized under
- this License except under this disclaimer.
-
-7. Limitation of Liability
-
- Under no circumstances and under no legal theory, whether tort (including
- negligence), contract, or otherwise, shall any Contributor, or anyone who
- distributes Covered Software as permitted above, be liable to You for any
- direct, indirect, special, incidental, or consequential damages of any
- character including, without limitation, damages for lost profits, loss of
- goodwill, work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses, even if such party shall have been
- informed of the possibility of such damages. This limitation of liability
- shall not apply to liability for death or personal injury resulting from
- such party's negligence to the extent applicable law prohibits such
- limitation. Some jurisdictions do not allow the exclusion or limitation of
- incidental or consequential damages, so this exclusion and limitation may
- not apply to You.
-
-8. Litigation
-
- Any litigation relating to this License may be brought only in the courts
- of a jurisdiction where the defendant maintains its principal place of
- business and such litigation shall be governed by laws of that
- jurisdiction, without reference to its conflict-of-law provisions. Nothing
- in this Section shall prevent a party's ability to bring cross-claims or
- counter-claims.
-
-9. Miscellaneous
-
- This License represents the complete agreement concerning the subject
- matter hereof. If any provision of this License is held to be
- unenforceable, such provision shall be reformed only to the extent
- necessary to make it enforceable. Any law or regulation which provides that
- the language of a contract shall be construed against the drafter shall not
- be used to construe this License against a Contributor.
-
-
-10. Versions of the License
-
-10.1. New Versions
-
- Mozilla Foundation is the license steward. Except as provided in Section
- 10.3, no one other than the license steward has the right to modify or
- publish new versions of this License. Each version will be given a
- distinguishing version number.
-
-10.2. Effect of New Versions
-
- You may distribute the Covered Software under the terms of the version
- of the License under which You originally received the Covered Software,
- or under the terms of any subsequent version published by the license
- steward.
-
-10.3. Modified Versions
-
- If you create software not governed by this License, and you want to
- create a new license for such software, you may create and use a
- modified version of this License if you rename the license and remove
- any references to the name of the license steward (except to note that
- such modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary
- Licenses If You choose to distribute Source Code Form that is
- Incompatible With Secondary Licenses under the terms of this version of
- the License, the notice described in Exhibit B of this License must be
- attached.
-
-Exhibit A - Source Code Form License Notice
-
- This Source Code Form is subject to the
- terms of the Mozilla Public License, v.
- 2.0. If a copy of the MPL was not
- distributed with this file, You can
- obtain one at
- http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular file,
-then You may include the notice in a location (such as a LICENSE file in a
-relevant directory) where a recipient would be likely to look for such a
-notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - "Incompatible With Secondary Licenses" Notice
-
- This Source Code Form is "Incompatible
- With Secondary Licenses", as defined by
- the Mozilla Public License, v. 2.0.
-
diff --git a/jsonfeed/README.md b/jsonfeed/README.md
deleted file mode 100644
index 27f7cb5..0000000
--- a/jsonfeed/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# JSONFeed - Go Package to parse JSON Feed streams
-
-[![Build Status](https://travis-ci.org/st3fan/jsonfeed.svg?branch=master)](https://travis-ci.org/st3fan/jsonfeed) [![Go Report Card](https://goreportcard.com/badge/github.com/st3fan/jsonfeed)](https://goreportcard.com/report/github.com/st3fan/jsonfeed) [![codecov](https://codecov.io/gh/st3fan/jsonfeed/branch/master/graph/badge.svg)](https://codecov.io/gh/st3fan/jsonfeed)
-
-
-*Stefan Arentz, May 2017*
-
-Work in progress. Minimal package to parse JSON Feed streams. Please file feature requests.
diff --git a/jsonfeed/jsonfeed.go b/jsonfeed/jsonfeed.go
deleted file mode 100644
index 913880d..0000000
--- a/jsonfeed/jsonfeed.go
+++ /dev/null
@@ -1,73 +0,0 @@
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/
-
-package jsonfeed
-
-import (
- "encoding/json"
- "io"
- "time"
-)
-
-const CurrentVersion = "https://jsonfeed.org/version/1"
-
-type Item struct {
- ID string `json:"id"`
- URL string `json:"url"`
- ExternalURL string `json:"external_url"`
- Title string `json:"title"`
- ContentHTML string `json:"content_html"`
- ContentText string `json:"content_text"`
- Summary string `json:"summary"`
- Image string `json:"image"`
- BannerImage string `json:"banner_image"`
- DatePublished time.Time `json:"date_published"`
- DateModified time.Time `json:"date_modified"`
- Author Author `json:"author"`
- Tags []string `json:"tags"`
-}
-
-type Author struct {
- Name string `json:"name"`
- URL string `json:"url"`
- Avatar string `json:"avatar"`
-}
-
-type Hub struct {
- Type string `json:"type"`
- URL string `json:"url"`
-}
-
-type Attachment struct {
- URL string `json:"url"`
- MIMEType string `json:"mime_type"`
- Title string `json:"title"`
- SizeInBytes int64 `json:"size_in_bytes"`
- DurationInSeconds int64 `json:"duration_in_seconds"`
-}
-
-type Feed struct {
- Version string `json:"version"`
- Title string `json:"title"`
- HomePageURL string `json:"home_page_url"`
- FeedURL string `json:"feed_url"`
- Description string `json:"description"`
- UserComment string `json:"user_comment"`
- NextURL string `json:"next_url"`
- Icon string `json:"icon"`
- Favicon string `json:"favicon"`
- Author Author `json:"author"`
- Expired bool `json:"expired"`
- Hubs []Hub `json:"hubs"`
- Items []Item `json:"items"`
-}
-
-func Parse(r io.Reader) (Feed, error) {
- var feed Feed
- decoder := json.NewDecoder(r)
- if err := decoder.Decode(&feed); err != nil {
- return Feed{}, err
- }
- return feed, nil
-}
diff --git a/jsonfeed/jsonfeed_test.go b/jsonfeed/jsonfeed_test.go
deleted file mode 100644
index d345f38..0000000
--- a/jsonfeed/jsonfeed_test.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/
-
-package jsonfeed
-
-import (
- "os"
- "testing"
- "time"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestParseSimple(t *testing.T) {
- r, err := os.Open("testdata/feed.json")
- assert.NoError(t, err, "Could not open testdata/feed.json")
-
- feed, err := Parse(r)
- assert.NoError(t, err, "Could not parse testdata/feed.json")
-
- assert.Equal(t, "https://jsonfeed.org/version/1", feed.Version)
- assert.Equal(t, "JSON Feed", feed.Title)
- assert.Equal(t, "JSON Feed is a ...", feed.Description)
- assert.Equal(t, "https://jsonfeed.org/", feed.HomePageURL)
- assert.Equal(t, "https://jsonfeed.org/feed.json", feed.FeedURL)
- assert.Equal(t, "This feed allows ...", feed.UserComment)
- assert.Equal(t, "https://jsonfeed.org/graphics/icon.png", feed.Favicon)
- assert.Equal(t, "Brent Simmons and Manton Reece", feed.Author.Name)
-
- assert.Equal(t, 1, len(feed.Items))
-
- assert.Equal(t, "https://jsonfeed.org/2017/05/17/announcing_json_feed", feed.Items[0].ID)
- assert.Equal(t, "https://jsonfeed.org/2017/05/17/announcing_json_feed", feed.Items[0].URL)
- assert.Equal(t, "Announcing JSON Feed", feed.Items[0].Title)
- assert.Equal(t, "
We ...",
- "date_published": "2017-05-17T08:02:12-07:00"
- }
- ]
-}
diff --git a/lib/go_vanity/Cargo.toml b/lib/go_vanity/Cargo.toml
new file mode 100644
index 0000000..ae10f24
--- /dev/null
+++ b/lib/go_vanity/Cargo.toml
@@ -0,0 +1,15 @@
+[package]
+name = "go_vanity"
+version = "0.1.0"
+authors = ["Christine Dodrill "]
+edition = "2018"
+build = "src/build.rs"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+mime = "0.3.0"
+warp = "0.2"
+
+[build-dependencies]
+ructe = { version = "0.11", features = ["warp02"] }
diff --git a/lib/go_vanity/src/build.rs b/lib/go_vanity/src/build.rs
new file mode 100644
index 0000000..f36737c
--- /dev/null
+++ b/lib/go_vanity/src/build.rs
@@ -0,0 +1,5 @@
+use ructe::{Result, Ructe};
+
+fn main() -> Result<()> {
+ Ructe::from_env()?.compile_templates("templates")
+}
diff --git a/lib/go_vanity/src/lib.rs b/lib/go_vanity/src/lib.rs
new file mode 100644
index 0000000..e4a11e2
--- /dev/null
+++ b/lib/go_vanity/src/lib.rs
@@ -0,0 +1,12 @@
+use warp::{http::Response, Rejection, Reply};
+use crate::templates::{RenderRucte};
+
+include!(concat!(env!("OUT_DIR"), "/templates.rs"));
+
+pub async fn gitea(pkg_name: &str, git_repo: &str) -> Result {
+ Response::builder().html(|o| templates::gitea_html(o, pkg_name, git_repo))
+}
+
+pub async fn github(pkg_name: &str, git_repo: &str) -> Result {
+ Response::builder().html(|o| templates::github_html(o, pkg_name, git_repo))
+}
diff --git a/lib/go_vanity/templates/gitea.rs.html b/lib/go_vanity/templates/gitea.rs.html
new file mode 100644
index 0000000..b20985b
--- /dev/null
+++ b/lib/go_vanity/templates/gitea.rs.html
@@ -0,0 +1,14 @@
+@(pkg_name: &str, git_repo: &str)
+
+
+
+
+
+
+
+
+
+
+ Please see here for documentation on this package.
+
+
diff --git a/lib/go_vanity/templates/github.rs.html b/lib/go_vanity/templates/github.rs.html
new file mode 100644
index 0000000..61f42e5
--- /dev/null
+++ b/lib/go_vanity/templates/github.rs.html
@@ -0,0 +1,14 @@
+@(pkg_name: &str, git_repo: &str)
+
+
+
+
+
+
+
+
+
+
+ Please see here for documentation on this package.
+
+
diff --git a/lib/jsonfeed/.gitignore b/lib/jsonfeed/.gitignore
new file mode 100644
index 0000000..f382b9f
--- /dev/null
+++ b/lib/jsonfeed/.gitignore
@@ -0,0 +1,4 @@
+target/
+**/*.rs.bk
+Cargo.lock
+*.html
diff --git a/lib/jsonfeed/Cargo.toml b/lib/jsonfeed/Cargo.toml
new file mode 100644
index 0000000..e85ee46
--- /dev/null
+++ b/lib/jsonfeed/Cargo.toml
@@ -0,0 +1,15 @@
+[package]
+authors = ["Paul Woolcock ", "Christine Dodrill "]
+description = "Parser for the JSONFeed (http://jsonfeed.org) specification\n"
+documentation = "https://docs.rs/jsonfeed"
+homepage = "https://github.com/pwoolcoc/jsonfeed"
+license = "MIT/Apache-2.0"
+name = "jsonfeed"
+readme = "README.adoc"
+version = "0.3.0"
+
+[dependencies]
+error-chain = "0.12"
+serde = "1"
+serde_derive = "1"
+serde_json = "1"
diff --git a/lib/jsonfeed/LICENSE-APACHE b/lib/jsonfeed/LICENSE-APACHE
new file mode 100644
index 0000000..16fe87b
--- /dev/null
+++ b/lib/jsonfeed/LICENSE-APACHE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/lib/jsonfeed/LICENSE-MIT b/lib/jsonfeed/LICENSE-MIT
new file mode 100644
index 0000000..39d4bdb
--- /dev/null
+++ b/lib/jsonfeed/LICENSE-MIT
@@ -0,0 +1,25 @@
+Copyright (c) 2014 The Rust Project Developers
+
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/lib/jsonfeed/README.adoc b/lib/jsonfeed/README.adoc
new file mode 100644
index 0000000..581bf3d
--- /dev/null
+++ b/lib/jsonfeed/README.adoc
@@ -0,0 +1,27 @@
+= JSON Feed Parser
+
+[link=https://github.com/pwoolcoc/jsonfeed]
+image::https://img.shields.io/crates/v/jsonfeed.svg[JSON Feed crate version]
+
+This is a http://jsonfeed.org[JSON Feed] parser in Rust. Just a thin layer on top of `serde`, but it
+provides serialization & deserialization, along with a Builder API for constructing feeds.
+
+Note that this is alpha, I still need to add a lot of tests and a couple more features.
+
+== Example
+
+----
+extern crate jsonfeed;
+extern crate reqwest;
+
+fn main() {
+ let resp = reqwest::get("https://example.com/feed.json").unwrap();
+ let feed = jsonfeed::from_reader(resp).unwrap();
+ println!("Feed title is: {}", feed.title);
+}
+----
+
+TODO:
+
+* Tests. Lots and lots of tests
+* Implement ability to add, serialize, and deserialize custom attributes from the json feed spec
diff --git a/lib/jsonfeed/src/builder.rs b/lib/jsonfeed/src/builder.rs
new file mode 100644
index 0000000..f17740f
--- /dev/null
+++ b/lib/jsonfeed/src/builder.rs
@@ -0,0 +1,204 @@
+use std::default::Default;
+
+use errors::*;
+use feed::{Feed, Author, Attachment};
+use item::{Content, Item};
+
+/// Feed Builder
+///
+/// This is used to programmatically build up a Feed object,
+/// which can be serialized later into a JSON string
+pub struct Builder(Feed);
+
+impl Builder {
+ pub fn new() -> Builder {
+ Builder(Feed::default())
+ }
+
+ pub fn title>(mut self, t: I) -> Builder {
+ self.0.title = t.into();
+ self
+ }
+
+ pub fn home_page_url>(mut self, url: I) -> Builder {
+ self.0.home_page_url = Some(url.into());
+ self
+ }
+
+ pub fn feed_url>(mut self, url: I) -> Builder {
+ self.0.feed_url = Some(url.into());
+ self
+ }
+
+ pub fn description>(mut self, desc: I) -> Builder {
+ self.0.description = Some(desc.into());
+ self
+ }
+
+ pub fn user_comment>(mut self, cmt: I) -> Builder {
+ self.0.user_comment = Some(cmt.into());
+ self
+ }
+
+ pub fn next_url>(mut self, url: I) -> Builder {
+ self.0.next_url = Some(url.into());
+ self
+ }
+
+ pub fn icon>(mut self, url: I) -> Builder {
+ self.0.icon = Some(url.into());
+ self
+ }
+
+ pub fn favicon>(mut self, url: I) -> Builder {
+ self.0.favicon = Some(url.into());
+ self
+ }
+
+ pub fn author(mut self, author: Author) -> Builder {
+ self.0.author = Some(author);
+ self
+ }
+
+ pub fn expired(mut self) -> Builder {
+ self.0.expired = Some(true);
+ self
+ }
+
+ pub fn item(mut self, item: Item) -> Builder {
+ self.0.items.push(item);
+ self
+ }
+
+ pub fn build(self) -> Feed {
+ self.0
+ }
+}
+
+/// Builder object for an item in a feed
+pub struct ItemBuilder {
+ pub id: Option,
+ pub url: Option,
+ pub external_url: Option,
+ pub title: Option,
+ pub content: Option,
+ pub summary: Option,
+ pub image: Option,
+ pub banner_image: Option,
+ pub date_published: Option,
+ pub date_modified: Option,
+ pub author: Option,
+ pub tags: Option>,
+ pub attachments: Option>,
+}
+
+impl ItemBuilder {
+ pub fn new() -> ItemBuilder {
+ ItemBuilder {
+ id: None,
+ url: None,
+ external_url: None,
+ title: None,
+ content: None,
+ summary: None,
+ image: None,
+ banner_image: None,
+ date_published: None,
+ date_modified: None,
+ author: None,
+ tags: None,
+ attachments: None,
+ }
+ }
+
+ pub fn title>(mut self, i: I) -> ItemBuilder {
+ self.title = Some(i.into());
+ self
+ }
+
+ pub fn image>(mut self, i: I) -> ItemBuilder {
+ self.image = Some(i.into());
+ self
+ }
+
+ pub fn id>(mut self, i: I) -> ItemBuilder {
+ self.id = Some(i.into());
+ self
+ }
+
+ pub fn url>(mut self, i: I) -> ItemBuilder {
+ self.url = Some(i.into());
+ self
+ }
+
+ pub fn external_url>(mut self, i: I) -> ItemBuilder {
+ self.external_url = Some(i.into());
+ self
+ }
+
+ pub fn date_modified>(mut self, i: I) -> ItemBuilder {
+ self.date_modified = Some(i.into());
+ self
+ }
+
+ pub fn date_published>(mut self, i: I) -> ItemBuilder {
+ self.date_published = Some(i.into());
+ self
+ }
+
+ pub fn tags(mut self, tags: Vec) -> ItemBuilder {
+ self.tags = Some(tags);
+ self
+ }
+
+ pub fn author(mut self, who: Author) -> ItemBuilder {
+ self.author = Some(who);
+ self
+ }
+
+ pub fn content_html>(mut self, i: I) -> ItemBuilder {
+ match self.content {
+ Some(Content::Text(t)) => {
+ self.content = Some(Content::Both(i.into(), t));
+ },
+ _ => {
+ self.content = Some(Content::Html(i.into()));
+ }
+ }
+ self
+ }
+
+ pub fn content_text>(mut self, i: I) -> ItemBuilder {
+ match self.content {
+ Some(Content::Html(s)) => {
+ self.content = Some(Content::Both(s, i.into()));
+ },
+ _ => {
+ self.content = Some(Content::Text(i.into()));
+ },
+ }
+ self
+ }
+
+ pub fn build(self) -> Result {
+ if self.id.is_none() || self.content.is_none() {
+ return Err("missing field 'id' or 'content_*'".into());
+ }
+ Ok(Item {
+ id: self.id.unwrap(),
+ url: self.url,
+ external_url: self.external_url,
+ title: self.title,
+ content: self.content.unwrap(),
+ summary: self.summary,
+ image: self.image,
+ banner_image: self.banner_image,
+ date_published: self.date_published,
+ date_modified: self.date_modified,
+ author: self.author,
+ tags: self.tags,
+ attachments: self.attachments
+ })
+ }
+}
+
diff --git a/lib/jsonfeed/src/errors.rs b/lib/jsonfeed/src/errors.rs
new file mode 100644
index 0000000..936b7ec
--- /dev/null
+++ b/lib/jsonfeed/src/errors.rs
@@ -0,0 +1,7 @@
+use serde_json;
+error_chain!{
+ foreign_links {
+ Serde(serde_json::Error);
+ }
+}
+
diff --git a/lib/jsonfeed/src/feed.rs b/lib/jsonfeed/src/feed.rs
new file mode 100644
index 0000000..8b5b5ce
--- /dev/null
+++ b/lib/jsonfeed/src/feed.rs
@@ -0,0 +1,296 @@
+use std::default::Default;
+
+use item::Item;
+use builder::Builder;
+
+const VERSION_1: &'static str = "https://jsonfeed.org/version/1";
+
+/// Represents a single feed
+///
+/// # Examples
+///
+/// ```rust
+/// // Serialize a feed object to a JSON string
+///
+/// # extern crate jsonfeed;
+/// # use std::default::Default;
+/// # use jsonfeed::Feed;
+/// # fn main() {
+/// let feed: Feed = Feed::default();
+/// assert_eq!(
+/// jsonfeed::to_string(&feed).unwrap(),
+/// "{\"version\":\"https://jsonfeed.org/version/1\",\"title\":\"\",\"items\":[]}"
+/// );
+/// # }
+/// ```
+///
+/// ```rust
+/// // Deserialize a feed objects from a JSON String
+///
+/// # extern crate jsonfeed;
+/// # use jsonfeed::Feed;
+/// # fn main() {
+/// let json = "{\"version\":\"https://jsonfeed.org/version/1\",\"title\":\"\",\"items\":[]}";
+/// let feed: Feed = jsonfeed::from_str(&json).unwrap();
+/// assert_eq!(
+/// feed,
+/// Feed::default()
+/// );
+/// # }
+/// ```
+#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
+pub struct Feed {
+ pub version: String,
+ pub title: String,
+ pub items: Vec,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub home_page_url: Option,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub feed_url: Option,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub description: Option,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub user_comment: Option,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub next_url: Option,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub icon: Option,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub favicon: Option,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub author: Option,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub expired: Option,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub hubs: Option>,
+}
+
+impl Feed {
+ /// Used to construct a Feed object
+ pub fn builder() -> Builder {
+ Builder::new()
+ }
+}
+
+impl Default for Feed {
+ fn default() -> Feed {
+ Feed {
+ version: VERSION_1.to_string(),
+ title: "".to_string(),
+ items: vec![],
+ home_page_url: None,
+ feed_url: None,
+ description: None,
+ user_comment: None,
+ next_url: None,
+ icon: None,
+ favicon: None,
+ author: None,
+ expired: None,
+ hubs: None,
+ }
+ }
+}
+
+/// Represents an `attachment` for an item
+#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
+pub struct Attachment {
+ url: String,
+ mime_type: String,
+ title: Option,
+ size_in_bytes: Option,
+ duration_in_seconds: Option,
+}
+
+/// Represents an `author` in both a feed and a feed item
+#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
+pub struct Author {
+ name: Option,
+ url: Option,
+ avatar: Option,
+}
+
+impl Author {
+ pub fn new() -> Author {
+ Author {
+ name: None,
+ url: None,
+ avatar: None,
+ }
+ }
+
+ pub fn name>(mut self, name: I) -> Self {
+ self.name = Some(name.into());
+ self
+ }
+
+ pub fn url>(mut self, url: I) -> Self {
+ self.url = Some(url.into());
+ self
+ }
+
+ pub fn avatar>(mut self, avatar: I) -> Self {
+ self.avatar = Some(avatar.into());
+ self
+ }
+}
+
+/// Represents a `hub` for a feed
+#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
+pub struct Hub {
+ #[serde(rename = "type")]
+ type_: String,
+ url: String,
+}
+
+#[cfg(test)]
+mod tests {
+ use serde_json;
+ use std::default::Default;
+ use super::*;
+
+ #[test]
+ fn serialize_feed() {
+ let feed = Feed {
+ version: "https://jsonfeed.org/version/1".to_string(),
+ title: "some title".to_string(),
+ items: vec![],
+ home_page_url: None,
+ description: None,
+ expired: Some(true),
+ ..Default::default()
+ };
+ assert_eq!(
+ serde_json::to_string(&feed).unwrap(),
+ r#"{"version":"https://jsonfeed.org/version/1","title":"some title","items":[],"expired":true}"#
+ );
+ }
+
+ #[test]
+ fn deserialize_feed() {
+ let json = r#"{"version":"https://jsonfeed.org/version/1","title":"some title","items":[]}"#;
+ let feed: Feed = serde_json::from_str(&json).unwrap();
+ let expected = Feed {
+ version: "https://jsonfeed.org/version/1".to_string(),
+ title: "some title".to_string(),
+ items: vec![],
+ ..Default::default()
+ };
+ assert_eq!(
+ feed,
+ expected
+ );
+ }
+
+ #[test]
+ fn serialize_attachment() {
+ let attachment = Attachment {
+ url: "http://example.com".to_string(),
+ mime_type: "application/json".to_string(),
+ title: Some("some title".to_string()),
+ size_in_bytes: Some(1),
+ duration_in_seconds: Some(1),
+ };
+ assert_eq!(
+ serde_json::to_string(&attachment).unwrap(),
+ r#"{"url":"http://example.com","mime_type":"application/json","title":"some title","size_in_bytes":1,"duration_in_seconds":1}"#
+ );
+ }
+
+ #[test]
+ fn deserialize_attachment() {
+ let json = r#"{"url":"http://example.com","mime_type":"application/json","title":"some title","size_in_bytes":1,"duration_in_seconds":1}"#;
+ let attachment: Attachment = serde_json::from_str(&json).unwrap();
+ let expected = Attachment {
+ url: "http://example.com".to_string(),
+ mime_type: "application/json".to_string(),
+ title: Some("some title".to_string()),
+ size_in_bytes: Some(1),
+ duration_in_seconds: Some(1),
+ };
+ assert_eq!(
+ attachment,
+ expected
+ );
+ }
+
+ #[test]
+ fn serialize_author() {
+ let author = Author {
+ name: Some("bob jones".to_string()),
+ url: Some("http://example.com".to_string()),
+ avatar: Some("http://img.com/blah".to_string()),
+ };
+ assert_eq!(
+ serde_json::to_string(&author).unwrap(),
+ r#"{"name":"bob jones","url":"http://example.com","avatar":"http://img.com/blah"}"#
+ );
+ }
+
+ #[test]
+ fn deserialize_author() {
+ let json = r#"{"name":"bob jones","url":"http://example.com","avatar":"http://img.com/blah"}"#;
+ let author: Author = serde_json::from_str(&json).unwrap();
+ let expected = Author {
+ name: Some("bob jones".to_string()),
+ url: Some("http://example.com".to_string()),
+ avatar: Some("http://img.com/blah".to_string()),
+ };
+ assert_eq!(
+ author,
+ expected
+ );
+ }
+
+ #[test]
+ fn serialize_hub() {
+ let hub = Hub {
+ type_: "some-type".to_string(),
+ url: "http://example.com".to_string(),
+ };
+ assert_eq!(
+ serde_json::to_string(&hub).unwrap(),
+ r#"{"type":"some-type","url":"http://example.com"}"#
+ )
+ }
+
+ #[test]
+ fn deserialize_hub() {
+ let json = r#"{"type":"some-type","url":"http://example.com"}"#;
+ let hub: Hub = serde_json::from_str(&json).unwrap();
+ let expected = Hub {
+ type_: "some-type".to_string(),
+ url: "http://example.com".to_string(),
+ };
+ assert_eq!(
+ hub,
+ expected
+ );
+ }
+
+ #[test]
+ fn deser_podcast() {
+ let json = r#"{
+ "version": "https://jsonfeed.org/version/1",
+ "title": "Timetable",
+ "home_page_url": "http://timetable.manton.org/",
+ "items": [
+ {
+ "id": "http://timetable.manton.org/2017/04/episode-45-launch-week/",
+ "url": "http://timetable.manton.org/2017/04/episode-45-launch-week/",
+ "title": "Episode 45: Launch week",
+ "content_html": "I’m rolling out early access to Micro.blog this week. I talk about how the first 2 days have gone, mistakes with TestFlight, and what to do next.",
+ "date_published": "2017-04-26T01:09:45+00:00",
+ "attachments": [
+ {
+ "url": "http://timetable.manton.org/podcast-download/139/episode-45-launch-week.mp3",
+ "mime_type": "audio/mpeg",
+ "size_in_bytes": 5236920
+ }
+ ]
+ }
+ ]
+}"#;
+ serde_json::from_str::(&json).expect("Failed to deserialize podcast feed");
+ }
+}
diff --git a/lib/jsonfeed/src/item.rs b/lib/jsonfeed/src/item.rs
new file mode 100644
index 0000000..605525b
--- /dev/null
+++ b/lib/jsonfeed/src/item.rs
@@ -0,0 +1,493 @@
+use std::fmt;
+use std::default::Default;
+
+use feed::{Author, Attachment};
+use builder::ItemBuilder;
+
+use serde::ser::{Serialize, Serializer, SerializeStruct};
+use serde::de::{self, Deserialize, Deserializer, Visitor, MapAccess};
+
+/// Represents the `content_html` and `content_text` attributes of an item
+#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
+pub enum Content {
+ Html(String),
+ Text(String),
+ Both(String, String),
+}
+
+/// Represents an item in a feed
+#[derive(Debug, Clone, PartialEq)]
+pub struct Item {
+ pub id: String,
+ pub url: Option,
+ pub external_url: Option,
+ pub title: Option,
+ pub content: Content,
+ pub summary: Option,
+ pub image: Option,
+ pub banner_image: Option,
+ pub date_published: Option, // todo DateTime objects?
+ pub date_modified: Option,
+ pub author: Option,
+ pub tags: Option>,
+ pub attachments: Option>,
+}
+
+impl Item {
+ pub fn builder() -> ItemBuilder {
+ ItemBuilder::new()
+ }
+}
+
+impl Default for Item {
+ fn default() -> Item {
+ Item {
+ id: "".to_string(),
+ url: None,
+ external_url: None,
+ title: None,
+ content: Content::Text("".into()),
+ summary: None,
+ image: None,
+ banner_image: None,
+ date_published: None,
+ date_modified: None,
+ author: None,
+ tags: None,
+ attachments: None,
+ }
+ }
+}
+
+impl Serialize for Item {
+ fn serialize(&self, serializer: S) -> Result
+ where S: Serializer
+ {
+ let mut state = serializer.serialize_struct("Item", 14)?;
+ state.serialize_field("id", &self.id)?;
+ if self.url.is_some() {
+ state.serialize_field("url", &self.url)?;
+ }
+ if self.external_url.is_some() {
+ state.serialize_field("external_url", &self.external_url)?;
+ }
+ if self.title.is_some() {
+ state.serialize_field("title", &self.title)?;
+ }
+ match self.content {
+ Content::Html(ref s) => {
+ state.serialize_field("content_html", s)?;
+ state.serialize_field("content_text", &None::
This article was posted on @post.detri(). Facts and circumstances may have changed since publication. Please contact me before jumping to conclusions if something seems wrong or unclear.
Tags: @for tag in post.front_matter.tags.as_ref().unwrap() { @tag }
+}
+
+
+
+@:footer_html()
diff --git a/templates/contact.html b/templates/contact.rs.html
similarity index 75%
rename from templates/contact.html
rename to templates/contact.rs.html
index fda126e..7d96cf1 100644
--- a/templates/contact.html
+++ b/templates/contact.rs.html
@@ -1,11 +1,14 @@
-{{ define "title" }}Contact - Christine Dodrill{{ end }}
+@use super::{header_html, footer_html};
+
+@()
+
+@:header_html(Some("Contact"), None)
-{{ define "content" }}
Contact Information
Email
-
me@christine.website
+
me@@christine.website
My GPG fingerprint is 799F 9134 8118 1111. If you get an email that appears to be from me and the signature does not match that fingerprint, it is not from me. You may download a copy of my public key here.