Skip to content

Docs dates from git - #188

Merged
daveyherrera merged 4 commits into
mainfrom
docs-dates-from-git
Nov 19, 2026
Merged

daveyherrera merged 4 commits into
mainfrom
docs-dates-from-git

Conversation

@daveyherrera

Copy link
Copy Markdown
Collaborator

No description provided.

daveyherrera and others added 4 commits November 19, 2026 16:51
107 of 155 pages render "Published: Not Available · Last Update: Not
Available". The two front matter fields VersioningTracker reads have been
hand-maintained and mostly left empty: 91 pages carry an empty `published`
and 82 an empty `edited`, added by b474121 in 2024 and never filled in.

Supply them from the history instead. plugins/doc-dates walks the commits
once at build time and records, for every page under docs/, the date it
first appeared and the date its body last changed. It hands the result to
the site as global data; VersioningTracker reads that, and front matter
still wins wherever an author set a date deliberately.

Nothing is written to disk. A local dev server shows the same dates as
production, no file is modified by building, and generated dates cannot
end up in a content PR.

What counts as an edit is decided on content, not on the commit: every
historical version is compared with its front matter stripped, so a
metadata rewrite or a move does not move the date. That matters here, as
163 commits in this repository's history fall into that category --
including b474121 itself, which rewrote the front matter of 144 pages.

Also:
- actions/checkout needs fetch-depth: 0 in both workflows. The default
  depth-1 clone has no history; on CI the plugin treats that as an error
  rather than publishing a site that claims every page is new, and off CI
  it warns and carries on so a build without git still works. Not
  `filter: blob:none`: the plugin reads ~1,300 historical versions of the
  markdown, and on a partial clone each becomes its own request to GitHub.
- .docdates-ignore-revs is an escape hatch for a change and its revert,
  which the content comparison cannot see. Nothing in this repository
  qualifies today, so it ships empty.

No change to DocItem/Content or to where the dates appear. Verified with a
local `npm run build`. 65 pages take their published date from the
2023-04-22 initial import, which is when they first appear here; if that is
a migration date rather than a publication date for some of them, a
`published` value in front matter overrides it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
VersioningTracker renders inside the synthetic-title block in
DocItem/Content, so a page that writes its own `#` heading gets no date
line at all -- 28 of 155 pages, which showed nothing rather than "Not
Available". 124 pages already rely on `title:` in front matter and let
Docusaurus render the heading; these had drifted from that convention.

Bring 25 of them back to it, so every page reads title, then dates, then
content:

- 16 pages: the `#` heading duplicated the front matter title, or was an
  empty `#` (develop-lti-advantage-solution). Removed; nothing is lost.
- 9 pages: the heading differed from the title and said more. The heading
  text becomes `title`, and the old shorter value stays as `sidebar_label`,
  so the sidebar and breadcrumbs are unchanged and the page keeps the
  wording a reader sees today. 3lo.md is the clearest case: the sidebar
  still reads "3LO" while the page is titled "Three-Legged OAuth".

The browser tab title now follows the heading on those 9, which is the
point of the change rather than a side effect of it.

Three pages are left alone, because `#` is being used for section headings
rather than a page title and demoting them would restructure the document:

  docs/blackboard/rest-apis/hands-on/copying-courses.md      (3 headings)
  docs/blackboard/rest-apis/hands-on/gradebook.md            (2 headings)
  docs/blackboard/rest-apis/hands-on/groups-and-rest-api.md  (2 headings)

They still render no date line. Worth a separate look at whether those
headings should be `##`.

Verified with a local `npm run build`: 152 of 155 pages render a date line,
and none renders "Not Available".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both opened with a `#` heading and then used `#` again for their major
sections, so Docusaurus took the first one as the page title and the date
line never rendered.

The opening heading moves into front matter as `title`, with the old
shorter value kept as `sidebar_label` so navigation is unchanged. The
remaining `#` sections drop to `##` and their children to `###`, which
preserves every parent-child relationship the documents already had:

  copying-courses.md   # title / ## Topic / # General API Use / ## 1..3
                    -> ## Topic / ## General API Use / ### 1..3
  gradebook.md         same shape, six numbered steps

groups-and-rest-api.md was going to get the same treatment and does not,
because it cannot be fixed this way yet -- see below.

Verified with a local `npm run build`: 154 of 155 pages render a date line.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
09f1b71 (2025-10-22) wrapped bare endpoint paths in backticks across 41
files, which was the right change. On two pages it also rewrote the code
fences: closing ``` became `` or `, opening ```json became `````json, and
one stray ```` was appended at the end of groups-and-rest-api.md.

Markdown does not close a fence on fewer backticks than opened it, so the
pages have been rendering most of their own content as one code block ever
since. On groups-and-rest-api.md that is 626 of 709 lines: 15 of its 18
headings were being served as syntax-highlighted text rather than
headings, and none of it appeared in the page's contents list.

Restored: every fence is three backticks again, and the stray closer is
gone. groups-and-rest-api.md is back to the 46 fences it had before the
upgrade. The backtick-wrapping the upgrade intended, and the later
content changes on top of it, are untouched.

With the page parsing again, its headings could finally be demoted like
the other two: `#` sections become `##`, their children `###`. It has no
title heading to promote -- it opens with prose -- so the front matter
title stands and nothing moves into it.

Left alone: rubrics.md:116,118 and gradebook.md:65 also hold lines that
are a single backtick, but those are inline code spans wrapped across a
newline rather than fences, and both pages parse correctly.

Verified with a local `npm run build`: all 155 pages render a date line,
and the groups page's headings are real h2/h3 anchors again.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@daveyherrera
daveyherrera merged commit 815645a into main Nov 19, 2026
1 check passed
@daveyherrera
daveyherrera deleted the docs-dates-from-git branch November 19, 2026 23:44
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