Replies: 3 comments 3 replies
-
|
Hi, I think this largely depends on what is your exact use case. The doc versioning you've linked was designed to provide links to versioned urls, and that's about it - it doesn't provide a way to actually deploy those versioned docs. Depending on your needs, you might have different options:
|
Beta Was this translation helpful? Give feedback.
-
|
I think that lots of projects just make the old docs available somehow (either as a separate site with a subdomain, or just dump the contents into a versioned folder) and forget about it. If you actually want to maintain multiple versions and be able to port/cherry-pick patches between them, then the "one-subdomain-for-each-version" is the usual way to go. Other solutions can be done as well with some customizations and tricks in your build process (and/or the well-aimed use of hugo modules), but that's not straightforward and requires some considerations - also, it's easy to overengineer it ;). But hugo (plus github workflows or other similar things you might be using) are really flexible, so all sorts of things can be done. (An example of slight overengineering is https://kube-logging.dev/ , here we didn't use subdomains, and every version comes from a separate branch and a separate workflow, so when you modify something in an older version, you don't have to rebuild and redeploy everything, just the specific version, and even that's done automatically.) |
Beta Was this translation helpful? Give feedback.
-
|
I'm currently developing a solution to this for my company's needs. I'll try and split the "framework" out into a repo to showcase it to you for inspiration. tldr until then: I made a datafile for defining versioned parts, where I define versions, stable and a root path. Then apart from a bunch of helpers (like verref to link to versions) it is basically mainly driven by two partials. One calculating the state, based off the URL (selected_product, active_version (from url or stable), hidden_paths) and one that filters out hidden_paths (calced by state). Then I just add a call to my state-partial in the head-hook and populate $Page.Store with it (don't try global for anything that will change 🤣 hugo parallell while building bugs were fun to figure out) and with a small modification to Docsy's sidebar-tree and section-info I just add a second $pages assign where I call my filtering partial (which grabs the state from the page store) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I was reading through the doc versioning section here https://www.docsy.dev/docs/adding-content/versioning/. For my use case, I only want to version a portion of my docs. For example, configs and API reference. Is this possible? Or must the whole site be versioned and separately deployed?
Beta Was this translation helpful? Give feedback.
All reactions