-
-
Notifications
You must be signed in to change notification settings - Fork 359
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: add versioning setup #478
Conversation
POC (demo will be available w/ Doks v0.3.5): https://doks-versioning-poc.netlify.app/ |
Just noting on the v0.1.x version it's not showing v0.2.x as the latest or at all in the drop down: https://doks-versioning-poc.netlify.app/docs/0.1/prologue/introduction/ |
Correct, that's because future releases are not known with the present release (the docs pages are versioned). The versions page is not versioned, and always shows all versions. |
Not overly familiar with the nuts and bolts of what is possible regarding hugo, so my intention is to provide food for thought, not delay this in its current form. I had assumed that using a json data source we'd be able to provide the details for each page dynamically instead of doing it this way, however there may be some nuanced limitations to that or a specific reason it doesn't apply here. Maybe that will be something to add later or something more advanced users can take advantage of if hugo doesn't support generation of json data sources itself or doesn't support it in this particular use case? |
Thanks for your input. Yeah, I've thought about that too. I'm not quite sure if /how (preferably no workarounds) that's possible with Hugo. I know that building pages from data source is not yet supported — see also Build pages from data source. Definitely something to keep an eye on, and for a future change for the better. If you have ideas about how to set this up? |
Sadly I do not, I am an absolute novice when it comes to hugo haha! I did get the impression it can kind of be done but not how, and it seems there are a lot of unsolved issues related to versioning for many themes. |
feat: add versioning setup
Set up
./config/_default/params.toml
under[options]
:docsVersioning = true
docsVersion = 1.0
./config/production/config.toml
, setcanonifyURLs = false
./config/_default_/config.toml
under[permalinks]
, setdocs = "/docs/1.0/:sections[1:]/:title/"
./layouts/index.redirects
add:./config/_default/menus.en.toml
, section[[main]]
:./layouts/partials/header/header.html
, section{{ if eq .Site.Params.options.docsVersioning true -}}
, lines 107..122:Update
./data/docs-versions.yml
In Netlify, under Site Settings > Build & deploy > Branches, set Branch deploys to All.
Process
Notes
Features
Resources