Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False WARNINGs in lang prefix check #5860

limenet opened this issue Apr 15, 2019 · 2 comments


None yet
2 participants
Copy link

commented Apr 15, 2019

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?


This comment has been minimized.

Copy link

commented Apr 15, 2019

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 ...

@bep bep added this to the v0.55.2 milestone Apr 15, 2019

@bep bep added the Bug label Apr 15, 2019

@bep bep changed the title Relative Frontmatter URL with language prefix: wrong warning False WARNINGs in lang prefix check Apr 15, 2019


This comment has been minimized.

Copy link

commented Apr 15, 2019

@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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.