stackabletech / documentation

Stackable's central documentation repository built on Antora
https://docs.stackable.tech
Apache License 2.0
11 stars 11 forks source link

Move docs into one logical component #306

Closed fhennig closed 1 year ago

fhennig commented 1 year ago

With the harmonization of the Operator versions to conform to the Platform version, all our documentation components are versioned with the same number. This gives us the opportunity to further simplify the docs for the user! What we could do:

Benefits

A preview of what it would look like:

The Trino Operator docs are now in the same navigation bar as the platform level docs, under their own section. Here, only the getting started guide was moved. The version dropdown where nightly is selected affects all docs at the same time, platform level and Trino docs.

How it works

Instead of multiple components, we would move to having one single "Platform" component. This is more in line with how we want to user to think about it too: It all works together, it's versioned together, it's one "thing". Antora components can also be distributed across different repositories. We would change our Operator Antora components to all belong actually to the same distributed component.

If Antora discovers two or more antora.yml files that specify an identical component name and version, it considers all of the files in the subsequent standard directory sets to belong to the same component version, even though the source files were collected from multiple locations.

Having just a single component leads to all the benefits above. But there are also drawbacks, depending on how it is implemented. The differences are mostly in regards to how we deal with existing pre-change versions of operator docs.

Implementation

Using a distributed component for current and future versions is straightforward to implement (I have spiked it in Trino). The docs for 23.1 onward would then live in the single "home" component. The question then becomes, what to do with older Operator versions that use a different versioning scheme.

A: Leave old versions as they are

We could move to a distributed component for future operator versions only, and leave the old, multiple component setup for older versions.

B: Change versioning from 22.06, 22.09 and 22.11, drop older versions

We could go and change the docs versions for these older releases to also move them to distributed components, using the platform versions they belong to. For example, for Druid, 0.8 would become 22.11. Any operator versions that do not belong to a platform release would be dropped.

Due to the links being constructed from versions and component IDs, changing existing versions or components will lead to links to break for that component/version. /druid/stable/index.html will become /home/stable/druid/index.html. This is quite severe. I don't know how many people are already linking to docs pages. I don't know how this will affect our Google indexing issues as well. I do know that since almost nothing is indexed yet, we would at least not lose out so much here.

Optional follow up changes if we go for breaking links

If we were to break links, we should consider doing any other URL changes at the same time. There are two changes that I would really like to do:

With our new versions but current URL scheme, the link to druid would look like this:

https://docs.stackable.tech/home/23.1/druid/index.html

with the changes applied I suggested above, it would look like this

https://docs.stackable.tech/23.1/druid/

Summary

I propose to move all our documentation into one [https://docs.antora.org/antora/latest/distributed-component-version/](distributed component). This would lead to easier reasoning about the docs, easier linking, a single version for all docs and a single version selector, and having all pages available in a single navigation for the user. Depending on the implementation it might be more or less difficult, and could to link breakages.

fhennig commented 1 year ago

Feedback from the Arch Meeting

Currently I think we should soft-break some links but put in redirects. Would be a good balance between not breaking links completely and not having to maintain too much old structure.

fhennig commented 1 year ago

Antora has some native support for redirects: https://docs.antora.org/antora/latest/page/page-aliases/#page-aliases-and-bulk-url-redirects - However, they explicitly state that this feature should not be used for moving components:

If you remove a large number of pages, such as if you remove or rename a component or component version, and you want to preserve the existing URLs, you should not attempt to do so using page aliases. Page aliases were not designed to provide bulk URL redirects. Instead, we strongly recommended that you use the router provided by your web server or host when you remove or rename a component or component version.

That is unfortunate. Since we use github pages, we don't have any redirect mechanisms available.

We could go against their advice and use the redirects anyways. Or we could move to Netlify, where we also get free hosting and they support proper redirects. Moving from GitHub pages to Netlify shouldn't take long.


Edit:

I asked on the Antora Zulip chat about the reason for the recommendation against using bulk page aliases for bulk redirects, and got this response:

You are free to not follow the recommendations. After all, they are just recommendations. The reason we advise not using page aliases is because you end up having dozens of aliases instead of one redirect rule. Less is easier to maintain. Simple as that.

However, GitHub Pages has no redirect facility (and probably never will). So you really don't have any other choice but to use page aliases. This is a key reason why I so strongly advise against using GitHub Pages. It's not a real web host and GitHub chooses to keep it crippled. I prefer Netlify or GitLab Pages, both of which support this feature.

So you really don't have any other choice but to use page aliases.

You could also write an extension that registers page aliases programmatically so you don't have to maintain them in the source.

I think that's good to know! There is no technical drawback of using the GitHub redirects in bulk, but it is indeed a bit of a pain to maintain.

fhennig commented 1 year ago

Update: I have spiked the distributed component. and it works and looks nice! See here: https://deploy-preview-357--stackable-docs.netlify.app/home/nightly/operators/index.html

Using netlify, I have added some redirects so the stable links to content do not break. :heavy_check_mark:

The only problem right now is that the version dropdown doesn't allow selecting old versions of documents anymore, because to antora, the documents didn't exist in older versions (which is technically correct, the documents were in different components). It's difficult to find workarounds for this.

Older versions are now a bit difficult to access.

I've tried page aliases, but antora doesn't pick that up for the version dropdown. The "proper fix" would be to indeed refactor all the old versions, but that is a lot of work.

The options I see are:

fhennig commented 1 year ago

Update: The move to netlify is progressing. We have our current docs mirrored now on https://docs-preview.stackable.tech , which is on netlify.

We decided that it is fine for now to backport changes to 23.1 as that seems easy, but ignore older versions, leave them as they are.

A quick look at matomo showed almost no one accessing the older versions as well.

fhennig commented 1 year ago

Done as far as I'm concerned

look here: https://docs-preview.stackable.tech/

If everything is fine, we should switch our proper docs link over to the netlify site.

fhennig commented 1 year ago

Oh, also i fixed all warnings/errors and enabled a build failure on warnings.

fhennig commented 1 year ago

Changes are live now