Enhance documentation and add support for dark mode in the theme selector#5332
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Switches the documentation site from the custom material template to DocFX's built-in modern template plus a small PnP overlay (templates/pnp-modern) that defines light/dark theme variables and enables the theme selector. Also restructures Build-Site.ps1 to support local builds with parameterized paths and a -SkipPublish switch, and rewrites the local-build documentation accordingly.
Changes:
- Replace
templates/materialwithmodern+ newtemplates/pnp-modern(CSS variables for light/dark themes; JS setsdefaultTheme: "auto"). - Refactor
Build-Site.ps1to compute paths from$PSScriptRoot, add-PublishPath/-SkipPublishparams, wrap work in try/finally to restore the cmdlets index template and clean generated files. - Rewrite
buildingdocumentation.mdto direct contributors to runBuild-Site.ps1 -SkipPublishinstead ofdocfx builddirectly, and refresh the verification checklist for the modern template assets.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pages/templates/pnp-modern/public/main.js | New JS asset setting the modern template's default theme to auto. |
| pages/templates/pnp-modern/public/main.css | New PnP brand overrides for the modern template, with light and dark data-bs-theme variants. |
| pages/templates/material/styles/docfx.js | Tightens search keyword highlight guard (q !== null → q) in the legacy template that is no longer referenced by docfx.json. |
| pages/docfx.json | Switches template stack from default + templates/material to default + modern + templates/pnp-modern; adds _appName. |
| pages/Build-Site.ps1 | Parameterizes paths, adds publish controls, wraps generation in try/finally with cleanup, and uses Join-Path throughout. |
| pages/articles/buildingdocumentation.md | Updates local-build instructions to use Build-Site.ps1 -SkipPublish and refreshes the verification checklist for modern-template assets. |
| function highlightKeywords() { | ||
| var q = url('?q'); | ||
| if (q !== null) { | ||
| if (q) { |
Comment on lines
+249
to
+252
| if (![string]::IsNullOrWhiteSpace($PublishPath)) { | ||
| Write-Host "Copying generated site to $PublishPath" | ||
| Copy-Item -Path (Join-Path $SitePath "*") -Destination $PublishPath -Force -Recurse | ||
| } |
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.
Type
Related Issues?
Improve theme and docs
What is in this Pull Request ?
Use modern theme , support light/dark mode and better local builds