Repository navigation
#145 - Auto-build landing page from MkDocs snippets - #147
Conversation
Replace hand-maintained index.html with snippet-driven index.md, Material home template, and shared design tokens. Signed-off-by: Chloe Crozier <chloecrozier@gmail.com>
|
| Filename | Overview |
|---|---|
| docs/javascripts/landing.js | Overlay JS rewritten with module-level overlayState object; Escape handler now reads overlayState.overlay dynamically (fixing the stale-closure issue from the previous thread), with an isConnected guard. |
| overrides/home.html | Minimal Material theme override: injects landing.css/landing.js only on the home page, wraps page.content in .daqiri-landing, and suppresses the Material footer. Correct use of {% block styles/scripts %} with super(). |
| docs/index.md | Replaces hand-maintained index.html with a snippet orchestrator. Front matter correctly sets template: home.html, hides nav/toc/footer, and includes all landing section fragments via pymdownx.snippets. |
| mkdocs.yml | Adds pymdownx.snippets with base_path: [docs] and sets custom_dir: overrides. landing.css/landing.js are intentionally absent from extra_css/extra_javascript (they're injected by the home template only). |
| scripts/check_html_links.py | Docstring updated to reference docs/index.md instead of docs/index.html; functional logic unchanged. Correctly checks only site/index.html since raw HTML href attributes in the landing page aren't validated by MkDocs strict mode. |
| docs/stylesheets/landing.css | Landing page styles scoped to .daqiri-landing; consumes --nv-* tokens from extra.css. Theme-aware via [data-md-color-scheme="slate/default"] selectors. Overlay positioning uses --md-header-height/--md-tabs-height CSS variables. |
| .github/workflows/docs.yml | Adds overrides/** to the CI path filter so changes to the home template correctly trigger the docs build job. Step label updated from "hand-maintained HTML" to "landing page HTML". |
| docs/landing/tutorials.html | Tutorials renumbered 01–06, no Coming Soon placeholders. All six href targets match entries in mkdocs.yml nav. |
Reviews (4): Last reviewed commit: "#145 - Fix landing layout and quick-star..." | Re-trigger Greptile
| if (!bound) { | ||
| document.addEventListener("keydown", function (event) { | ||
| if ( | ||
| event.key === "Escape" && | ||
| graphicOverlay.classList.contains("is-open") | ||
| ) { | ||
| closeGraphicOverlay(graphicOverlay, previousFocusRef); | ||
| } | ||
| }); | ||
| bound = true; | ||
| } |
There was a problem hiding this comment.
Stale
graphicOverlay closure under instant navigation
The module-level bound flag prevents adding a second keydown listener on document, which is correct. However, the closure inside that listener captures graphicOverlay and previousFocusRef from the first call to initLandingGraphic. If navigation.instant is ever added to mkdocs.yml, document$.subscribe(setup) fires on each return visit to the home page, new DOM elements are created, and the click handlers on those elements are correctly re-bound — but the keydown handler still references the orphaned overlay node from the first visit. graphicOverlay.classList.contains("is-open") will always return false on a detached node, so pressing Escape silently stops working after the first navigation away from home.
The fix is to keep a mutable reference (var currentOverlay = null) that the keydown handler reads through rather than closing over a single element, or to scope the listener per-init and track removal.
Beat Material typeset link color so btn-primary keeps black text on green. Signed-off-by: Chloe Crozier <chloecrozier@gmail.com>
Fix overlay Escape handler for instant nav, update link checker docstring, and move inline landing styles into landing.css classes. Signed-off-by: Chloe Crozier <chloecrozier@gmail.com>
Signed-off-by: Chloe Crozier <chloecrozier@gmail.com>
|
@RamyaGuru, I added your suggestion from slack. |
* #145 - Auto-build landing page from MkDocs snippets Replace hand-maintained index.html with snippet-driven index.md, Material home template, and shared design tokens. Clean replay of PR #147 on top of current main after PR #146 landed the light-theme work separately. Signed-off-by: Chloe Crozier <chloecrozier@gmail.com> * #145 - Address landing page review follow-ups Preserve the merged landing copy updates, make the header respond to light and dark themes, keep the logo and header title styling consistent, and use the full DAQIRI title in the generated docs header. Signed-off-by: dleshchev <dleshchev@nvidia.com> --------- Signed-off-by: Chloe Crozier <chloecrozier@gmail.com> Signed-off-by: dleshchev <dleshchev@nvidia.com> Co-authored-by: Chloe Crozier <40836363+chloecrozier@users.noreply.github.com>


Summary
docs/index.htmlwith MkDocs-built landing page (docs/index.md+docs/landing/*.htmlsnippets,overrides/home.html)landing.css/landing.js, CI path foroverrides/**, andpymdownx.snippetsbase_path fixStacked on #146 (
ccrozier-docs-light-theme). Merge #146 first, then re-target this PR tomain.Test plan
mkdocs build --strictpython scripts/check_html_links.py sitepython scripts/check_doc_refs.py/daqiri/— hero, graphic overlay, feature/example/tutorial/news cards, Material tabs