Skip to content

Fix: git in Docker builder (page dates) + serve raw .md as text/markdown#225

Merged
buddies2705 merged 2 commits into
mainfrom
fix/docker-git-lastmod
Jul 25, 2026
Merged

Fix: git in Docker builder (page dates) + serve raw .md as text/markdown#225
buddies2705 merged 2 commits into
mainfrom
fix/docker-git-lastmod

Conversation

@buddies2705

@buddies2705 buddies2705 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Two production issues found by testing the deployed site after #223/#224.

1. Docker builder has no git → all page dates are missing

node:20-alpine ships without git, and Docusaurus derives several things by shelling out to git log:

Feature Live site Same commit built locally (git present)
sitemap <lastmod> ❌ 0 of 573 URLs ✅ 532 entries
"Last updated on … by …" footer (showLastUpdateTime/Author) ❌ missing on all pages ✅ present
TechArticle datePublished/dateModified (JSON-LD) ❌ missing ✅ present

The "Last updated" footer has been silently missing in production on every page — pre-existing, not caused by recent work. Adding lastmod in #224 is what made it visible.

Fix: RUN apk add --no-cache git in the builder stage.

Requires the build context to include .git (there is no .dockerignore, so it does today) and a non-shallow checkout. If .git were absent the failure mode is simply that dates stay missing — the build does not break.

2. Raw .md twins served as application/octet-stream

The raw markdown twins at /docs/**/index.md (emitted by plugins/llms-txt.js for LLM/agent consumption) had no mime type, so browsers download them instead of displaying and some crawlers skip them — defeating the purpose.

curl -sI https://docs.bitquery.io/docs/graphql/data-coverage-retention/index.md
-> content-type: application/octet-stream

Fix: nginx regex location setting default_type text/markdown + charset utf-8.

Testing note

I could not build the Docker image locally (no Docker in my environment) and nginx isn't installed to run nginx -t — the config was checked structurally (balanced braces, all directives terminated). Please confirm the image builds and nginx starts cleanly on deploy.

Verification after deploy

curl -s https://docs.bitquery.io/sitemap.xml | grep -c "<lastmod>"          # expect ~530, currently 0
curl -sI https://docs.bitquery.io/docs/graphql/data-coverage-retention/index.md | grep -i content-type   # expect text/markdown

🤖 Generated with Claude Code

Gaurav agarwal and others added 2 commits July 25, 2026 11:14
node:20-alpine ships without git, and Docusaurus derives several things by
shelling out to `git log`:

  - sitemap <lastmod>            (added in #224 — currently emits nothing live)
  - "Last updated on … by …"     (showLastUpdateTime/Author — silently missing
                                  in production on ALL pages, pre-existing)
  - TechArticle datePublished/dateModified (tech-article-jsonld plugin)

Verified on the deployed site: 0 <lastmod> in sitemap.xml, no "Last updated"
footer, and no date fields in the TechArticle JSON-LD — while the same commit
built locally (where git exists) produces 532 <lastmod> entries and full dates.

Adding `apk add --no-cache git` to the builder stage fixes all three.

Requires the build context to include .git (there is no .dockerignore, so it
does today) and a non-shallow checkout.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The raw markdown twins emitted at /docs/**/index.md (for LLM/agent
consumption) were served as application/octet-stream because nginx has no
mime type for .md — browsers download them instead of displaying, and some
crawlers skip non-text content types, which defeats the purpose of the file.

Add a regex location setting default_type text/markdown + charset utf-8.

Verified live before the fix:
  curl -sI .../docs/graphql/data-coverage-retention/index.md
  -> content-type: application/octet-stream

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@buddies2705 buddies2705 changed the title Fix: install git in Docker builder so sitemap lastmod & page dates generate Fix: git in Docker builder (page dates) + serve raw .md as text/markdown Jul 25, 2026
@buddies2705
buddies2705 merged commit 8dedd0f into main Jul 25, 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.

1 participant