Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat HDS 2352 enable versioned documentation #1349

Open
wants to merge 9 commits into
base: release-4.0.0
Choose a base branch
from

Conversation

timwessman
Copy link
Contributor

@timwessman timwessman commented Sep 5, 2024

Description

Configured Gatsby to read documentation from different git branches in addition to local files. This makes it possible for a user to select which version of documentation is viewed. Header.ActionBarItem is used to choose versions in a dropdown menu.

Related Issue

Closes HDS-2352

Motivation and Context

When users update their HDS versions, they need to compare changes. Currently, previous versions are only available deep in GitHub, and therefore, they’re difficult to find.

Open issues

  • This PR is kind of a poc of multi-version documentation. To improve the UX, there is a separate design ticket HDS-2387.
  • There is some problem with webpack configuration. WebPack splits prerendered content into so-called "chunks", but building fail with the default config. If there is not much content, splitting doesn't happen, and the building succeeds. So, I made a bigger chunk size to avoid splitting. This needs more investigation if we want more than three versions.
  • All internal link hrefs are replaced with URLs with a version prefix, but for some reason, links in the content of sub-pages of /about, /foundation, and /patterns always link to the latest version. This has to be fixed, but I haven't found a way yet.

How Has This Been Tested?

Demos:

Screenshots (if appropriate):

Add to changelog

  • Added needed line to changelog

Copy link

github-actions bot commented Sep 5, 2024

Test Results

 1 files  30 suites   4m 37s ⏱️
15 tests 15 ✅ 0 💤 0 ❌
30 runs  30 ✅ 0 💤 0 ❌

Results for commit f3181eb.

♻️ This comment has been updated with latest results.

@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch from ae9fb2e to 60b149c Compare September 9, 2024 07:04
@timwessman timwessman marked this pull request as ready for review September 10, 2024 07:44
Copy link
Contributor

@laurakarhu laurakarhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch from 60b149c to 35c1192 Compare October 17, 2024 13:12
@timwessman timwessman changed the base branch from development to release-4.0.0 October 17, 2024 13:17
@timwessman
Copy link
Contributor Author

Fixed Webpack chunking problems and problem of redirecting some internal links. Rebased onto 4.0.0

@timwessman timwessman changed the title WIP: feat HDS 2352 enable versioned documentation feat HDS 2352 enable versioned documentation Oct 17, 2024
Copy link

Preview found from hds-demo docs/preview_1349

Demos

Docs
Core Storybook
React Storybook

@timwessman timwessman force-pushed the HDS-2352-enable-versioned-documentation branch from 46a6c41 to f3181eb Compare October 22, 2024 13:05
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