spock icon indicating copy to clipboard operation
spock copied to clipboard

Link to the "latest" version of documentation for particular pages

Open szpak opened this issue 2 years ago • 8 comments

Is your feature request related to a problem?

People willing to link to the latest version of the release notes have to link to the .adoc file in Git instead of https://spockframework.org/ - e.g. here

Describe the solution you'd like

https://spockframework.org/spock/docs/latest/release_notes.html (or "current" instead of "latest") should redirect to the latest (stable?) version for every subpage.

Currently one can use https://spockframework.org/ or https://spockframework.org/spock/docs/ , but it doesn't work for linking to the particular subpages.

Describe alternatives you've considered

No response

Additional context

No response

szpak avatar Feb 11 '23 16:02 szpak

Do you have a good suggestions how to achieve that? Currently, it is a manual process, see https://github.com/spockframework/spock/commit/874075117e0c947e9c3b03b3d2f5249e070ce139 relying on <meta HTTP-EQUIV="REFRESH"...>

leonard84 avatar Feb 13 '23 20:02 leonard84

Do you have a good suggestions how to achieve that? Currently, it is a manual process, see 8740751 relying on <meta HTTP-EQUIV="REFRESH"...>

Here you checked if a symlink at the directory level coudn't be used with GH pages?

docs/current -> docs/2.3 (updated from the CI server)

szpak avatar Feb 19 '23 09:02 szpak

🤔 this could work, the "downside" is that https://docs.spockframework.org/ wouldn't redirect to a stable link anymore, but to one that will change when updated. This could leave links with broken anchors if the sections were removed/renamed.

leonard84 avatar Feb 20 '23 21:02 leonard84

Good point with more problematic sharing links to the exact version :-/.

Maybe we could have "current" with the current (no pun intended) behavior (used for people visiting https://docs.spockframework.org/) and (for example) "latest" with the symlinks (for the special use cases, such as aforementioned)? The difference could be mentioned somewhere in the documentation.

I know that "latest" is currently used for really latest SNAPSHOT version, but for people willing to reach that version (to test if changes in master with documentation work fine?) could use the exact link instead. Or we could make up some new word :-).

szpak avatar Feb 20 '23 21:02 szpak

I gave it a try in a separate repo and it works as predicted.

https://szpak-forks.github.io/pages-refresh-current/docs/2.3/ - stable 2.3 https://szpak-forks.github.io/pages-refresh-current/docs/2.3/page1.html

https://szpak-forks.github.io/pages-refresh-current/docs/current/ - redirects to docs/2.3/ https://szpak-forks.github.io/pages-refresh-current/docs/current/page1.html - broken (as currently)

https://szpak-forks.github.io/pages-refresh-current/docs/always-current/ - always current https://szpak-forks.github.io/pages-refresh-current/docs/always-current/page1.html - always current, works also for particular pages

So, I would keep "current" and "latest" as is (with redirect) and "???" (always-current?) as an "always current link to the (latest) current stable version". The question is: how to name it?

current-stable (with "stable" as in a "stable link" to something) could be misleading (due to a stable version). current-latest - the same situation. perma-current - "perma link" suggests rather a link that will always refer to the same. I don't have a good idea :-/.

szpak avatar Feb 28 '23 00:02 szpak

@leonard84 WDYT about the last proposal?

szpak avatar Mar 10 '23 21:03 szpak

Sounds OK, ideally this would be automated during publishing. Would you like to give it a try? The best place would be a small plugin in build-logic.

leonard84 avatar Apr 02 '23 10:04 leonard84

Alternatively, we could add a task that goes through the published docs and adds a header with the different versions and displays a warning, when it isn't the latest one. Similar to what Postgres is doing.

leonard84 avatar Sep 15 '23 17:09 leonard84