Skip to content

Show last-modified date only on home page#3

Open
d-morrison wants to merge 11 commits intomainfrom
test-add-content
Open

Show last-modified date only on home page#3
d-morrison wants to merge 11 commits intomainfrom
test-add-content

Conversation

@d-morrison
Copy link
Copy Markdown
Member

@d-morrison d-morrison commented Apr 7, 2026

The date: last-modified setting was applied globally across all pages, causing modification dates to appear on every chapter page unnecessarily.

Changes

  • _quarto-website.yml: Removed date: last-modified and date-format from the global html format
  • index.qmd: Added date: last-modified and date-format to front matter so only the home page displays it

@d-morrison
Copy link
Copy Markdown
Member Author

d-morrison commented Apr 7, 2026

@copilot in PR preview build, all page banners should link to chapter 1, which contains changes, and chapter 1 banner should include link to tracked-changes docx file

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

@copilot in PR preview build, all page banners should link to chapter 1, which contains changes, and chapter 1 banner should include link to tracked-changes docx file

Fixed in commit c5a64c6.

Two changes were made:

  1. create-docx-tracked-changes.py: For new pages where no base DOCX exists in gh-pages, the script now copies the new DOCX as the tracked-changes version instead of skipping it. This ensures chapter 1's tracked-changes DOCX is created even on the first PR.

  2. detect-changed-chapters.py: Changed glob("*.html") to rglob("*.html") so chapters in subdirectories (like chapters/chapter1.html) are properly detected as changed. Also fixed the base path construction to use relative paths instead of the old hardcoded docs/ prefix.

With these fixes, add-home-banner.py will find chapter1-tracked-changes.docx and:

  • Show a "Changes in this PR" banner on all pages linking to chapter 1 (with the tracked-changes DOCX link)
  • Show an "Other Formats" banner on chapter 1 with the tracked-changes DOCX link

@d-morrison
Copy link
Copy Markdown
Member Author

  • remove the document generation metadata altogether; doesn't work well for websites, since it causes every page to register as changed due to new commit SHA
  • remove toc from docx version, since the TOC would always register as changed
  • remove docx links from yellow banners; keep the ones in blue banners

@d-morrison
Copy link
Copy Markdown
Member Author

@copilot

  • remove the document generation metadata altogether; doesn't work well for websites, since it causes every page to register as changed due to new commit SHA
  • remove toc from docx version, since the TOC would always register as changed
  • remove docx links from yellow banners; keep the ones in blue banners

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

@copilot

  • remove the document generation metadata altogether; doesn't work well for websites, since it causes every page to register as changed due to new commit SHA
    ...

Done in commit 1526fd1:

  • Removed {{< include appendix-document-metadata.qmd >}} from index.qmd, chapters/chapter1.qmd, and chapters/chapter2.qmd
  • Removed toc: true and toc-depth: 3 from the docx format in _quarto-website.yml
  • Simplified the yellow banner in add-home-banner.py to link only to changed pages (no tracked-changes DOCX links); the blue "Other Formats" banner retains the tracked-changes DOCX link

Copilot AI changed the title Test add content Fix PR preview banners and change detection for Quarto website Apr 7, 2026
@d-morrison
Copy link
Copy Markdown
Member Author

@copilot remove last-modified info from all pages except home page

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

@copilot remove last-modified info from all pages except home page

Done in commit 4bc81cb. Removed date: last-modified and date-format from the global html format in _quarto-website.yml and added them to index.qmd's front matter, so only the home page displays the last-modified date.

Copilot AI changed the title Fix PR preview banners and change detection for Quarto website Show last-modified date only on home page Apr 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://UCD-SERG.github.io/qwt/pr-preview/pr-3/

Built to branch gh-pages at 2026-04-08 21:38 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

2 participants