diff --git a/blog/blind-men-and-an-elephant-2018-11-29.markdown b/blog/blind-men-and-an-elephant-2018-11-29.markdown index b33e6fb..7c599e4 100644 --- a/blog/blind-men-and-an-elephant-2018-11-29.markdown +++ b/blog/blind-men-and-an-elephant-2018-11-29.markdown @@ -1,6 +1,7 @@ --- title: "Blind Men and an Elephant" date: 2018-11-29 +series: conlangs --- # Blind Men and an Elephant diff --git a/blog/brain-fmri-to-3d-model-2019-08-23.markdown b/blog/brain-fmri-to-3d-model-2019-08-23.markdown index 3c7ac33..723ec7d 100644 --- a/blog/brain-fmri-to-3d-model-2019-08-23.markdown +++ b/blog/brain-fmri-to-3d-model-2019-08-23.markdown @@ -1,6 +1,7 @@ --- title: How I Converted my Brain fMRI to a 3D Model date: 2019-08-23 +series: howto --- # How I Converted my Brain fMRI to a 3D Model diff --git a/blog/chaos-magick-debugging-2018-11-13.markdown b/blog/chaos-magick-debugging-2018-11-13.markdown index 8dc3d91..cc26ef1 100644 --- a/blog/chaos-magick-debugging-2018-11-13.markdown +++ b/blog/chaos-magick-debugging-2018-11-13.markdown @@ -2,6 +2,7 @@ title: "Chaos Magick Debugging" date: 2018-11-13 thanks: CelestialBoon +series: magick --- # Chaos Magick Debugging diff --git a/blog/cursing-out-god-2018-11-21.markdown b/blog/cursing-out-god-2018-11-21.markdown index ab55527..39b9840 100644 --- a/blog/cursing-out-god-2018-11-21.markdown +++ b/blog/cursing-out-god-2018-11-21.markdown @@ -1,6 +1,7 @@ --- title: My Experience Cursing Out God date: 2018-11-21 +series: dreams --- # My Experience Cursing Out God @@ -37,4 +38,4 @@ I was floored and must have amused Him, given that He started to chuckle: "Creat He looked at his wrist as if He was looking at a watch, even though He was not wearing one. "Oh dear, it looks like it's time for you to wake up now. Remember Creator, no time but the present." He snapped His hands and then the volcano started to erupt. -The world instantly snapped out of existence and I awoke in a sweat, my blankets evenly distributed in my room. \ No newline at end of file +The world instantly snapped out of existence and I awoke in a sweat, my blankets evenly distributed in my room. diff --git a/blog/death-08-19-2018.markdown b/blog/death-08-19-2018.markdown index 27c1b1c..209b8dd 100644 --- a/blog/death-08-19-2018.markdown +++ b/blog/death-08-19-2018.markdown @@ -2,6 +2,7 @@ title: Death date: 2018-08-19 thanks: Sygma +series: magick --- # Death diff --git a/blog/fear-07-24-2018.markdown b/blog/fear-07-24-2018.markdown index fd315b4..960bccf 100644 --- a/blog/fear-07-24-2018.markdown +++ b/blog/fear-07-24-2018.markdown @@ -3,6 +3,7 @@ title: Fear date: 2018-07-24 thanks: CelestialBoon, no really this guy is amazing and doesn't get enough credit, I'm so grateful for him. for: Twilight Sparkle +series: stories --- # Fear diff --git a/blog/formal-grammar-of-h-2019-05-19.markdown b/blog/formal-grammar-of-h-2019-05-19.markdown index 54a389a..23784a7 100644 --- a/blog/formal-grammar-of-h-2019-05-19.markdown +++ b/blog/formal-grammar-of-h-2019-05-19.markdown @@ -1,6 +1,7 @@ --- title: A Formal Grammar of h date: 2019-05-19 +series: conlangs --- # A Formal Grammar of `h` diff --git a/blog/getting-started-with-go-2015-01-28.markdown b/blog/getting-started-with-go-2015-01-28.markdown index fa22f79..5ae84f2 100644 --- a/blog/getting-started-with-go-2015-01-28.markdown +++ b/blog/getting-started-with-go-2015-01-28.markdown @@ -1,6 +1,7 @@ --- title: Getting Started with Go date: 2015-01-28 +series: howto --- Getting Started with Go diff --git a/blog/gratitude-07-20-2018.markdown b/blog/gratitude-07-20-2018.markdown index 1f53cdf..80fe63c 100644 --- a/blog/gratitude-07-20-2018.markdown +++ b/blog/gratitude-07-20-2018.markdown @@ -3,6 +3,7 @@ title: Gratitude date: 2018-07-20 thanks: CelestialBoon for: Mother Aya +series: magick --- # Gratitude diff --git a/blog/how-does-into-meditation-2017-12-10.markdown b/blog/how-does-into-meditation-2017-12-10.markdown index 96a16ba..2ffc1d3 100644 --- a/blog/how-does-into-meditation-2017-12-10.markdown +++ b/blog/how-does-into-meditation-2017-12-10.markdown @@ -1,6 +1,7 @@ --- title: How does into Meditation date: 2017-12-10 +series: when-then-zen --- # How does into Meditation diff --git a/blog/how-send-email-nim-2019-08-28.markdown b/blog/how-send-email-nim-2019-08-28.markdown index c2e397f..bd62578 100644 --- a/blog/how-send-email-nim-2019-08-28.markdown +++ b/blog/how-send-email-nim-2019-08-28.markdown @@ -1,6 +1,7 @@ --- title: How to Send Email with Nim date: 2019-08-28 +series: howto --- # How to Send Email with Nim diff --git a/blog/howto-automate-discord-webhook-cron-2018-03-29.markdown b/blog/howto-automate-discord-webhook-cron-2018-03-29.markdown index e18fbb4..b34d325 100644 --- a/blog/howto-automate-discord-webhook-cron-2018-03-29.markdown +++ b/blog/howto-automate-discord-webhook-cron-2018-03-29.markdown @@ -1,6 +1,7 @@ --- title: How to Automate Discord Message Posting With Webhooks and Cron date: 2018-03-29 +series: howto --- # How to Automate Discord Message Posting With Webhooks and Cron diff --git a/blog/howto-usermode-linux-2019-07-07.markdown b/blog/howto-usermode-linux-2019-07-07.markdown index b8e9a12..2a59abd 100644 --- a/blog/howto-usermode-linux-2019-07-07.markdown +++ b/blog/howto-usermode-linux-2019-07-07.markdown @@ -1,6 +1,7 @@ --- title: How to Use User Mode Linux date: 2019-07-07 +series: howto --- # How to Use User Mode Linux diff --git a/blog/ipad-smart-keyboard-accents-2019-05-10.markdown b/blog/ipad-smart-keyboard-accents-2019-05-10.markdown index 262ca94..d487349 100644 --- a/blog/ipad-smart-keyboard-accents-2019-05-10.markdown +++ b/blog/ipad-smart-keyboard-accents-2019-05-10.markdown @@ -1,6 +1,7 @@ --- title: "iPad Smart Keyboard: French Accents/Ligatures" date: 2019-05-10 +series: howto --- # iPad Smart Keyboard: French Accents/Ligatures diff --git a/blog/land-1-syscalls-file-io-2018-06-18.markdown b/blog/land-1-syscalls-file-io-2018-06-18.markdown index b50b9a7..c110543 100644 --- a/blog/land-1-syscalls-file-io-2018-06-18.markdown +++ b/blog/land-1-syscalls-file-io-2018-06-18.markdown @@ -1,6 +1,7 @@ --- title: "Land 1: Syscalls & File I/O" date: 2018-06-18 +series: olin --- # Land 1: Syscalls & File I/O diff --git a/blog/narrative-of-sickness-2018-08-13.markdown b/blog/narrative-of-sickness-2018-08-13.markdown index faa73b9..8faef4c 100644 --- a/blog/narrative-of-sickness-2018-08-13.markdown +++ b/blog/narrative-of-sickness-2018-08-13.markdown @@ -2,6 +2,7 @@ title: Narrative of Sickness date: 2018-08-13 for: awakening +series: magick --- # Narrative of Sickness diff --git a/blog/olin-1-why-09-1-2018.markdown b/blog/olin-1-why-09-1-2018.markdown index 0a7db8b..74da501 100644 --- a/blog/olin-1-why-09-1-2018.markdown +++ b/blog/olin-1-why-09-1-2018.markdown @@ -1,6 +1,7 @@ --- title: "Olin: 1: Why" date: 2018-09-01 +series: olin --- # [Olin][olin]: 1: Why diff --git a/blog/olin-2-the-future-09-5-2018.markdown b/blog/olin-2-the-future-09-5-2018.markdown index f0c00ae..9ba0e1d 100644 --- a/blog/olin-2-the-future-09-5-2018.markdown +++ b/blog/olin-2-the-future-09-5-2018.markdown @@ -1,6 +1,7 @@ --- title: "Olin: 2: The Future" date: 2018-09-05 +series: olin --- # [Olin](https://github.com/Xe/olin): 2: The Future diff --git a/blog/one-day-2018-11-01.markdown b/blog/one-day-2018-11-01.markdown index 9d1b04b..c5b1d55 100644 --- a/blog/one-day-2018-11-01.markdown +++ b/blog/one-day-2018-11-01.markdown @@ -2,6 +2,7 @@ title: "One Day" date: 2018-11-01 for: "Nicole" +series: stories --- # One Day @@ -24,4 +25,4 @@ It asked me "do that again", so I did. I did it more intensely than before someh Probably the most significant part though was being told "I love you". -I felt **loved**. I still do. I try to love others the way I am loved. \ No newline at end of file +I felt **loved**. I still do. I try to love others the way I am loved. diff --git a/blog/plt-1-the-beginning-2015-02-14.markdown b/blog/plt-1-the-beginning-2015-02-14.markdown index 6427a7e..2fae99f 100644 --- a/blog/plt-1-the-beginning-2015-02-14.markdown +++ b/blog/plt-1-the-beginning-2015-02-14.markdown @@ -1,6 +1,7 @@ --- title: The Saga of plt, Part 1 date: 2015-02-14 +series: plt --- The Saga of plt, Part 1 diff --git a/blog/plt-2-entering-the-cave-2015-02-14.markdown b/blog/plt-2-entering-the-cave-2015-02-14.markdown index de829a9..33aa54c 100644 --- a/blog/plt-2-entering-the-cave-2015-02-14.markdown +++ b/blog/plt-2-entering-the-cave-2015-02-14.markdown @@ -1,6 +1,7 @@ --- title: The Saga of plt, Part 2 date: 2015-02-14 +series: plt --- The Saga of plt, Part 2 diff --git a/blog/quinoa-taco-bowls-2019-08-16.markdown b/blog/quinoa-taco-bowls-2019-08-16.markdown index 930de7b..3586b0a 100644 --- a/blog/quinoa-taco-bowls-2019-08-16.markdown +++ b/blog/quinoa-taco-bowls-2019-08-16.markdown @@ -1,6 +1,7 @@ --- title: "Instant Pot Quinoa Taco Bowls" date: 2019-08-16 +series: recipes --- # Instant Pot Quinoa Taco Bowls diff --git a/blog/site-to-site-wireguard-part-1-2019-04-02.markdown b/blog/site-to-site-wireguard-part-1-2019-04-02.markdown index 7fa5471..4dab752 100644 --- a/blog/site-to-site-wireguard-part-1-2019-04-02.markdown +++ b/blog/site-to-site-wireguard-part-1-2019-04-02.markdown @@ -1,6 +1,7 @@ --- title: "Site to Site WireGuard: Part 1 - Names and Numbers" date: "2019-04-02" +series: site-to-site-wireguard --- # Site to Site WireGuard: Part 1 - Names and Numbers diff --git a/blog/site-to-site-wireguard-part-2-2019-04-07.markdown b/blog/site-to-site-wireguard-part-2-2019-04-07.markdown index beeabfd..9ec9625 100644 --- a/blog/site-to-site-wireguard-part-2-2019-04-07.markdown +++ b/blog/site-to-site-wireguard-part-2-2019-04-07.markdown @@ -1,6 +1,7 @@ --- title: "Site to Site WireGuard: Part 2 - DNS" date: 2019-04-07 +series: site-to-site-wireguard --- # Site to Site WireGuard: Part 2 - DNS diff --git a/blog/site-to-site-wireguard-part-3-2019-04-11.markdown b/blog/site-to-site-wireguard-part-3-2019-04-11.markdown index ec37d8b..8345269 100644 --- a/blog/site-to-site-wireguard-part-3-2019-04-11.markdown +++ b/blog/site-to-site-wireguard-part-3-2019-04-11.markdown @@ -1,6 +1,7 @@ --- title: "Site to Site WireGuard: Part 3 - Custom TLS Certificate Authority" date: 2019-04-11 +series: site-to-site-wireguard --- # Site to Site WireGuard: Part 3 - Custom TLS Certificate Authority diff --git a/blog/tarot-for-hackers-2019-07-24.markdown b/blog/tarot-for-hackers-2019-07-24.markdown index 0b32753..86501b6 100644 --- a/blog/tarot-for-hackers-2019-07-24.markdown +++ b/blog/tarot-for-hackers-2019-07-24.markdown @@ -1,6 +1,7 @@ --- title: Tarot for Hackers date: 2019-07-24 +series: magick --- # Tarot for Hackers diff --git a/blog/templeos-1-installation-and-basic-use-2019-05-20.markdown b/blog/templeos-1-installation-and-basic-use-2019-05-20.markdown index a878128..6645ec7 100644 --- a/blog/templeos-1-installation-and-basic-use-2019-05-20.markdown +++ b/blog/templeos-1-installation-and-basic-use-2019-05-20.markdown @@ -1,6 +1,7 @@ --- title: "TempleOS: 1 - Installation" date: 2019-05-20 +series: templeos --- # TempleOS: 1 - Installation diff --git a/blog/ten-thousand-laughs-2018-12-01.markdown b/blog/ten-thousand-laughs-2018-12-01.markdown index 3701ac4..10cd182 100644 --- a/blog/ten-thousand-laughs-2018-12-01.markdown +++ b/blog/ten-thousand-laughs-2018-12-01.markdown @@ -1,6 +1,7 @@ --- title: "Ten Thousand Laughs" date: "2018-12-01" +series: conlangs --- # Ten Thousand Laughs diff --git a/blog/the-cult-of-kubernetes-2019-09-07.markdown b/blog/the-cult-of-kubernetes-2019-09-07.markdown index b4d5df3..38baacb 100644 --- a/blog/the-cult-of-kubernetes-2019-09-07.markdown +++ b/blog/the-cult-of-kubernetes-2019-09-07.markdown @@ -1,6 +1,7 @@ --- title: The Cult of Kubernetes date: 2019-09-07 +series: howto --- # The Cult of Kubernetes diff --git a/blog/the-service-is-already-down-2018-10-13.markdown b/blog/the-service-is-already-down-2018-10-13.markdown index 6a905df..6d36f18 100644 --- a/blog/the-service-is-already-down-2018-10-13.markdown +++ b/blog/the-service-is-already-down-2018-10-13.markdown @@ -1,6 +1,7 @@ --- title: The Service is Already Down date: 2018-10-13 +series: stories --- # The Service is Already Down diff --git a/cmd/site/html.go b/cmd/site/html.go index 33bdd0f..f3f2a6b 100644 --- a/cmd/site/html.go +++ b/cmd/site/html.go @@ -69,6 +69,34 @@ var postView = promauto.NewCounterVec(prometheus.CounterOpts{ 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) showTalk(w http.ResponseWriter, r *http.Request) { if r.RequestURI == "/talks/" { http.Redirect(w, r, "/talks", http.StatusSeeOther) @@ -142,11 +170,13 @@ func (s *Site) showPost(w http.ResponseWriter, r *http.Request) { Link string BodyHTML template.HTML Date string + Series string }{ Title: p.Title, Link: p.Link, BodyHTML: p.BodyHTML, Date: p.Date.Format(dateFormat), + Series: p.Series, }).ServeHTTP(w, r) postView.With(prometheus.Labels{"base": filepath.Base(p.Link)}).Inc() } diff --git a/cmd/site/main.go b/cmd/site/main.go index 04d8bc4..00593f3 100644 --- a/cmd/site/main.go +++ b/cmd/site/main.go @@ -58,6 +58,7 @@ type Site struct { Posts blog.Posts Talks blog.Posts Resume template.HTML + Series []string rssFeed *feeds.Feed jsonFeed *jsonfeed.Feed @@ -147,6 +148,8 @@ func Build() (*Site, error) { return nil, err } s.Posts = posts + s.Series = posts.Series() + sort.Strings(s.Series) talks, err := blog.LoadPosts("./talks", "talks") if err != nil { @@ -210,6 +213,8 @@ func Build() (*Site, error) { 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("/css/", http.FileServer(http.Dir("."))) s.mux.Handle("/static/", http.FileServer(http.Dir("."))) diff --git a/internal/blog/blog.go b/internal/blog/blog.go index eac5d64..7d4f93c 100644 --- a/internal/blog/blog.go +++ b/internal/blog/blog.go @@ -20,6 +20,8 @@ type Post struct { 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"` Date time.Time DateString string `json:"date"` @@ -28,6 +30,24 @@ type Post struct { // 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 @@ -42,6 +62,8 @@ func LoadPosts(path string, prepend string) (Posts, error) { type postFM struct { Title string Date string + Series string + Tags []string SlidesLink string `yaml:"slides_link"` } var result Posts @@ -91,6 +113,8 @@ func LoadPosts(path string, prepend string) (Posts, error) { Body: string(remaining), BodyHTML: template.HTML(output), SlidesLink: fm.SlidesLink, + Series: fm.Series, + Tags: fm.Tags, } result = append(result, p) diff --git a/templates/blogindex.html b/templates/blogindex.html index 3e8159a..917eb39 100644 --- a/templates/blogindex.html +++ b/templates/blogindex.html @@ -7,6 +7,8 @@

If you have a compatible reader, be sure to check out my RSS Feed for automatic updates. Also check out the JSONFeed.

+

For a breakdown by post series, see here.

+