Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

permalinks and language switcher example are incompatible #76

@jinnatar

Description

@jinnatar

As written the example language switcher doesn't work on pages that have a permalink, apparently regardless if there's a translated permalink or not.
Current example for posterity:

{% if site.lang == "sv" %}
  {% capture link1 %}{{ site.baseurl_root }}en{{ page.url}}{% endcapture %}
  <a href="{{ link1 }}" >{% t global.english %}</a>
{% elsif site.lang == "en" %}
  {% capture link2 %}{{ site.baseurl_root }}{{ page.url  }}{% endcapture %}
  <a href="{{ link2 }}" >{% t global.swedish %}</a>
{% endif %}

In my example I have default lang en, secondary fi. If you click language switcher from default e.g. /help/
You will end up at: /help/fi/help/
Whereas the expected would be: /fi/help/ or if defining a permalink_fi: /apua/ then I would expect it to lead to /fi/apua/

So in short, the example switcher doesn't work with permalinks or translated permalinks and I couldn't fiddle it to work with them on my own.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions