Skip to content

Static page improvements

Josh Wier requested to merge 20240813-jww-static_page_improvements into main

Relates to #66 (closed), #18 (closed), #29 (closed)

Goals:

  • Add breadcrumbs to static pages, which parents determined based on what's in menus.yml (#18 (closed))
  • Allow, for example, /about to map to /about/index.md (This is the issue underlying #66 (closed))
  • Allow use of the "Table of Contents" extension built in to the Markdown library we were already using (#29 (closed))
    • Also take advantage of a TOC extension feature that will decrease the heading level (turn all h1s into h2s, all h2s into h3s, etc) so the heading hierarchy will slot nicely into our page (where "Georgia Historic Newspapers" should be the one and only h1)
    • Customize the Table of Contents to remove any heading that come before the page (so "Contents" doesn't itself end up in the table of contents!)
  • Create a concise syntax for adding videos. (Just use the standard Markdown syntax for images, but if the extension is .mp4 or .mov it will treat it as a video instead of an image. This is apparently what some other Markdown dialects do.)
  • Allow the use of relative paths in the Markdown. For example, if the help/searching.md contains a reference to videos/keyword_search.mp4, it will be rewritten to /help/videos/keyword_search.mp4. If it were to stay a relative path, browsers would treat it differently depending on if you had visited /help/searching vs /help/searching/.
  • Minor style improvements.

Notes:

  • This replaces the Open ONI "staticpages" plugin (previously included as a git submodule) with our own custom code.
  • Our Markdown library has a pretty simple extensions API, and that's how we handle a lot of the Markdown customizations. These is only run as part of the CI/CD, not every time the page is loaded.
  • The changes in _breadcrumbs.scss only affect breadcrumbs that don't actually link to anything. (For now this is just the "Help" breadcrumb because there is no help index page.)
Edited by Josh Wier

Merge request reports

Loading