From 38a2979f82b40e5494c9fc9f2bd58a87f0a2e3c8 Mon Sep 17 00:00:00 2001 From: Ben Visness Date: Mon, 13 May 2024 18:33:15 -0500 Subject: [PATCH] Port the content styles (easier than I thought!) --- public/style.css | 147 ++++++++++++++ src/hmnurl/urls.go | 18 -- src/rawdata/scss/_content.scss | 186 ------------------ src/rawdata/scss/content.css | 170 ++++++++++++++++ src/rawdata/scss/core.css | 6 + src/rawdata/scss/style.css | 1 + src/rawdata/scss/vars.css | 4 + src/templates/src/about.html | 31 +-- src/templates/src/include/footer.html | 4 - src/templates/src/jam_2021_wrj_index.html | 4 +- src/templates/src/jam_2022_wrj_feed.html | 2 +- src/templates/src/jam_2022_wrj_index.html | 2 +- src/templates/src/jam_2023_vj_feed.html | 2 +- src/templates/src/jam_2023_vj_index.html | 2 +- src/templates/src/jam_2023_vj_recap.html | 2 +- src/templates/src/jam_2023_wrj_feed.html | 2 +- src/templates/src/jam_2023_wrj_index.html | 2 +- .../src/layouts/jam_2023_visibility_base.html | 2 +- src/templates/src/layouts/landing_page.html | 54 ----- src/templates/src/layouts/staticpage.html | 13 -- .../src/layouts/timemachine_base.html | 2 +- .../src/layouts/wheeljam_2022_base.html | 2 +- .../src/layouts/wheeljam_2023_base.html | 2 +- src/templates/types.go | 1 - src/website/base_data.go | 1 - src/website/roles.go | 107 ---------- src/website/routes.go | 3 - src/website/staticpages.go | 14 +- todo-styles.md | 3 +- 29 files changed, 350 insertions(+), 439 deletions(-) delete mode 100644 src/rawdata/scss/_content.scss create mode 100644 src/rawdata/scss/content.css delete mode 100644 src/templates/src/layouts/landing_page.html delete mode 100644 src/templates/src/layouts/staticpage.html delete mode 100644 src/website/roles.go diff --git a/public/style.css b/public/style.css index 40614d2..e573a8e 100644 --- a/public/style.css +++ b/public/style.css @@ -7182,6 +7182,7 @@ code { --notice-success-color: #43a52f; --notice-warn-color: #aa7d30; --notice-failure-color: #b42222; + --spoiler-border: #aaa; } @media (prefers-color-scheme: dark) { :root { @@ -7211,6 +7212,7 @@ code { --notice-success-color: #2a681d; --notice-warn-color: #876327; --notice-failure-color: #7a2020; + --spoiler-border: #777; } } @@ -7241,9 +7243,14 @@ a.external::after, vertical-align: middle; } code, +pre, .mono { font-family: "Fira Mono", monospace; } +b, +strong { + font-weight: 500; +} .bg--main { background-color: var(--main-background-color); } @@ -7745,6 +7752,146 @@ code, background-color: var(--theme-color-dimmest); } +/* src/rawdata/scss/content.css */ +.post-content *:first-child { + margin-top: 0; +} +.post-content *:last-child { + margin-bottom: 0; +} +.post-content h1 { + font-size: 2rem; +} +.post-content h2 { + font-size: 1.5rem; +} +.post-content h3 { + font-size: 1.25rem; +} +.post-content h4 { + font-size: 1rem; +} +.post-content h5 { + font-size: 0.8rem; +} +.post-content h1, +.post-content h2, +.post-content h3, +.post-content h4, +.post-content h5 { + margin-top: 0.5em; + margin-bottom: 0.5em; +} +.post-content li:not(:last-child) { + margin-bottom: 0.2em; +} +.post-content img { + max-width: 100%; +} +.post-content hr { + margin-left: var(--spacing-medium); + margin-right: var(--spacing-medium); +} +.post-content div.code { + border-color: var(--dimmer-color); + max-width: 100%; + max-height: 20em; + max-height: 80vh; + overflow: auto; + -moz-tab-size: 4; + tab-size: 4; + border-width: 1px; + border-style: solid; +} +.post-content div + br, +.post-content blockquote + br, +.post-content ul + br, +.post-content ol + br { + display: none; +} +.post-content table { + margin-top: var(--spacing-small); + margin-bottom: var(--spacing-small); +} +.post-content th, +.post-content td { + padding: var(--spacing-extra-small) var(--spacing-small); + border: 1px solid var(--dimmest-color); +} +.post-content code { + background-color: var(--dim-background); + border-radius: var(--border-radius-2); + padding: .2em 0; + white-space: nowrap; +} +.post-content code::before, +.post-content code::after { + content: "\a0"; + letter-spacing: -0.2em; + display: inline-block; +} +.post-content pre > code, +.post-content pre.hmn-code { + background-color: var(--dim-background); + border-radius: var(--border-radius-2); + padding: 0.7em; + overflow-x: auto; +} +.post-content blockquote { + border-color: var(--dimmest-color); + margin-left: var(--spacing-small); + padding-left: var(--spacing-small); + margin-right: 0; + border-left-style: solid; + border-left-width: 1px; +} +.post-content blockquote .quotewho { + line-height: 2em; +} +.post-content blockquote .quotewho::after { + content: " said:"; +} +.post-content figure { + margin: var(--spacing-small) 0; + padding: var(--spacing-small) var(--spacing-small) 0; + background-color: var(--dim-background); + border-radius: var(--border-radius-3); + display: flex; + flex-direction: column; +} +@media screen and (min-width: 35em) { + .post-content figure { + margin-top: var(--spacing-medium); + margin-bottom: var(--spacing-medium); + padding: var(--spacing-medium) var(--spacing-medium) 0; + } +} +.post-content figure figcaption { + margin: var(--spacing-extra-small) 0; +} +@media screen and (min-width: 35em) { + .post-content figure figcaption { + margin: var(--spacing-small) 0; + } +} +.post-content table { + border-collapse: collapse; + table-layout: fixed; +} +.post-content td { + vertical-align: baseline; +} +.post-content .spoiler { + border-color: var(--spoiler-border); + border-width: 1px; + border-style: dashed; + color: transparent; +} +.post-content .spoiler::selection { + color: white; + background-color: black; +} + /* src/rawdata/scss/editor.css */ #preview:empty::after { content: "A preview of your post will appear here."; diff --git a/src/hmnurl/urls.go b/src/hmnurl/urls.go index f72cb40..1d4992e 100644 --- a/src/hmnurl/urls.go +++ b/src/hmnurl/urls.go @@ -333,24 +333,6 @@ func BuildConferences() string { return Url("/conferences", nil) } -/* -* Volunteer/Staff Roles - */ - -var RegexStaffRolesIndex = regexp.MustCompile(`^/roles$`) - -func BuildStaffRolesIndex() string { - defer CatchPanic() - return Url("/roles", nil) -} - -var RegexStaffRole = regexp.MustCompile(`^/roles/(?P[^/]+)$`) - -func BuildStaffRole(slug string) string { - defer CatchPanic() - return Url(fmt.Sprintf("/roles/%s", slug), nil) -} - /* * User */ diff --git a/src/rawdata/scss/_content.scss b/src/rawdata/scss/_content.scss deleted file mode 100644 index 270cf2f..0000000 --- a/src/rawdata/scss/_content.scss +++ /dev/null @@ -1,186 +0,0 @@ -strong { - font-weight: 500; -} - -.text { - @include usevar(background-color, text-background); -} - -.underline { - text-decoration:underline; -} - -.monospace { - font-family: $monospace-fonts; - background-color: rgba(0, 0, 0, 0.1); - padding: 0.2em 0 0.05em; - border-radius: 3px; - - &::before, &::after { - content: "\00a0"; - letter-spacing: -0.2em; - } -} - -.center { - text-align: center; -} - -.right { - text-align: right; -} - -.left { - text-align: left; -} - -.justify { - text-align:justify; - -webkit-hyphens:manual; - -moz-hyphens:manual; - -ms-hyphens:manual; - hyphens:manual; -} - -.spoiler { - @include usevar(border-color, spoiler-border); - - border-width: 1px; - border-style: dashed; - color: transparent; - - &::selection { - color: white; - background-color: black; - } -} - -blockquote { - @extend .b--dimmest; - @extend .ml2, .pl2, .mr0; - @extend .bl; - - .quotewho { - line-height: 2em; - - &::after { - content: " said:"; - } - } -} - -pre { - font-family: $monospace-fonts; -} - -.post-content { - * { - &:first-child { - margin-top: 0; - } - - &:last-child { - margin-bottom: 0; - } - } - - h1 { - font-size: 2rem; - } - - h2 { - font-size: 1.5rem; - } - - h3 { - font-size: 1.25rem; - } - - h4 { - font-size: 1rem; - } - - h5 { - font-size: 0.8rem; - } - - h1, h2, h3, h4, h5 { - margin-top: 0.5em; - margin-bottom: 0.5em; - } - - li:not(:last-child) { - margin-bottom: 0.2em; - } - - img { - max-width: 100%; - } - - hr { - @extend .mh3; - } - - div.code { - @extend .b--dimmer; - - max-width: 100%; - max-height: 20em; - max-height: 80vh; - overflow: auto; - -moz-tab-size: 4; - tab-size: 4; - border-width: 1px; - border-style: solid; - } - - div + br, - blockquote + br, - ul + br, - ol + br, - { - display: none; - } - - table { - @extend .mv2; - } - - th, td { - @extend .ph2, .pv1; - @extend .ba, .b--dimmest; - } - - code { - @extend .bg--dim; - @extend .br2; - - padding: .2em 0; - white-space: nowrap; - - &::before, &::after { - content: "\00a0"; - letter-spacing: -0.2em; - display: inline-block; - } - } - - pre > code, pre.hmn-code { - @extend .bg--dim; - @extend .br2; - - padding: 0.7em; - overflow-x: auto; - } -} - -figure { - @extend .mh0, .mv2, .mv3-ns, .pa2, .pa3-ns, .bg--dim, .br3; - display: flex; - flex-direction: column; - padding-bottom: 0; - - figcaption { - @extend .pv1, .pv2-ns; - } -} diff --git a/src/rawdata/scss/content.css b/src/rawdata/scss/content.css new file mode 100644 index 0000000..c6009b8 --- /dev/null +++ b/src/rawdata/scss/content.css @@ -0,0 +1,170 @@ +.post-content { + * { + &:first-child { + margin-top: 0; + } + + &:last-child { + margin-bottom: 0; + } + } + + h1 { + font-size: 2rem; + } + + h2 { + font-size: 1.5rem; + } + + h3 { + font-size: 1.25rem; + } + + h4 { + font-size: 1rem; + } + + h5 { + font-size: 0.8rem; + } + + h1, + h2, + h3, + h4, + h5 { + margin-top: 0.5em; + margin-bottom: 0.5em; + } + + li:not(:last-child) { + margin-bottom: 0.2em; + } + + img { + max-width: 100%; + } + + hr { + margin-left: var(--spacing-medium); + margin-right: var(--spacing-medium); + } + + div.code { + border-color: var(--dimmer-color); + + max-width: 100%; + max-height: 20em; + max-height: 80vh; + overflow: auto; + -moz-tab-size: 4; + tab-size: 4; + border-width: 1px; + border-style: solid; + } + + div+br, + blockquote+br, + ul+br, + ol+br { + display: none; + } + + table { + margin-top: var(--spacing-small); + margin-bottom: var(--spacing-small); + } + + th, + td { + padding: var(--spacing-extra-small) var(--spacing-small); + border: 1px solid var(--dimmest-color); + } + + code { + background-color: var(--dim-background); + border-radius: var(--border-radius-2); + + padding: .2em 0; + white-space: nowrap; + + &::before, + &::after { + content: "\00a0"; + letter-spacing: -0.2em; + display: inline-block; + } + } + + pre>code, + pre.hmn-code { + background-color: var(--dim-background); + border-radius: var(--border-radius-2); + + padding: 0.7em; + overflow-x: auto; + } + + blockquote { + border-color: var(--dimmest-color); + margin-left: var(--spacing-small); + padding-left: var(--spacing-small); + margin-right: 0; + border-left-style: solid; + border-left-width: 1px; + + .quotewho { + line-height: 2em; + + &::after { + content: " said:"; + } + } + } + + figure { + margin: var(--spacing-small) 0; + padding: var(--spacing-small) var(--spacing-small) 0; + background-color: var(--dim-background); + border-radius: var(--border-radius-3); + display: flex; + flex-direction: column; + + @media screen and (min-width: 35em) { + margin-top: var(--spacing-medium); + margin-bottom: var(--spacing-medium); + padding: var(--spacing-medium) var(--spacing-medium) 0; + } + + figcaption { + margin: var(--spacing-extra-small) 0; + + @media screen and (min-width: 35em) { + margin: var(--spacing-small) 0; + } + } + } + + table { + border-collapse: collapse; + table-layout: fixed; + } + + td { + vertical-align: baseline; + } + + .spoiler { + border-color: var(--spoiler-border); + + border-width: 1px; + border-style: dashed; + color: transparent; + + &::selection { + color: white; + background-color: black; + } + } +} \ No newline at end of file diff --git a/src/rawdata/scss/core.css b/src/rawdata/scss/core.css index 2be2ed0..79e73a9 100644 --- a/src/rawdata/scss/core.css +++ b/src/rawdata/scss/core.css @@ -32,10 +32,16 @@ a, } code, +pre, .mono { font-family: "Fira Mono", monospace; } +b, +strong { + font-weight: 500; +} + /* Utility */ .bg--main { diff --git a/src/rawdata/scss/style.css b/src/rawdata/scss/style.css index 8828e3d..55f08de 100644 --- a/src/rawdata/scss/style.css +++ b/src/rawdata/scss/style.css @@ -4,6 +4,7 @@ @import "core.css"; @import "carousel.css"; +@import "content.css"; @import "editor.css"; @import "education.css"; @import "forum.css"; diff --git a/src/rawdata/scss/vars.css b/src/rawdata/scss/vars.css index 9c5d8f2..4cd6c20 100644 --- a/src/rawdata/scss/vars.css +++ b/src/rawdata/scss/vars.css @@ -45,6 +45,8 @@ $breakpoint-large: screen and (min-width: 60em) --notice-success-color: #43a52f; --notice-warn-color: #aa7d30; --notice-failure-color: #b42222; + + --spoiler-border: #aaa; } @media (prefers-color-scheme: dark) { @@ -83,5 +85,7 @@ $breakpoint-large: screen and (min-width: 60em) --notice-success-color: #2a681d; --notice-warn-color: #876327; --notice-failure-color: #7a2020; + + --spoiler-border: #777; } } \ No newline at end of file diff --git a/src/templates/src/about.html b/src/templates/src/about.html index c19e5f6..3155af7 100644 --- a/src/templates/src/about.html +++ b/src/templates/src/about.html @@ -16,7 +16,7 @@ The Handmade Network's activities are funded by the Handmade Software Foundation, a (soon-to-be) 501(c)(3) nonprofit corporation.

-->

- We can teach programmers how things actually work. We can teach users to expect better. We can build the best software you've ever seen. Join us. + We can teach programmers how things actually work. We can teach users to expect better. We can build the best software you've ever seen. Join us.

@@ -69,32 +69,9 @@

Martin Fouilleul

-

[Secret Project] Lead

-

Martin is a PhD student at Ircam, researching programming languages and models for distributed temporal interactions in music and performing arts software. He is also a former sound engineer and computer music designer.

-

Right now he is working behind the scenes on a secret Handmade Network project, to be revealed at a later date.

-
-
-

???

-

Education Lead

-

- This could be you! Education is one of our flagship initiatives, and we are looking for someone to lead it. If you are excited about programming education and want to help out, please learn more and get in touch! -

-
-
-
-
-

???

-

Advocacy Lead

-

- This could be you! We want to go out into the world and advocate for better software and better programming practices. We need a strong communicator who can lead this for us. If this excites you, please learn more and get in touch! -

-
-
-

???

-

Design Lead

-

- This could be you! Building software for people means designing software for people. We are looking for someone with visual and UX design skills to design website features, event art, livestreaming assets, educational graphics, and more. If any of this sounds interesting to you, learn more and get in touch! -

+

Orca Lead

+

Martin is a systems programmer, researcher, and PhD with experience in programming languages and models for distributed temporal interactions in music and performing arts software. He is also a former sound engineer and computer music designer.

+

He is the project lead on Orca, a new platform for WebAssembly applications outside the browser.

diff --git a/src/templates/src/include/footer.html b/src/templates/src/include/footer.html index 793c643..3491bef 100644 --- a/src/templates/src/include/footer.html +++ b/src/templates/src/include/footer.html @@ -16,10 +16,6 @@ About / -
  • - Roles - / -
  • Projects / diff --git a/src/templates/src/jam_2021_wrj_index.html b/src/templates/src/jam_2021_wrj_index.html index 9e30586..f65b655 100644 --- a/src/templates/src/jam_2021_wrj_index.html +++ b/src/templates/src/jam_2021_wrj_index.html @@ -236,7 +236,7 @@ -
    +
    {{ template "header.html" . }}
    @@ -245,7 +245,7 @@

    Wheel Reinvention Jam

    September 27 - October 3, 2O21

    -
    +
    A one-week jam to bring a fresh perspective to old ideas.
    diff --git a/src/templates/src/jam_2022_wrj_feed.html b/src/templates/src/jam_2022_wrj_feed.html index 311bcd1..dafd879 100644 --- a/src/templates/src/jam_2022_wrj_feed.html +++ b/src/templates/src/jam_2022_wrj_feed.html @@ -15,7 +15,7 @@

    Wheel Reinvention Jam

    August 15 - 21, 2O22

    -
    +
    A one-week jam to change the status quo.
    diff --git a/src/templates/src/jam_2022_wrj_index.html b/src/templates/src/jam_2022_wrj_index.html index ffcc4fb..fe948a7 100644 --- a/src/templates/src/jam_2022_wrj_index.html +++ b/src/templates/src/jam_2022_wrj_index.html @@ -22,7 +22,7 @@

    Wheel Reinvention Jam

    August 15 - 21, 2O22

    -
    +
    A one-week jam to change the status quo. {{ if gt .DaysUntilEnd 0 }} {{ if eq .DaysUntilStart 0 }} diff --git a/src/templates/src/jam_2023_vj_feed.html b/src/templates/src/jam_2023_vj_feed.html index 01e54fe..5819cea 100644 --- a/src/templates/src/jam_2023_vj_feed.html +++ b/src/templates/src/jam_2023_vj_feed.html @@ -13,7 +13,7 @@

    Visibility Jam

    April 14 - 16, 2O23

    -
    See things in a new way.
    +
    See things in a new way.
    diff --git a/src/templates/src/jam_2023_vj_index.html b/src/templates/src/jam_2023_vj_index.html index 7b258a5..8992613 100644 --- a/src/templates/src/jam_2023_vj_index.html +++ b/src/templates/src/jam_2023_vj_index.html @@ -21,7 +21,7 @@ $discordInviteURL := "https://discord.gg/hmn" }}

    Visibility Jam

    April 14 - 16, 2O23

    -
    +
    See things in a new way. {{ if gt .DaysUntilEnd 0 }} {{ if eq .DaysUntilStart 0 }} diff --git a/src/templates/src/jam_2023_vj_recap.html b/src/templates/src/jam_2023_vj_recap.html index 54d8014..39eda54 100644 --- a/src/templates/src/jam_2023_vj_recap.html +++ b/src/templates/src/jam_2023_vj_recap.html @@ -15,7 +15,7 @@

    Visibility Jam

    April 14 - 16, 2O23

    -
    See things in a new way.
    +
    See things in a new way.
    diff --git a/src/templates/src/jam_2023_wrj_feed.html b/src/templates/src/jam_2023_wrj_feed.html index 0319373..3e50c32 100644 --- a/src/templates/src/jam_2023_wrj_feed.html +++ b/src/templates/src/jam_2023_wrj_feed.html @@ -15,7 +15,7 @@

    Wheel Reinvention Jam

    September 25 - October 1, 2023

    -
    +
    A one-week jam to change the status quo.
    diff --git a/src/templates/src/jam_2023_wrj_index.html b/src/templates/src/jam_2023_wrj_index.html index cc5ebfe..0dc8dcf 100644 --- a/src/templates/src/jam_2023_wrj_index.html +++ b/src/templates/src/jam_2023_wrj_index.html @@ -32,7 +32,7 @@

    Wheel Reinvention Jam

    September 25 - October 1, 2023

    -
    +
    A one-week jam where you start from scratch. {{ if gt .DaysUntilEnd 0 }} {{ if eq .DaysUntilStart 0 }} diff --git a/src/templates/src/layouts/jam_2023_visibility_base.html b/src/templates/src/layouts/jam_2023_visibility_base.html index 60db4ed..d1e039a 100644 --- a/src/templates/src/layouts/jam_2023_visibility_base.html +++ b/src/templates/src/layouts/jam_2023_visibility_base.html @@ -346,7 +346,7 @@ -
    +
    {{ template "header.html" . }}
    diff --git a/src/templates/src/layouts/landing_page.html b/src/templates/src/layouts/landing_page.html deleted file mode 100644 index f057569..0000000 --- a/src/templates/src/layouts/landing_page.html +++ /dev/null @@ -1,54 +0,0 @@ -{{/* - This is a copy-paste from base.html because we want to preserve the unique - style of landing pages if we change base.html in the future. -*/}} - - - - - - - - - - {{ if .CanonicalLink }}{{ end }} - {{ range .OpenGraphItems }} - {{ if .Property }} - - {{ else }} - - {{ end }} - {{ end }} - {{ if .Title }} - {{ .Title }} | Handmade Network - {{ else }} - Handmade Network - {{ end }} - - - - - - - - - - - - -
    -
    - {{ template "header.html" . }} -
    - -
    - {{ block "content" . }}{{ end }} -
    - -
    - {{ template "footer.html" . }} -
    -
    - - - diff --git a/src/templates/src/layouts/staticpage.html b/src/templates/src/layouts/staticpage.html deleted file mode 100644 index e503afa..0000000 --- a/src/templates/src/layouts/staticpage.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - {{ block "title" . }}Handmade Network{{ end }} - - - - {{ block "content" . }}{{ end }} - {{ template "footer.html" . }} - - - diff --git a/src/templates/src/layouts/timemachine_base.html b/src/templates/src/layouts/timemachine_base.html index 73ffeac..5fc1406 100644 --- a/src/templates/src/layouts/timemachine_base.html +++ b/src/templates/src/layouts/timemachine_base.html @@ -197,7 +197,7 @@ -
    +
    {{ template "header.html" . }}
    diff --git a/src/templates/src/layouts/wheeljam_2022_base.html b/src/templates/src/layouts/wheeljam_2022_base.html index bb83322..b55c254 100644 --- a/src/templates/src/layouts/wheeljam_2022_base.html +++ b/src/templates/src/layouts/wheeljam_2022_base.html @@ -339,7 +339,7 @@ -
    +
    {{ template "header.html" . }}
    diff --git a/src/templates/src/layouts/wheeljam_2023_base.html b/src/templates/src/layouts/wheeljam_2023_base.html index e7f6342..3866580 100644 --- a/src/templates/src/layouts/wheeljam_2023_base.html +++ b/src/templates/src/layouts/wheeljam_2023_base.html @@ -342,7 +342,7 @@ -
    +
    {{ template "header.html" . }}
    diff --git a/src/templates/types.go b/src/templates/types.go index dd717c2..bac5e0b 100644 --- a/src/templates/types.go +++ b/src/templates/types.go @@ -78,7 +78,6 @@ type Footer struct { CodeOfConductUrl string CommunicationGuidelinesUrl string ProjectIndexUrl string - RolesUrl string ContactUrl string SearchActionUrl string } diff --git a/src/website/base_data.go b/src/website/base_data.go index 3b7ce4a..cc34bf1 100644 --- a/src/website/base_data.go +++ b/src/website/base_data.go @@ -87,7 +87,6 @@ func getBaseData(c *RequestContext, title string, breadcrumbs []templates.Breadc ManifestoUrl: hmnurl.BuildManifesto(), CommunicationGuidelinesUrl: hmnurl.BuildCommunicationGuidelines(), ProjectIndexUrl: hmnurl.BuildProjectIndex(1, ""), - RolesUrl: hmnurl.BuildStaffRolesIndex(), ContactUrl: hmnurl.BuildContactPage(), SearchActionUrl: "https://duckduckgo.com", }, diff --git a/src/website/roles.go b/src/website/roles.go deleted file mode 100644 index 93b03c4..0000000 --- a/src/website/roles.go +++ /dev/null @@ -1,107 +0,0 @@ -package website - -import ( - "net/http" - - "git.handmade.network/hmn/hmn/src/hmnurl" - "git.handmade.network/hmn/hmn/src/templates" -) - -type Role struct { - Slug string - Name string - Description string - Template string - Url string // weird and redundant - - RedirectSlug string -} - -var roles = []Role{ - { - Slug: "education", - Name: "Education Lead", - Description: "Lead our flagship education initiative and make sure we're putting out a steady stream of content.", - Template: "role_education.html", - Url: hmnurl.BuildStaffRole("education"), - }, - { - Slug: "advocacy", - Name: "Advocacy Lead", - Description: "Put the Handmade ethos into the world by advocating for better software and better programming practices.", - Template: "role_advocacy.html", - Url: hmnurl.BuildStaffRole("advocacy"), - }, - { - Slug: "design", - Name: "Design Lead", - Description: "Set the visual direction for everything we do. Make key art, design website features, and more.", - Template: "role_design.html", - Url: hmnurl.BuildStaffRole("design"), - }, -} - -const StaffRolesIndexName = "Roles" - -func StaffRolesIndex(c *RequestContext) ResponseData { - type TemplateData struct { - templates.BaseData - Roles []Role - } - - var res ResponseData - res.MustWriteTemplate("roles.html", TemplateData{ - BaseData: getBaseDataAutocrumb(c, StaffRolesIndexName), - Roles: roles, - }, c.Perf) - return res -} - -func StaffRole(c *RequestContext) ResponseData { - type TemplateData struct { - templates.BaseData - Role Role - OtherRoles []Role - } - - slug := c.PathParams["slug"] - role, ok := getRole(slug) - if !ok { - return FourOhFour(c) // TODO: Volunteering-specific 404 - } - - if role.RedirectSlug != "" { - return c.Redirect(hmnurl.BuildStaffRole(role.RedirectSlug), http.StatusSeeOther) - } - - var otherRoles []Role - for _, otherRole := range roles { - if otherRole.Slug == role.Slug { - continue - } - otherRoles = append(otherRoles, otherRole) - if len(otherRoles) >= 3 { - break - } - } - - var res ResponseData - res.MustWriteTemplate(role.Template, TemplateData{ - BaseData: getBaseData(c, role.Name, []templates.Breadcrumb{ - {Name: StaffRolesIndexName, Url: hmnurl.BuildStaffRolesIndex()}, - {Name: role.Name, Url: ""}, - }), - Role: role, - OtherRoles: otherRoles, - }, c.Perf) - return res -} - -func getRole(slug string) (Role, bool) { - for _, role := range roles { - if role.Slug == slug { - return role, true - } - } - return Role{}, false -} diff --git a/src/website/routes.go b/src/website/routes.go index cb80116..1e757d3 100644 --- a/src/website/routes.go +++ b/src/website/routes.go @@ -82,9 +82,6 @@ func NewWebsiteRoutes(conn *pgxpool.Pool) http.Handler { hmnOnly.GET(hmnurl.RegexCalendarIndex, CalendarIndex) hmnOnly.GET(hmnurl.RegexCalendarICal, CalendarICal) - hmnOnly.GET(hmnurl.RegexStaffRolesIndex, StaffRolesIndex) - hmnOnly.GET(hmnurl.RegexStaffRole, StaffRole) - hmnOnly.GET(hmnurl.RegexOldHome, Index) hmnOnly.POST(hmnurl.RegexLoginAction, securityTimerMiddleware(time.Millisecond*100, Login)) diff --git a/src/website/staticpages.go b/src/website/staticpages.go index 8262547..0fc7434 100644 --- a/src/website/staticpages.go +++ b/src/website/staticpages.go @@ -27,21 +27,13 @@ func Manifesto(c *RequestContext) ResponseData { func About(c *RequestContext) ResponseData { type TemplateData struct { templates.BaseData - FoundationUrl string - RolesUrl string - EducationLeadUrl string - AdvocacyLeadUrl string - DesignLeadUrl string + FoundationUrl string } var res ResponseData res.MustWriteTemplate("about.html", TemplateData{ - BaseData: getBaseDataAutocrumb(c, "About"), - FoundationUrl: hmnurl.BuildFoundation(), - RolesUrl: hmnurl.BuildStaffRolesIndex(), - EducationLeadUrl: hmnurl.BuildStaffRole("education"), - AdvocacyLeadUrl: hmnurl.BuildStaffRole("advocacy"), - DesignLeadUrl: hmnurl.BuildStaffRole("design"), + BaseData: getBaseDataAutocrumb(c, "About"), + FoundationUrl: hmnurl.BuildFoundation(), }, c.Perf) return res } diff --git a/todo-styles.md b/todo-styles.md index 06f4d8f..ea09f45 100644 --- a/todo-styles.md +++ b/todo-styles.md @@ -40,4 +40,5 @@ nodemon --exec "esbuild src\rawdata\scss\style.css --bundle --loader:.ttf=file - - [ ] Reduce saturation of --background-even-background - [ ] Update blog styles to not use `post` and other garbage - [ ] Remove from forum.css -- [ ] Remove all uses of .content-block \ No newline at end of file +- [ ] Remove all uses of .content-block +- [ ] Figure out what's up with the projects on the jam pages \ No newline at end of file