From 05266bd8ac9049410fae693326bf1da17e66d428 Mon Sep 17 00:00:00 2001 From: Julien Bisconti Date: Sat, 28 Feb 2026 12:13:59 +0100 Subject: [PATCH] Pages deploy ux a11y refresh (#1252) * Improve Pages workflow and redesign site with accessible sidebar navigation * README clean up * Use Makefile website target in Pages deploy workflow --- .github/ISSUE_TEMPLATE/add-a-project.md | 4 +- .github/workflows/deploy-pages.yml | 2 +- .github/workflows/pull_request.yml | 3 + README.md | 2 - config/website.tmpl.html | 714 ++++++++++++++++++++---- index.html | 6 +- internal/builder/builder.go | 2 + internal/builder/builder_test.go | 39 ++ 8 files changed, 655 insertions(+), 117 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/add-a-project.md b/.github/ISSUE_TEMPLATE/add-a-project.md index 2bdd313..1aece63 100644 --- a/.github/ISSUE_TEMPLATE/add-a-project.md +++ b/.github/ISSUE_TEMPLATE/add-a-project.md @@ -1,7 +1,7 @@ --- name: Add a project about: Add a new project to the list -title: "add: [PROJECT_NAME]" +title: "add: [PROJECT_NAME] in [SECTION_NAME]" labels: pending-evaluation assignees: '' @@ -17,5 +17,5 @@ Notes (`:heavy_dollar_sign:` if relevant): Or directly write it: ```markdown -[REPO](https://github.com/AUTHOR/REPO) - DESCRIPTION. By [AUTHOR](https://github.com/AUTHOR) +[REPO](https://github.com/AUTHOR/REPO) - DESCRIPTION. ``` diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 54db0dd..6a12602 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -30,7 +30,7 @@ jobs: run: go build -o awesome-docker ./cmd/awesome-docker - name: Build website - run: ./awesome-docker build + run: make website - name: Upload artifact uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # ratchet:actions/upload-pages-artifact@v4 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index f72cd98..a9e8384 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -20,6 +20,9 @@ jobs: - name: Build run: go build -o awesome-docker ./cmd/awesome-docker + - name: Build website + run: ./awesome-docker build + - name: Validate run: ./awesome-docker validate env: diff --git a/README.md b/README.md index f7efbd5..efd9599 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,6 @@ If this list is not complete, you can [contribute][editreadme] to make it so. He The creators and maintainers of this list do not receive any form of payment to accept a change made by any contributor. This page is not an official Docker product in any way. It is a list of links to projects and is maintained by volunteers. Everybody is welcome to contribute. The goal of this repo is to index open-source projects, not to advertise for profit. -All the links are monitored and tested with a home baked [Node.js script](https://github.com/veggiemonk/awesome-docker/blob/master/.github/workflows/pull_request.yml) - # Contents diff --git a/config/website.tmpl.html b/config/website.tmpl.html index 94e88e0..58ea2cb 100644 --- a/config/website.tmpl.html +++ b/config/website.tmpl.html @@ -6,7 +6,9 @@ Awesome-docker - + + + + + + @@ -201,29 +599,127 @@ -
- - +
+
+
+ diff --git a/index.html b/index.html index 572c816..2cc7b5c 100644 --- a/index.html +++ b/index.html @@ -4,10 +4,10 @@ - + Awesome-docker -

We moved to a new place, click here to be redirected.

+

Redirecting to the generated site.

- \ No newline at end of file + diff --git a/internal/builder/builder.go b/internal/builder/builder.go index 6b2cd20..8e05d53 100644 --- a/internal/builder/builder.go +++ b/internal/builder/builder.go @@ -8,6 +8,7 @@ import ( "github.com/yuin/goldmark" "github.com/yuin/goldmark/extension" + "github.com/yuin/goldmark/parser" "github.com/yuin/goldmark/renderer/html" ) @@ -27,6 +28,7 @@ func Build(markdownPath, templatePath, outputPath string) error { // Convert markdown to HTML gm := goldmark.New( goldmark.WithExtensions(extension.GFM), + goldmark.WithParserOptions(parser.WithAutoHeadingID()), goldmark.WithRendererOptions(html.WithUnsafe()), ) var buf bytes.Buffer diff --git a/internal/builder/builder_test.go b/internal/builder/builder_test.go index 5cf98c3..19ee912 100644 --- a/internal/builder/builder_test.go +++ b/internal/builder/builder_test.go @@ -131,3 +131,42 @@ func TestBuildFailsWithoutPlaceholder(t *testing.T) { t.Fatal("expected Build to fail when template has no supported placeholder") } } + +func TestBuildAddsHeadingIDs(t *testing.T) { + dir := t.TempDir() + + md := "# Getting Started\n\n## Next Step\n" + mdPath := filepath.Join(dir, "README.md") + if err := os.WriteFile(mdPath, []byte(md), 0o644); err != nil { + t.Fatal(err) + } + + tmpl := ` + + +
+ +` + tmplPath := filepath.Join(dir, "template.html") + if err := os.WriteFile(tmplPath, []byte(tmpl), 0o644); err != nil { + t.Fatal(err) + } + + outPath := filepath.Join(dir, "index.html") + if err := Build(mdPath, tmplPath, outPath); err != nil { + t.Fatalf("Build failed: %v", err) + } + + content, err := os.ReadFile(outPath) + if err != nil { + t.Fatal(err) + } + + html := string(content) + if !strings.Contains(html, `id="getting-started"`) { + t.Error("expected auto-generated heading id for h1") + } + if !strings.Contains(html, `id="next-step"`) { + t.Error("expected auto-generated heading id for h2") + } +}