Who even knows at this point

This commit is contained in:
Ben Visness 2022-06-11 16:44:02 -05:00
parent e47ab0804e
commit df4ff592b4
3 changed files with 78 additions and 26 deletions

View File

@ -70,7 +70,8 @@
{{ define "content" }}
<div class="ph3 ph0-ns">
<h2 class="mt3">{{ .Info.Title }}</h2>
<h2>{{ .Info.Title }}</h2>
<p>{{ .Info.Description }}</p>
<div class="fishbowl-banner br3 mb3">
<div class="pa3">

View File

@ -1,7 +1,33 @@
{{ template "base.html" . }}
{{ define "content" }}
<ul>
<li><a href="oop">What, if anything, is OOP?</a></li>
</ul>
<div class="ph3 ph0-ns">
<h2>Fishbowls</h2>
<p>Every two months on the Discord, we host a <b>fishbowl</b>: a panel conversation where a select few community members can discuss a topic in detail. Fishbowls give us the opportunity to discuss difficult subjects with more nuance and detail than you can find anywhere else on the Internet. In many ways, they're a distillation of everything the network is about.</p>
<p>This is an archive of those conversations. If you would like to catch one live, <a href="https://discord.gg/hmn" target="_blank">join the Discord!</a></p>
<p class="c--dim i">We're still working through our backlog of fishbowls, so not all of these are available yet. We'll publish them as we finish them.</p>
<div class="mt3 mw7">
{{ range .Fishbowls }}
<div class="br2 bg--dim pa3 mb2">
{{ if .Valid }}
<a href="{{ .Url }}"><h3 class="f4 ma0">{{ .Fishbowl.Title }}</h3></a>
{{ else }}
<h3 class="f4 ma0">{{ .Fishbowl.Title }}</h3>
{{ end }}
<div class="c--dim b">
{{ .Fishbowl.Month }} {{ .Fishbowl.Year }}
</div>
{{ with .Fishbowl.Description }}
<div class="mt2">{{ . }}</div>
{{ end }}
</div>
{{ end }}
</div>
<p class="c--dim i">If you'd like to help us plan more fishbowls, join the discussion over on <a href="https://github.com/HandmadeNetwork/hmn_fishbowl/discussions/categories/ideas" target="_blank">GitHub</a>.</p>
</div>
{{ end }}

View File

@ -1,11 +1,11 @@
package website
import (
"fmt"
"html/template"
"io"
"io/fs"
"net/http"
"sort"
"strings"
"time"
@ -22,11 +22,11 @@ var fishbowlFS = utils.Must1(fs.Sub(templates.FishbowlFS, "src/fishbowls"))
var fishbowlHTTPFS = http.StripPrefix("/fishbowl", http.FileServer(http.FS(fishbowlFS)))
type fishbowlInfo struct {
Slug string
Title string
Month time.Month
Year int
ContentsPath string
Slug string
Title, Description string // The description is used for OpenGraph, so it must be plain text, no HTML.
Month time.Month
Year int
ContentsPath string
}
var fishbowls = [...]fishbowlInfo{
@ -66,41 +66,62 @@ var fishbowls = [...]fishbowlInfo{
Month: time.May, Year: 2021,
},
{
Slug: "teaching-software",
Title: "How software development is taught",
Month: time.June, Year: 2021,
Slug: "teaching-software",
Title: "How software development is taught",
Description: "The Handmade Network exists because we are unhappy with the software status quo. To a large extent, this is because of how software development is taught. What are the good parts of software education today, what are the flaws, and how might we change things to improve the state of software?",
Month: time.June, Year: 2021,
},
{
Slug: "flexible-software",
Title: "How to design flexible software",
Month: time.December, Year: 2021,
Slug: "flexible-software",
Title: "How to design flexible software",
Description: "We previously held a fishbowl about how to design to avoid configuration. But when you can't avoid configuration, how do you do it well? And if we want our software to be flexible, what other options do we have besides configuration? What other ways are there to make software flexible?",
Month: time.December, Year: 2021,
},
{
Slug: "oop",
Title: "What, if anything, is OOP?",
Month: time.May, Year: 2022,
Slug: "oop",
Title: "What, if anything, is OOP?",
Description: "Is object-oriented programming bad? Is it good? What even is it, anyway? This fishbowl explores OOP more carefully—what is the essence of it, what are the good parts, why did it take over the world, and why do we criticize it so much?",
Month: time.May, Year: 2022,
ContentsPath: "oop/OOP.html",
},
}
func FishbowlIndex(c *RequestContext) ResponseData {
type fishbowlTmpl struct {
Date string
Title string
Url string
Fishbowl fishbowlInfo
Url string
Valid bool
date time.Time
}
type tmpl struct {
templates.BaseData
Fishbowls []fishbowlTmpl
}
tmplData := tmpl{
BaseData: getBaseData(c, "Fishbowls", []templates.Breadcrumb{
{Name: "Fishbowls", Url: hmnurl.BuildFishbowlIndex()},
}),
}
var fishbowlTmpls []fishbowlTmpl
for _, f := range fishbowls {
fishbowlTmpls = append(fishbowlTmpls, fishbowlTmpl{
Date: fmt.Sprintf("%s %d", f.Month.String(), f.Year),
Title: f.Title,
Url: hmnurl.BuildFishbowl(f.Slug),
Fishbowl: f,
Url: hmnurl.BuildFishbowl(f.Slug),
Valid: f.ContentsPath != "",
date: time.Date(f.Year, f.Month, 0, 0, 0, 0, 0, time.UTC),
})
}
sort.Slice(fishbowlTmpls, func(i, j int) bool {
return fishbowlTmpls[j].date.Before(fishbowlTmpls[i].date) // reverse
})
tmplData.Fishbowls = fishbowlTmpls
var res ResponseData
err := res.WriteTemplate("fishbowl_index.html", getBaseData(c, "Fishbowls", nil), c.Perf)
err := res.WriteTemplate("fishbowl_index.html", tmplData, c.Perf)
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, oops.New(err, "failed to render fishbowl index page"))
}
@ -146,6 +167,10 @@ func Fishbowl(c *RequestContext) ResponseData {
Info: info,
Contents: template.HTML(utils.Must1(io.ReadAll(contentsFile))),
}
tmpl.BaseData.OpenGraphItems = append(tmpl.BaseData.OpenGraphItems, templates.OpenGraphItem{
Property: "og:description",
Value: info.Description,
})
var res ResponseData
err := res.WriteTemplate("fishbowl.html", tmpl, c.Perf)