projects

showcase

A public git mirror

feat: add mirror ci, copy-to-clipboard button

daniel daum committed parent 98e37ac commit bcf7967

Showing 32 changed files with 221 additions and 84 deletions.

.gitea/workflows/mirror.yamladded +0 −0

No content changes.

docs/decisions.md +27 −0
@@ -997,3 +997,30 @@ commits look as before.997997- **Reuse key:** includes the verdicts, so commit pages are rebuilt when a998998  key is added in Gitea and old commits turn verified.999999- Icons: Octicons `lock` and `unlock` (19.15.0), added to `scripts/icons.py`.10001001## Copy a file10021003File pages get a copy button joined to Raw (`[Raw | ⧉]`), like GitHub's.10041005- **It copies the raw file.** `copy.js` fetches the Raw link's URL and puts1006  the bytes on the clipboard, so CRLF, mixed line endings and files too1007  big to show (over 512 KB) all copy exactly. That needs `connect-src1008  'self'` in the CSP: the third change to spec rule 6, after `script-src1009  'self'`. It only lets this site's own scripts (`theme.js`, `copy.js`)1010  request this origin. It adds no way out: an injected script could already1011  send data anywhere through `img-src https:`, and the site holds nothing1012  private. Under `base_path` the origin is danieldaum.net and the Raw link1013  is already rebased, so it works there too.1014- **Safari** only allows clipboard writes during the click, so the1015  download is handed to `ClipboardItem` as a promise. Browsers without1016  `ClipboardItem` get `writeText` after the download.1017- **Which files:** text with a raw copy, up to 5 MB (`maxCopy`). Images,1018  binary files and files over 5 MB keep Raw alone.1019- **Trailing blank lines:** chroma drops the empty line after a final1020  newline, so a file ending in blank lines showed one line too few.1021  `Highlight` adds it back, and `TestHighlightKeepsText` checks the lines1022  give back the source.1023- **Hidden without JS, for real now.** `.copy` and `.button` set `display`,1024  which beat the `hidden` attribute, so the clone box's copy button showed1025  without JS too, contrary to "Copy buttons need JS". `[hidden]` rules for1026  both fix it.
docs/security.md +4 −0
@@ -46,6 +46,10 @@ enforces it and the test that proves it. Run them all with `just test`.4646  allows exactly that one script tag and nothing else.4747- Repo SVGs on `raw/` stay `text/plain` even though `/static` serves our own4848  icons as `image/svg+xml` (covered by `TestRoutes`).49- The CSP now has `connect-src 'self'` (2026-11-24), so `copy.js` can fetch50  the raw file a file page's copy button copies. Requests go to this origin51  only; `img-src https:` was already a wider way out. See decisions, "Copy52  a file".49535054## Second review (2026-11-23)5155
internal/build/repo.go +3 −0
@@ -22,6 +22,7 @@ import (2222const (2323	maxRender = 512 << 10 // larger files get no highlighted view2424	maxRaw    = 50 << 20  // larger files get no raw copy25	maxCopy   = 5 << 20   // larger files get no copy button: too much for a clipboard2526)26272728// repo is one allowlisted repo with its API metadata and local mirror.@@ -178,6 +179,7 @@ type BlobPage struct {178179	Lines         []template.HTML179180	Image, Binary bool180181	Large         bool // too big to render; Raw is "" if too big to keep182	Copy          bool // text with a raw copy, small enough for the copy button181183}182184183185// loadRepo fetches metadata and updates the mirror. Anonymous access means a@@ -427,6 +429,7 @@ func (b *Builder) renderBlob(ctx context.Context, rd *render.Renderer, dir strin427429		}428430	}429431	p.Large = e.Size > maxRender432	p.Copy = p.Raw != "" && !p.Binary && e.Size <= maxCopy430433	// blob pages are stored as <path>.html; the server maps /blob/<path> to them431434	return rd.Write(dir, r.Name+"/blob/"+e.Name+".html", "blob", render.Page{Title: e.Name + " · " + r.Name, D: &p})432435}
internal/render/highlight.go +4 −1
@@ -25,7 +25,7 @@ func Highlight(name, lang, src string) []template.HTML {2525	if lx == nil {2626		lx = lexers.Fallback2727	}28	src = strings.TrimSuffix(src, "\n")28	src = strings.TrimSuffix(strings.TrimSuffix(src, "\n"), "\r") // the last line's ending2929	it, err := chroma.Coalesce(lx).Tokenise(nil, src)3030	if err != nil {3131		it = chroma.Literator(chroma.Token{Type: chroma.Text, Value: src})@@ -43,6 +43,9 @@ func Highlight(name, lang, src string) []template.HTML {4343		}4444		lines = append(lines, template.HTML(b.String()))4545	}46	if strings.HasSuffix(src, "\n") { // chroma drops the empty line after a final newline47		lines = append(lines, "")48	}4649	return lines4750}4851
internal/render/highlight_test.goadded +31 −0
@@ -0,0 +1,31 @@1package render23import (4	"html"5	"regexp"6	"strings"7	"testing"8)910// TestHighlightKeepsText: the lines' text, joined, gives back the source,11// trailing blank lines included, so line counts are right.12func TestHighlightKeepsText(t *testing.T) {13	tags := regexp.MustCompile(`<[^>]*>`)14	for _, src := range []string{"a\nb", "a\nb\n", "a\n\n", "a\n\n\n", "\n", "\tif x {\n\t\treturn\n\t}\n", "<b>&amp;</b>\n", "x\r\ny\r\n"} {15		var lines []string16		for _, l := range Highlight("f.go", "", src) {17			lines = append(lines, html.UnescapeString(tags.ReplaceAllString(string(l), "")))18		}19		nl := "\n"20		if strings.Contains(src, "\r\n") {21			nl = "\r\n" // chroma drops the \r22		}23		got := strings.Join(lines, nl)24		if strings.HasSuffix(src, "\n") {25			got += nl26		}27		if got != src {28			t.Errorf("%q: %d lines give back %q", src, len(lines), got)29		}30	}31}
internal/server/server.go +3 −2
@@ -22,8 +22,9 @@ import (2222)23232424// script-src 'self' is only for /static/theme.js (palette) and copy.js (copy25// buttons); nothing inline.26const csp = "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' https:; font-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'"25// buttons); nothing inline. connect-src 'self' lets copy.js fetch the raw26// file it copies, from this origin only.27const csp = "default-src 'none'; connect-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' https:; font-src 'self'; base-uri 'none'; form-action 'none'; frame-ancestors 'none'"27282829type Server struct {2930	Cfg   *config.Config
testdata/golden/index.html +3 −3
@@ -21,9 +21,9 @@2121<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">2222<link rel="manifest" href="/static/favicon/site.webmanifest">2323<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">24<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">25<script src="/static/theme.js?v=98918dcfb2"></script>26<script src="/static/copy.js?v=98918dcfb2" defer></script>24<link rel="stylesheet" href="/static/style.css?v=1853683256">25<script src="/static/theme.js?v=1853683256"></script>26<script src="/static/copy.js?v=1853683256" defer></script>2727</head>2828<body>2929<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/blob/README.md.html +8 −5
@@ -10,13 +10,13 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>19<svg class="sprite" width="0" height="0" aria-hidden="true" focusable="false"><symbol id="i-tag" viewBox="0 0 16 16"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"/></symbol><symbol id="i-history" viewBox="0 0 16 16"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"/></symbol><symbol id="i-branch" viewBox="0 0 16 16"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"/></symbol><symbol id="i-check" viewBox="0 0 16 16"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"/></symbol><symbol id="i-link" viewBox="0 0 16 16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"/></symbol><symbol id="i-law" viewBox="0 0 16 16"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"/></symbol><symbol id="i-package" viewBox="0 0 16 16"><path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"/></symbol><symbol id="f-readme" viewBox="0 0 16 16" fill="none"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 1C4.136 1 1 4.136 1 8s3.136 7 7 7 7-3.136 7-7-3.136-7-7-7m1 11H7V7.5h2zm0-6H7V4h2z"/></symbol><symbol id="i-download" viewBox="0 0 16 16"><path d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"/><path d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"/></symbol></svg>19<svg class="sprite" width="0" height="0" aria-hidden="true" focusable="false"><symbol id="i-tag" viewBox="0 0 16 16"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"/></symbol><symbol id="i-history" viewBox="0 0 16 16"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"/></symbol><symbol id="i-branch" viewBox="0 0 16 16"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"/></symbol><symbol id="i-check" viewBox="0 0 16 16"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"/></symbol><symbol id="i-link" viewBox="0 0 16 16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"/></symbol><symbol id="i-law" viewBox="0 0 16 16"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"/></symbol><symbol id="i-package" viewBox="0 0 16 16"><path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"/></symbol><symbol id="f-readme" viewBox="0 0 16 16" fill="none"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 1C4.136 1 1 4.136 1 8s3.136 7 7 7 7-3.136 7-7-3.136-7-7-7m1 11H7V7.5h2zm0-6H7V4h2z"/></symbol><symbol id="i-download" viewBox="0 0 16 16"><path d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"/><path d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"/></symbol><symbol id="i-copy" viewBox="0 0 16 16"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"/><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"/></symbol></svg>2020<header class="site-header">2121  <a class="site-name" href="https://danieldaum.net">Daniel Daum</a>2222  <nav aria-label="main navigation">@@ -59,7 +59,10 @@5959<section class="box">6060  <div class="box-head file-head">6161    <svg class="ficon" width="16" height="16" aria-hidden="true" focusable="false"><use href="#f-readme"></use></svg><span class="file-name">README.md</span>62    <span class="file-stats">439 B · 24 lines</span><a class="button button--small" href="/repo-a/raw/README.md"><svg class="icon icon-download" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-download"></use></svg>Raw</a>62    <span class="file-stats">439 B · 24 lines</span>63    <span class="button-group">64      <a class="button button--small" id="file-raw" href="/repo-a/raw/README.md"><svg class="icon icon-download" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-download"></use></svg>Raw</a><button class="button button--small button--copy" type="button" data-copy="file-raw" hidden title="Copy file"><svg class="icon icon-copy" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-copy"></use></svg><svg class="icon icon-check" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-check"></use></svg><span class="sr-only">Copy file</span></button>65    </span>6366  </div>6467  <pre class="code"><code><span class="line" id="L1"><a class="ln" href="#L1" aria-hidden="true">1</a><span class="hl-heading"># repo-a</span></span><span class="line" id="L2"><a class="ln" href="#L2" aria-hidden="true">2</a></span><span class="line" id="L3"><a class="ln" href="#L3" aria-hidden="true">3</a>A tiny fixture repo. See the [<span class="hl-variable">guide</span>](<span class="hl-variable">docs/guide.md</span>), the [<span class="hl-variable">docs folder</span>](<span class="hl-variable">docs/</span>)</span><span class="line" id="L4"><a class="ln" href="#L4" aria-hidden="true">4</a>and [<span class="hl-variable">the section below</span>](<span class="hl-variable">#usage</span>).</span><span class="line" id="L5"><a class="ln" href="#L5" aria-hidden="true">5</a></span><span class="line" id="L6"><a class="ln" href="#L6" aria-hidden="true">6</a>![<span class="hl-variable">logo</span>](<span class="hl-variable">docs/logo.png</span>)</span><span class="line" id="L7"><a class="ln" href="#L7" aria-hidden="true">7</a>![<span class="hl-variable">remote</span>](<span class="hl-variable">https://example.com/badge.svg</span>)</span><span class="line" id="L8"><a class="ln" href="#L8" aria-hidden="true">8</a>![<span class="hl-variable">tracker</span>](<span class="hl-variable">http://tracker.example/pixel.gif</span>)</span><span class="line" id="L9"><a class="ln" href="#L9" aria-hidden="true">9</a></span><span class="line" id="L10"><a class="ln" href="#L10" aria-hidden="true">10</a>&lt;script&gt;alert(&#34;raw html must not render&#34;)&lt;/script&gt;</span><span class="line" id="L11"><a class="ln" href="#L11" aria-hidden="true">11</a></span><span class="line" id="L12"><a class="ln" href="#L12" aria-hidden="true">12</a>[<span class="hl-variable">bad link</span>](<span class="hl-variable">javascript:alert(1</span>))</span><span class="line" id="L13"><a class="ln" href="#L13" aria-hidden="true">13</a></span><span class="line" id="L14"><a class="ln" href="#L14" aria-hidden="true">14</a><span class="hl-heading">## Usage</span></span><span class="line" id="L15"><a class="ln" href="#L15" aria-hidden="true">15</a></span><span class="line" id="L16"><a class="ln" href="#L16" aria-hidden="true">16</a><span class="hl-string">```sh</span></span><span class="line" id="L17"><a class="ln" href="#L17" aria-hidden="true">17</a>go run ./cmd/hello</span><span class="line" id="L18"><a class="ln" href="#L18" aria-hidden="true">18</a><span class="hl-string">```</span></span><span class="line" id="L19"><a class="ln" href="#L19" aria-hidden="true">19</a></span><span class="line" id="L20"><a class="ln" href="#L20" aria-hidden="true">20</a>| flag | default |</span><span class="line" id="L21"><a class="ln" href="#L21" aria-hidden="true">21</a>| :--- | ------: |</span><span class="line" id="L22"><a class="ln" href="#L22" aria-hidden="true">22</a>| <span class="hl-string">`-v`</span> | off     |</span><span class="line" id="L23"><a class="ln" href="#L23" aria-hidden="true">23</a></span><span class="line" id="L24"><a class="ln" href="#L24" aria-hidden="true">24</a>- [x] task lists render</span></code></pre>6568</section>
testdata/golden/repo-a/blob/big.txt.html +8 −5
@@ -10,13 +10,13 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>19<svg class="sprite" width="0" height="0" aria-hidden="true" focusable="false"><symbol id="i-tag" viewBox="0 0 16 16"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"/></symbol><symbol id="i-history" viewBox="0 0 16 16"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"/></symbol><symbol id="i-branch" viewBox="0 0 16 16"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"/></symbol><symbol id="i-check" viewBox="0 0 16 16"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"/></symbol><symbol id="i-link" viewBox="0 0 16 16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"/></symbol><symbol id="i-law" viewBox="0 0 16 16"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"/></symbol><symbol id="i-package" viewBox="0 0 16 16"><path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"/></symbol><symbol id="f-document" viewBox="0 0 24 24" fill="none"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></symbol><symbol id="i-download" viewBox="0 0 16 16"><path d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"/><path d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"/></symbol></svg>19<svg class="sprite" width="0" height="0" aria-hidden="true" focusable="false"><symbol id="i-tag" viewBox="0 0 16 16"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"/></symbol><symbol id="i-history" viewBox="0 0 16 16"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"/></symbol><symbol id="i-branch" viewBox="0 0 16 16"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"/></symbol><symbol id="i-check" viewBox="0 0 16 16"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"/></symbol><symbol id="i-link" viewBox="0 0 16 16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"/></symbol><symbol id="i-law" viewBox="0 0 16 16"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"/></symbol><symbol id="i-package" viewBox="0 0 16 16"><path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"/></symbol><symbol id="f-document" viewBox="0 0 24 24" fill="none"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></symbol><symbol id="i-download" viewBox="0 0 16 16"><path d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"/><path d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"/></symbol><symbol id="i-copy" viewBox="0 0 16 16"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"/><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"/></symbol></svg>2020<header class="site-header">2121  <a class="site-name" href="https://danieldaum.net">Daniel Daum</a>2222  <nav aria-label="main navigation">@@ -59,7 +59,10 @@5959<section class="box">6060  <div class="box-head file-head">6161    <svg class="ficon" width="16" height="16" aria-hidden="true" focusable="false"><use href="#f-document"></use></svg><span class="file-name">big.txt</span>62    <span class="file-stats">640.0 KB</span><a class="button button--small" href="/repo-a/raw/big.txt"><svg class="icon icon-download" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-download"></use></svg>Raw</a>62    <span class="file-stats">640.0 KB</span>63    <span class="button-group">64      <a class="button button--small" id="file-raw" href="/repo-a/raw/big.txt"><svg class="icon icon-download" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-download"></use></svg>Raw</a><button class="button button--small button--copy" type="button" data-copy="file-raw" hidden title="Copy file"><svg class="icon icon-copy" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-copy"></use></svg><svg class="icon icon-check" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-check"></use></svg><span class="sr-only">Copy file</span></button>65    </span>6366  </div>6467  <p class="box-note">This file is too large to show here. Use the raw link to view it.</p>6568</section>
testdata/golden/repo-a/blob/cmd/hello/main.go.html +8 −5
@@ -10,13 +10,13 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>19<svg class="sprite" width="0" height="0" aria-hidden="true" focusable="false"><symbol id="i-tag" viewBox="0 0 16 16"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"/></symbol><symbol id="i-history" viewBox="0 0 16 16"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"/></symbol><symbol id="i-branch" viewBox="0 0 16 16"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"/></symbol><symbol id="i-check" viewBox="0 0 16 16"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"/></symbol><symbol id="i-link" viewBox="0 0 16 16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"/></symbol><symbol id="i-law" viewBox="0 0 16 16"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"/></symbol><symbol id="i-package" viewBox="0 0 16 16"><path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"/></symbol><symbol id="f-go" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></symbol><symbol id="i-download" viewBox="0 0 16 16"><path d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"/><path d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"/></symbol></svg>19<svg class="sprite" width="0" height="0" aria-hidden="true" focusable="false"><symbol id="i-tag" viewBox="0 0 16 16"><path d="M1 7.775V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.752 1.752 0 0 1 1 7.775Zm1.5 0c0 .066.026.13.073.177l6.25 6.25a.25.25 0 0 0 .354 0l5.025-5.025a.25.25 0 0 0 0-.354l-6.25-6.25a.25.25 0 0 0-.177-.073H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z"/></symbol><symbol id="i-history" viewBox="0 0 16 16"><path d="m.427 1.927 1.215 1.215a8.002 8.002 0 1 1-1.6 5.685.75.75 0 1 1 1.493-.154 6.5 6.5 0 1 0 1.18-4.458l1.358 1.358A.25.25 0 0 1 3.896 6H.25A.25.25 0 0 1 0 5.75V2.104a.25.25 0 0 1 .427-.177ZM7.75 4a.75.75 0 0 1 .75.75v2.992l2.028.812a.75.75 0 0 1-.557 1.392l-2.5-1A.751.751 0 0 1 7 8.25v-3.5A.75.75 0 0 1 7.75 4Z"/></symbol><symbol id="i-branch" viewBox="0 0 16 16"><path d="M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"/></symbol><symbol id="i-check" viewBox="0 0 16 16"><path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"/></symbol><symbol id="i-link" viewBox="0 0 16 16"><path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"/></symbol><symbol id="i-law" viewBox="0 0 16 16"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"/></symbol><symbol id="i-package" viewBox="0 0 16 16"><path d="m8.878.392 5.25 3.045c.54.314.872.89.872 1.514v6.098a1.75 1.75 0 0 1-.872 1.514l-5.25 3.045a1.75 1.75 0 0 1-1.756 0l-5.25-3.045A1.75 1.75 0 0 1 1 11.049V4.951c0-.624.332-1.201.872-1.514L7.122.392a1.75 1.75 0 0 1 1.756 0ZM7.875 1.69l-4.63 2.685L8 7.133l4.755-2.758-4.63-2.685a.248.248 0 0 0-.25 0ZM2.5 5.677v5.372c0 .09.047.171.125.216l4.625 2.683V8.432Zm6.25 8.271 4.625-2.683a.25.25 0 0 0 .125-.216V5.677L8.75 8.432Z"/></symbol><symbol id="f-go" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></symbol><symbol id="i-download" viewBox="0 0 16 16"><path d="M2.75 14A1.75 1.75 0 0 1 1 12.25v-2.5a.75.75 0 0 1 1.5 0v2.5c0 .138.112.25.25.25h10.5a.25.25 0 0 0 .25-.25v-2.5a.75.75 0 0 1 1.5 0v2.5A1.75 1.75 0 0 1 13.25 14Z"/><path d="M7.25 7.689V2a.75.75 0 0 1 1.5 0v5.689l1.97-1.969a.749.749 0 1 1 1.06 1.06l-3.25 3.25a.749.749 0 0 1-1.06 0L4.22 6.78a.749.749 0 1 1 1.06-1.06l1.97 1.969Z"/></symbol><symbol id="i-copy" viewBox="0 0 16 16"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"/><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"/></symbol></svg>2020<header class="site-header">2121  <a class="site-name" href="https://danieldaum.net">Daniel Daum</a>2222  <nav aria-label="main navigation">@@ -59,7 +59,10 @@5959<section class="box">6060  <div class="box-head file-head">6161    <svg class="ficon" width="16" height="16" aria-hidden="true" focusable="false"><use href="#f-go"></use></svg><span class="file-name">main.go</span>62    <span class="file-stats">72 B · 5 lines</span><a class="button button--small" href="/repo-a/raw/cmd/hello/main.go"><svg class="icon icon-download" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-download"></use></svg>Raw</a>62    <span class="file-stats">72 B · 5 lines</span>63    <span class="button-group">64      <a class="button button--small" id="file-raw" href="/repo-a/raw/cmd/hello/main.go"><svg class="icon icon-download" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-download"></use></svg>Raw</a><button class="button button--small button--copy" type="button" data-copy="file-raw" hidden title="Copy file"><svg class="icon icon-copy" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-copy"></use></svg><svg class="icon icon-check" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-check"></use></svg><span class="sr-only">Copy file</span></button>65    </span>6366  </div>6467  <pre class="code"><code><span class="line" id="L1"><a class="ln" href="#L1" aria-hidden="true">1</a><span class="hl-keyword">package</span> main</span><span class="line" id="L2"><a class="ln" href="#L2" aria-hidden="true">2</a></span><span class="line" id="L3"><a class="ln" href="#L3" aria-hidden="true">3</a><span class="hl-keyword">import</span> <span class="hl-string">&#34;fmt&#34;</span></span><span class="line" id="L4"><a class="ln" href="#L4" aria-hidden="true">4</a></span><span class="line" id="L5"><a class="ln" href="#L5" aria-hidden="true">5</a><span class="hl-keyword">func</span> <span class="hl-function">main</span><span class="hl-punct">()</span> <span class="hl-punct">{</span> fmt<span class="hl-punct">.</span><span class="hl-function">Println</span><span class="hl-punct">(</span><span class="hl-string">&#34;hello, world&#34;</span><span class="hl-punct">)</span> <span class="hl-punct">}</span></span></code></pre>6568</section>
testdata/golden/repo-a/blob/data.bin.html +7 −4
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>@@ -59,7 +59,10 @@5959<section class="box">6060  <div class="box-head file-head">6161    <svg class="ficon" width="16" height="16" aria-hidden="true" focusable="false"><use href="#f-file"></use></svg><span class="file-name">data.bin</span>62    <span class="file-stats">8 B</span><a class="button button--small" href="/repo-a/raw/data.bin"><svg class="icon icon-download" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-download"></use></svg>Raw</a>62    <span class="file-stats">8 B</span>63    <span class="button-group">64      <a class="button button--small" id="file-raw" href="/repo-a/raw/data.bin"><svg class="icon icon-download" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-download"></use></svg>Raw</a>65    </span>6366  </div>6467  <p class="box-note">Binary file, not shown. Use the raw link to download it.</p>6568</section>
testdata/golden/repo-a/blob/docs/logo.png.html +7 −4
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>@@ -59,7 +59,10 @@5959<section class="box">6060  <div class="box-head file-head">6161    <svg class="ficon" width="16" height="16" aria-hidden="true" focusable="false"><use href="#f-image"></use></svg><span class="file-name">logo.png</span>62    <span class="file-stats">8 B</span><a class="button button--small" href="/repo-a/raw/docs/logo.png"><svg class="icon icon-download" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-download"></use></svg>Raw</a>62    <span class="file-stats">8 B</span>63    <span class="button-group">64      <a class="button button--small" id="file-raw" href="/repo-a/raw/docs/logo.png"><svg class="icon icon-download" width="16" height="16" fill="currentColor" aria-hidden="true" focusable="false"><use href="#i-download"></use></svg>Raw</a>65    </span>6366  </div>6467  <div class="box-note file-image"><img src="/repo-a/raw/docs/logo.png" alt="docs/logo.png"></div>6568</section>
testdata/golden/repo-a/branches/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/commit-latest.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/index.html +3 −3
@@ -11,9 +11,9 @@1111<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1212<link rel="manifest" href="/static/favicon/site.webmanifest">1313<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">14<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">15<script src="/static/theme.js?v=98918dcfb2"></script>16<script src="/static/copy.js?v=98918dcfb2" defer></script>14<link rel="stylesheet" href="/static/style.css?v=1853683256">15<script src="/static/theme.js?v=1853683256"></script>16<script src="/static/copy.js?v=1853683256" defer></script>1717</head>1818<body>1919<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/issues/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/log/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/packages/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/pulls/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/releases/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/tags/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/tree/cmd/hello/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-a/tree/docs/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-b/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-b/issues/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-b/log/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repo-b/releases/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
testdata/golden/repos/index.html +3 −3
@@ -10,9 +10,9 @@1010<link rel="apple-touch-icon" sizes="180x180" href="/static/favicon/apple-touch-icon.png">1111<link rel="manifest" href="/static/favicon/site.webmanifest">1212<link rel="alternate" type="application/atom+xml" title="daniel daum" href="https://danieldaum.net/feed.xml">13<link rel="stylesheet" href="/static/style.css?v=98918dcfb2">14<script src="/static/theme.js?v=98918dcfb2"></script>15<script src="/static/copy.js?v=98918dcfb2" defer></script>13<link rel="stylesheet" href="/static/style.css?v=1853683256">14<script src="/static/theme.js?v=1853683256"></script>15<script src="/static/copy.js?v=1853683256" defer></script>1616</head>1717<body>1818<a class="skip-link" href="#site-main">skip to content</a>
web/static/copy.js +17 −4
@@ -1,17 +1,30 @@11// Copy buttons, as progressive enhancement: without JS the buttons stay2// hidden and the read-only fields can be selected and copied by hand. This is3// the only script on the site; the CSP allows nothing inline.2// hidden and the text can still be copied by hand. data-copy names a3// read-only field, whose value is copied, or a link to a raw file, which is4// fetched and copied as it is (the CSP allows fetches to this origin only).5// Nothing inline: the CSP forbids it.6function copyFile(url) {7    const file = fetch(url).then((r) => (r.ok ? r.blob() : Promise.reject(new Error(r.statusText))));8    // Safari only allows clipboard writes during the click, so the9    // download goes in as a promise; elsewhere writeText after it is fine.10    if (window.ClipboardItem) {11        const blob = file.then((b) => new Blob([b], { type: "text/plain" }));12        return navigator.clipboard.write([new ClipboardItem({ "text/plain": blob })]);13    }14    return file.then((b) => b.text()).then((t) => navigator.clipboard.writeText(t));15}16417for (const button of document.querySelectorAll("button[data-copy]")) {518    const field = document.getElementById(button.dataset.copy);619    if (!field || !navigator.clipboard) continue;720    button.hidden = false;821    button.addEventListener("click", async () => {922        try {10            await navigator.clipboard.writeText(field.value);23            await (field.href ? copyFile(field.href) : navigator.clipboard.writeText(field.value));1124            button.classList.add("copied");1225            setTimeout(() => button.classList.remove("copied"), 1500);1326        } catch {14            field.select();27            field.select?.();1528        }1629    });1730}
web/static/style.css +37 −2
@@ -1757,15 +1757,50 @@ a.sha--verified:hover {17571757}1758175817591759.copy .icon-check,1760.copy.copied .icon-copy {1760.copy.copied .icon-copy,1761.button--copy .icon-check,1762.button--copy.copied .icon-copy {17611763    display: none;17621764}176317651764.copy.copied .icon-check {1766.copy.copied .icon-check,1767.button--copy.copied .icon-check {17651768    display: inline-block;17661769    color: var(--add);17671770}176817711772/* Raw and copy on file pages, joined like one split button. Without JS the1773   copy button stays hidden and Raw keeps its own corners. */1774.button-group {1775    display: inline-flex;1776}17771778.button-group > .button:has(+ .button:not([hidden])) {1779    border-top-right-radius: 0;1780    border-bottom-right-radius: 0;1781}17821783.button-group > .button + .button {1784    margin-left: -1px;1785    border-top-left-radius: 0;1786    border-bottom-left-radius: 0;1787}17881789.button-group > .button:hover,1790.button-group > .button:focus-visible {1791    position: relative; /* the hovered edge draws over its neighbour's */1792}17931794.button--copy {1795    cursor: pointer;1796}17971798/* their display rules would otherwise beat [hidden]: copy.js reveals them */1799.copy[hidden],1800.button--copy[hidden] {1801    display: none;1802}180317691804/* boxes: the one container for listings, files, readmes and diffs */17701805.box {17711806    margin-bottom: 1.25rem;
web/templates/blob.html +6 −1
@@ -5,7 +5,12 @@55  <div class="box-head file-head">66    {{ficon .Name "blob"}}<span class="file-name">{{.Name}}</span>77    <span class="file-stats">{{size .Size}}{{with .Lines}} · {{len .}} line{{if ne (len .) 1}}s{{end}}{{end}}</span>8    {{- with .Raw}}<a class="button button--small" href="{{.}}">{{template "icon" "download"}}Raw</a>{{end}}8    {{- with .Raw}}9    <span class="button-group">10      <a class="button button--small" id="file-raw" href="{{.}}">{{template "icon" "download"}}Raw</a>11      {{- if $.Copy}}<button class="button button--small button--copy" type="button" data-copy="file-raw" hidden title="Copy file">{{template "icon" "copy"}}{{template "icon" "check"}}<span class="sr-only">Copy file</span></button>{{end}}12    </span>13    {{- end}}914  </div>1015  {{- if .Lines}}1116  <pre class="code"><code>