Fix: git in Docker builder (page dates) + serve raw .md as text/markdown#225
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two production issues found by testing the deployed site after #223/#224.
1. Docker builder has no
git→ all page dates are missingnode:20-alpineships without git, and Docusaurus derives several things by shelling out togit log:<lastmod>showLastUpdateTime/Author)datePublished/dateModified(JSON-LD)The "Last updated" footer has been silently missing in production on every page — pre-existing, not caused by recent work. Adding
lastmodin #224 is what made it visible.Fix:
RUN apk add --no-cache gitin the builder stage.Requires the build context to include
.git(there is no.dockerignore, so it does today) and a non-shallow checkout. If.gitwere absent the failure mode is simply that dates stay missing — the build does not break.2. Raw
.mdtwins served asapplication/octet-streamThe raw markdown twins at
/docs/**/index.md(emitted byplugins/llms-txt.jsfor LLM/agent consumption) had no mime type, so browsers download them instead of displaying and some crawlers skip them — defeating the purpose.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
🤖 Generated with Claude Code