Skip to content

feat: modernize pull behavior page with Graphviz SSR pipeline - #93

Merged
dscho merged 3 commits into
git-for-windows:mainfrom
jzbakh:add-pull-behavior-page
Jun 19, 2026
Merged

dscho merged 3 commits into
git-for-windows:mainfrom
jzbakh:add-pull-behavior-page

Conversation

@jzbakh

@jzbakh jzbakh commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

This Pull Request modernizes the "Choosing the default behavior of git pull" page by replacing the legacy ASCII art with native Graphviz diagrams. To achieve this without penalizing the end-user with heavy client-side JavaScript, we port the Server-Side Rendering (SSR) pipeline from our sibling sites.

Infrastructure: Graphviz SSR Pipeline

  • Ported the SSR approach from git-scm.com and gitgitgadget.github.io.
  • Render Hook: Added a custom Hugo render hook to intercept ```graphviz code blocks.
  • Build-time Rendering: Added a Node.js script (script/graphviz-ssr.js) executed via GitHub Actions that replaces the markdown code blocks with static, fully computed inline SVG images using viz.js.
  • CSS Alignment: Explicitly styled the generated SVGs (display: block; width: auto;) to prevent the global width: 65% article constraint from stretching the diagrams, ensuring they remain properly left-aligned.
  • Local Development: layouts/_default/baseof.html conditionally injects a client-side fallback exclusively on pages containing diagrams, allowing seamless local development with hugo serve.

Content: Pull Behavior Page

  • ASCII to Graphviz: Replaced all plain-text ASCII diagrams with clean Graphviz visualizations.
  • Formatting: Converted the trailing configuration commands from a single bash block into a more readable bulleted list.

jzbakh added 3 commits June 19, 2026 16:00
This commit introduces the Server-Side Rendering (SSR) pipeline for
Graphviz diagrams, a technique recently pioneered on the git-scm.com
and gitgitgadget.github.io sibling sites. This provides a fast, static
experience without shipping a heavy WebAssembly payload to visitors.

The architecture relies on several coordinated changes. The
layouts/_default/_markup/render-codeblock-graphviz.html hook intercepts
Graphviz blocks, converting them to placeholders and tagging the page.
To identify these pages during the build, hugo.yml is configured to
allow JSON output, and the combination of content/diagram-list.html
with layouts/_default/single.json.json generates a targeted list.

The core rendering logic resides in script/graphviz-ssr.js, which
requires the node-html-parser dependency tracked in package.json.
This script reads the JSON list, processes the HTML files, and replaces
placeholders with SVG images generated by static/js/viz-global.js. We
adjust the SVG output with specific display properties to prevent the
global article CSS constraints from stretching the images.

For CI deployment, .github/workflows/deploy.yml and pr.yml are updated
to install Node.js v6 and execute the SSR script after the Hugo build.
To keep the repository clean, local node dependencies are excluded via
an updated .gitignore. Finally, for local development ergonomics,
layouts/_default/baseof.html dynamically injects a client-side fallback
exclusively on pages containing diagrams.

Assisted-by: Gemini and Claude
Signed-off-by: Jason Zbakh <jzbakh@gmail.com>
Replace the legacy ASCII art diagrams using the newly
integrated Graphviz pipeline. The visualizations are decoupled to
maintain strict arrow proportions and support native browser
zooming without breaking layout alignment.

Signed-off-by: Jason Zbakh <jzbakh@gmail.com>
The configuration commands for modifying the default behavior of `git pull`
were previously grouped into a single block of shell code.

I've converted this block into a bulleted list with distinct bold headings
and embedded code blocks to improve visual consistency with
the rest of the page.

Signed-off-by: Jason Zbakh <jzbakh@gmail.com>
@jzbakh jzbakh changed the title feat: modernize pull behavior page with Graphviz SSR pipelineAdd pull behavior page feat: modernize pull behavior page with Graphviz SSR pipeline Jun 19, 2026
@dscho
dscho merged commit d806c12 into git-for-windows:main Jun 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants