From 05bc67a4814feb9d003b5bf28b176b96f0a901bd Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 9 Oct 2026 15:32:07 +0200 Subject: [PATCH] A "Fork me on GitHub" ribbon instead of the GitHub buttons, as on go-ndarray The nav bar's GitHub button and the hero's "Browse the source" go; the corner ribbon links go-widgets/toolkit, where "Browse the source" led. styles.html and fork-ribbon.html are go-ndarray's, byte for byte (its stylesheet is the shared one plus the ribbon rules), so the sheet stays one file across the orgs. Co-Authored-By: Claude Opus 5.5 --- README.md | 9 ++++++--- layouts/index.html | 3 +-- layouts/partials/fork-ribbon.html | 5 +++++ layouts/partials/styles.html | 11 +++++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 layouts/partials/fork-ribbon.html diff --git a/README.md b/README.md index 862e7cb..b93664f 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,11 @@ The landing page for [go-widgets](https://github.com/go-widgets), built with Hugo and deployed by GitHub Actions to . -It is laid out like the [go-fileshare](https://go-fileshare.github.io/) and -[go-authn](https://go-authn.github.io/) landings. `layouts/partials/styles.html` -is the same file as theirs, byte for byte: it takes its colours from +It is laid out like the [go-fileshare](https://go-fileshare.github.io/) landing, +with the "Fork me on GitHub" ribbon of [go-ndarray](https://go-ndarray.github.io/) +in place of the GitHub buttons. `layouts/partials/styles.html` and +`layouts/partials/fork-ribbon.html` are go-ndarray's files, byte for byte (its +stylesheet is go-fileshare's plus the ribbon): it takes its colours from `[params.brand]` in `hugo.toml`, and only those values differ (go-widgets' teal, from [go-widgets/brand](https://github.com/go-widgets/brand)). Fix the stylesheet in one org, copy it to the others unchanged. @@ -25,6 +27,7 @@ Hugo output while the workflow reports success. |---|---| | `layouts/index.html` | the page | | `layouts/partials/styles.html` | the shared stylesheet and theme toggle script | +| `layouts/partials/fork-ribbon.html` | the corner ribbon, linking `go-widgets/toolkit` | | `layouts/partials/icons/` | Octicons (MIT, `OCTICONS-LICENSE`), copied verbatim | | `hugo.toml` | `[params.brand]`, one `[[params.modules]]` per module, one `[[params.surfaces]]` per surface | diff --git a/layouts/index.html b/layouts/index.html index 580d7c9..7be2ce8 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -13,8 +13,8 @@ go-widgets logo go-widgets {{ partial "theme-toggle.html" . }} - {{ partial "icons/github.html" . }}GitHub + {{ partial "fork-ribbon.html" "https://github.com/go-widgets/toolkit" }}
@@ -23,7 +23,6 @@

One widget tree,
every surface.<
160 widget types7 window back-ends, one OpenCGO=0 on every target

diff --git a/layouts/partials/fork-ribbon.html b/layouts/partials/fork-ribbon.html new file mode 100644 index 0000000..3ef81c6 --- /dev/null +++ b/layouts/partials/fork-ribbon.html @@ -0,0 +1,5 @@ +{{/* The "Fork me on GitHub" corner ribbon (github.blog, 2008), drawn in CSS + with the brand gradient instead of the original PNGs, so it follows the + theme. It replaces the nav bar's GitHub button. Called with the + repository URL: {{ partial "fork-ribbon.html" "https://github.com/o/r" }} */}} + diff --git a/layouts/partials/styles.html b/layouts/partials/styles.html index 3499b6a..becc672 100644 --- a/layouts/partials/styles.html +++ b/layouts/partials/styles.html @@ -115,6 +115,17 @@ .btn-primary:hover{transform:translateY(-1px)} .btn.btn-ghost{border-color:var(--line);color:var(--ink);background:var(--surface-2)} .btn-ghost:hover{border-color:var(--ghost-border-hover)} + {{/* The fork ribbon sits over the page's top-right corner and scrolls away + with the page; the nav bar keeps clear of it until the window is wide + enough for the 1120px column to stop short of the corner. */}} + .fork-ribbon{position:absolute;top:0;right:0;width:150px;height:150px;overflow:hidden;z-index:30;pointer-events:none} + .fork-ribbon a{position:absolute;top:48px;right:-36px;width:200px;padding:7px 0;transform:rotate(45deg); + background:var(--grad);color:#fff;text-align:center;font-weight:700;font-size:13px;letter-spacing:.02em; + box-shadow:0 4px 12px -4px rgba(0,0,0,.45);outline:1px dashed rgba(255,255,255,.55);outline-offset:-4px;pointer-events:auto} + .fork-ribbon a:hover{filter:brightness(1.08)} + .fork-ribbon a:focus-visible{outline:2px solid #fff;outline-offset:-4px} + @media(max-width:1420px){.nav .wrap{padding-right:112px}} + @media(max-width:600px){.fork-ribbon{width:112px;height:112px}.fork-ribbon a{top:34px;right:-52px;font-size:11px;padding:5px 0}.nav .wrap{padding-right:84px}} /* hero */ .hero{padding:74px 0 30px;background: radial-gradient(900px 380px at 78% -8%,{{ $wash | safeCSS }},transparent 60%),