Hi all,
I think this might be a bug, but I’m not sure if it’s just that I’m doing something wrong…
Scenario:
- Internal Gitlab server, with Pages publishing setup
- Projects use Hugo+Docsy to build their html documentation output, which the Pages deploy then puts on the internal hosting server
- There are groups and sub-groups in use. Gitlab has an algorithm for its URL building that essentially goes:
GROUP.internal.domain/PROJECT/
orGROUP.internal.domain/SUB-GROUP/PROJECT/
orGROUP.internal.domain/SUB-GROUP/SUB-SUB-GROUP/PROJECT/
, etc - Our builds all have i18n turned on, and a default language of
en
(whilst we currently only have English outputs, this choice was to support future plans).
Thus, we have a group top-level project that produces output for GROUP.internal.domain/
, and a menu link defined in config for a project in a subgroup, i.e. at GROUP.internal.domain/SUB-GROUP/PROJECT/
.
When you visit GROUP.internal.domain/
it redirects to GROUP.internal.domain/en/
and similarly GROUP.internal.domain/SUB-GROUP/PROJECT/
redirects to GROUP.internal.domain/SUB-GROUP/PROJECT/en/
- this is all good and as expected.
However, the menu link in hugo.yaml for the top level project is defined as:
# hugo.yaml -- Base config
baseURL: https://epr.internal.domain/
# snip...
menus:
main:
- identifier: all-projects
name: All Projects
weight: 1000
url: https://www.internal.domain/
- identifier: mpages-build
name: MPages
weight: 800
url: https://epr.internal.domain/mpages/build/
Where epr
and www
are top level groups, mpages
is a subgroup of epr
, and build
is the name of the project in the mpages
subgroup.
Unfortunately, whilst we’ve put an explicit FQDN for the mpages-build entry, that is being rewritten in the output to a relative url of:
<li class="nav-item">
<a class="nav-link" href="/en/mpages/build/" target="_blank" rel="noopener"><span>MPages</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://www.internal.domain/" target="_blank" rel="noopener"><span>All Projects</span></a>
</li>
Clicking the MPages link then takes you (as expected) to https://epr.internal.domain/en/mpages/build/
, which doesn’t exist so 404’s (it obviously should be ending up at https://epr.internal.domain/mpages/build/en/
)
I can see that it’s doing a basic find/replace of the base url here, but in this instance, I don’t want that to happen - so I’m not sure if this is a bug, or if there’s a way to configure this link so that it doesn’t get replaced?
Kind regards,
Carl