docs
docs copied to clipboard
Remove "PrestaShop 1.7" everywhere in 8.x by something better
We need to remove "PrestaShop 1.7" everywhere in 8.x and replace by something better.
But one day there will be a PrestaShop 9 or a PrestaShop 10. We might avoid to redo the big "find and replace" by using a Hugo variable that contains the version number;
@eternoendless I tried to output in a shortcode the versionId I can get in _index.md
but it seems I cannot get it from this context. I can output variables from .Site
but no from FirstSection
. Wdyt ?
I think you need to use $.Page.FirstSection
(see https://gohugo.io/templates/shortcode-templates/#access-parameters)
In Hugo, the .
variable kinda works like this
in javascript, it depends on context.
I explored the topic and found the right path thanks to the suggestion.
$.Page.FirstSection.Params.Versionid
Reopening because https://github.com/PrestaShop/ps-docs-theme/pull/9 was the first step
Using {{% majorversion %}}
is probably a bad idea.
If the content is relative to a given version, you don't want it to be updated automatically. Here are some real examples that I pulled from the docs:
- PrestaShop 1.7 features a new translation system (...)
- PrestaShop 1.7 keeps the 1.6 configuration class for backward compatibility.
- PrestaShop 1.7 introduces a new Smarty helper to generate URLs.
- Since PrestaShop 1.7, the back office is being progressively migrated to the Symfony framework.
These refer specifically to PrestaShop 1.7. You don't want that "1.7" to change to "8" later.
Furthermore, any content that doesn't refer to any specific PrestaShop version shouldn't be tied to a version in the first place. Here are some real examples:
- Although PrestaShop 1.7 is bundled with default themes for FO and BO (...)
- Basic overview of PrestaShop 1.7's architecture
- PrestaShop 1.7 relies a lot on template inheritance in order to create the most consistent theme possible (...)
These phrases don't refer to PrestaShop 1.7 in particular, so they could just refer to "PrestaShop" (with no version).
Therefore, in my view, the shortcode will be rarely used. Instead, we can just search for instances of "1.7" in the 8.0 documentation and update the phrases accordingly, especially those that describe "new" features added in 1.7 and which are not new anymore in 8.0.
@eternoendless are there PRs left to be merged or can we complete this issue?
There are still lots of references to 1.7, including links to the 1.7.8.x branch (to be updated after 8.0.x is created)
The updgrade guide will have to be updated as well