Skip to content

False WARNINGs in lang prefix check #5860

Closed

Description

@limenet

Let me start by saying, I'm so happy with what you did in #5704, #5805, and #5818! We use Hugo to provide a multi-lingual product manual and that change makes onboarding new writers much easier.

We use a CI/CD to deliver our Hugo site which also checks if there are no warnings in the output of hugo and unfortunately the warning introduced in f34e617 has an edge case.

Please consider the following example where one of the languages is German (de):

url: 'de/debitorenpreisfindung-zeilenrabatt'

Hugo correctly outputs a warning about the language prefix (de/). Once I change that to:

url: 'debitorenpreisfindung-zeilenrabatt'

Hugo unfortunately still outputs the same warning since de is (incorrectly) assumed to be a language prefix and not part of the URL.

As per f34e617 I know this warning is only active in 0.55. However, I think this might affect a few people and it might confuse people and result in ignoring warnings which is a bad habit.

A solution might be to check whether the supposed prefix is followed by a non-alphanumeric character in f34e617#diff-5129e7484246c664a01e8bb7c023fa12R384 I'd love to provide a PR but unfortunately my Go skills are virtually non-existent.

What do you think?

Activity

  1. bep commented on Apr 15, 2019

    @bep
    Member

    What do you think?

    I think you are right. I will add a fix. I kind of knew this would potentially create false warnings, but I thought it would still be worth it ...

  2. added this to the v0.55.2 milestone on Apr 15, 2019
  3. changed the title [-]Relative Frontmatter URL with language prefix: wrong warning[/-] [+]False WARNINGs in lang prefix check[/+] on Apr 15, 2019
  4. limenet commented on Apr 15, 2019

    @limenet
    Author

    @bep thanks for getting back to me so quickly and for adding this to the 0.55.2 milestone! I think the warnings are absolutely worth it :)

  5. github-actions commented on Feb 18, 2022

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  6. locked as resolved and limited conversation to collaborators on Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions