From d7c76afa342c98220281bdadb7fcf2598e48624b Mon Sep 17 00:00:00 2001 From: Chongyi Zheng Date: Tue, 12 Mar 2024 14:02:02 -0400 Subject: Support dark mode theme (#142) * Support dark mode theme * Add dark mode to 404 and package pages * Fix tests --- handler_test.go | 47 +++++++++++++++++++++++++++++++++++++++++++++++ templates/404.html | 5 +++++ templates/index.html | 8 ++++++++ templates/package.html | 7 +++++++ 4 files changed, 67 insertions(+) diff --git a/handler_test.go b/handler_test.go index b8c667b..c88fe9d 100644 --- a/handler_test.go +++ b/handler_test.go @@ -62,6 +62,13 @@ func TestPackageShouldExist(t *testing.T) { + Nothing to see here. Please move along. @@ -77,6 +84,11 @@ func TestNonExistentPackageShould404(t *testing.T) { +
@@ -95,6 +107,13 @@ func TestTrailingSlash(t *testing.T) { + Nothing to see here. Please move along. @@ -111,6 +130,13 @@ func TestDeepImports(t *testing.T) { + Nothing to see here. Please move along. @@ -125,6 +151,13 @@ func TestDeepImports(t *testing.T) { + Nothing to see here. Please move along. @@ -141,6 +174,13 @@ func TestPackageLevelURL(t *testing.T) { + Nothing to see here. Please move along. @@ -312,6 +352,13 @@ func TestCustomTemplates(t *testing.T) { + Nothing to see here. Please move along. diff --git a/templates/404.html b/templates/404.html index ab5b34a..1915091 100644 --- a/templates/404.html +++ b/templates/404.html @@ -2,6 +2,11 @@ +
diff --git a/templates/index.html b/templates/index.html index 8014921..53a41a2 100644 --- a/templates/index.html +++ b/templates/index.html @@ -16,6 +16,14 @@ .table-header { display: block; } .inline-header { display: none; } } + + @media (prefers-color-scheme: dark) { + body { background-color: #333; color: #ddd; } + a { color: #ddd; } + a:visited { color: #bbb; } + .description { color: #bbb; } + .separator { border-color: #666; } + }
diff --git a/templates/package.html b/templates/package.html index 6183c51..281368a 100644 --- a/templates/package.html +++ b/templates/package.html @@ -3,6 +3,13 @@ + Nothing to see here. Please move along. -- cgit v1.2.3 From 9f2ab0b2b6d5764cd138e2fe64590dffe880396d Mon Sep 17 00:00:00 2001 From: Jacob Oaks Date: Mon, 29 Apr 2024 13:39:10 -0400 Subject: CI: Fix golangci-lint installation step Following https://github.com/uber-go/zap/pull/1424 and https://github.com/uber-go/fx/pull/1185 as examples. `--version` is no longer accepted. Use `--help` instead. --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e8e084e..8beec33 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -49,7 +49,7 @@ jobs: name: Install golangci-lint with: version: latest - args: --version # make lint will run the linter + args: --help # make lint will run the linter - run: make lint name: Lint -- cgit v1.2.3 From de16e3c8bca262129abf80187aef7b4390ca92ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 17:51:37 +0000 Subject: Bump golangci/golangci-lint-action from 3 to 5 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3 to 5. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v3...v5) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/go.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 8beec33..5d47587 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -45,7 +45,7 @@ jobs: go-version: 1.21.x cache: false # managed by golangci-lint - - uses: golangci/golangci-lint-action@v3 + - uses: golangci/golangci-lint-action@v5 name: Install golangci-lint with: version: latest -- cgit v1.2.3