Skip to content

chore(repo): normalize sln line endings and doc OG image URL#191

Draft
ottobolyos wants to merge 2 commits into
TrakHound:masterfrom
ottobolyos:chore/fix-sln-crlf-and-og-url
Draft

chore(repo): normalize sln line endings and doc OG image URL#191
ottobolyos wants to merge 2 commits into
TrakHound:masterfrom
ottobolyos:chore/fix-sln-crlf-and-og-url

Conversation

@ottobolyos
Copy link
Copy Markdown
Contributor

What changed

  • .gitattributes now declares *.sln text eol=crlf so Visual Studio for Windows no longer re-encodes MTConnect.NET.sln on open. Git stores the blob with LF normalization and delivers CRLF to the working tree on every checkout, so Windows contributors stop seeing a dirty diff every time they open the solution.
  • docs/.vitepress/config.ts now derives the canonical Open Graph image URL from DOCS_CANONICAL_URL (defaulting to the GitHub Pages host for this repository). LinkedIn, Slack unfurl, and the classic X crawler require absolute https://… URLs for social-card images; the previous root-relative /logo.png was silently discarded by those crawlers and produced blank social previews. Operators deploying to a custom domain can override the default via DOCS_CANONICAL_URL at workflow level.
  • The landing-page house-style E2E test gains two StartsWith("https://") assertions for og:image and twitter:image so a future regression back to a root-relative path fails the test suite.

Why

Both items are mechanical cleanups that surfaced during a review of the merged docs and solution-wireup PRs but were deferred past merge. Folding them into one chore PR avoids two single-commit train slots.

Verification

  • dotnet build MTConnect.NET.sln — 0 warnings, 0 errors.
  • dotnet test (non-E2E) — all pass.
  • npm run build in docs/ — VitePress build green; og:image and twitter:image render as https://trakhound.github.io/MTConnect.NET/logo.png in the default deploy.
  • docs/scripts/generate-api-ref.sh — 0 errors, 2146 pages generated.

Add `*.sln text eol=crlf` to `.gitattributes` so Git always delivers
CRLF line endings in the working tree for Visual Studio solution files.
Visual Studio for Windows generates a dirty diff each time it opens an
LF-terminated `.sln`; pinning CRLF in the attributes eliminates that
noise for Windows contributors without affecting the normalized LF blob
stored in the object database.
LinkedIn, Slack unfurl, and the classic X crawler reject root-relative
paths for social-card images; an absolute https:// URL is required for
unfurl rendering on those venues. Replace the hard-coded '/logo.png'
value in both og:image and twitter:image with a URL derived from the
DOCS_CANONICAL_URL environment variable, defaulting to the GitHub Pages
host for this repository. Operators deploying to a custom domain override
the default via DOCS_CANONICAL_URL at workflow level.

The landing-page house-style test gains two StartsWith("https://")
assertions for og:image and twitter:image so a future regression back to
a root-relative path fails the E2E suite.
@ottobolyos ottobolyos force-pushed the chore/fix-sln-crlf-and-og-url branch from f319cfc to 323339b Compare June 5, 2026 02:42
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