-
-
Notifications
You must be signed in to change notification settings - Fork 360
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
Print warning if system can't resolve link to a markdown file #691
Conversation
✅ Deploy Preview for hugo-congo ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
wouldn't also emitting the page this occurs at by using be helpful? also, might wanna have this be a toggle like: (totes written off the cuff and prolly wont work as is)
... pseudocode that I'm sure won't work
or you could use the errorf variant that has an excludable errnumber mechanism that allows the user to ignore errors of type _ .... |
Looking at the code for this warning, doesn't this prevent any links to |
Yes it will print warning too. It would be something like this:
e.g. if slug ends with PS it will not print warning for external links, like
|
The only that's stopping me from merging this is that there may be edge cases that will be triggered here that we're missing. And I wonder if throwing warnings when people want to link to Markdown files directly is an issue. I'm not sure if this is a prevalent use case or not. |
Hard to tell. It will break nothing. People will see some warnings which doesn't stop them from publishing it as is anyway. We can implement it and see if somebody complains or gets confused by it. Other way would be to add config which would disable this check in case somebody gets a lot of false warnings. |
if that’s your only reservation, perhaps changing the verbiage of the warning to indicate a potential red herring or a reference to this PR with a request to comment if an edge case pops up, and leave it as a potential nit for FutureUs™️? and then fix forward if/when it bites us in the butt as we’ll have a better sense of what edge case arose at that point? |
I'm probably overthinking this one. I'll merge it in and we can address any issues that arise if and as they appear. |
Small improvement:
if user uses link, like
[post](/content/posts/other-post.md)
and this file doesn't exist (e.g. broken link), Hugo will print a warning. Which is nice way to prevent 404 errors