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

links: ignore local markdown links linking to files with extension #707

Closed
cagix opened this issue Oct 30, 2023 · 4 comments
Closed

links: ignore local markdown links linking to files with extension #707

cagix opened this issue Oct 30, 2023 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@cagix
Copy link

cagix commented Oct 30, 2023

It seems that parsing local links is a bit too greedy: A link [Grammar: VarDef](src/VarDef.g4) in the Markdown sources to an existing file VarDef.g4 in the local subfolder src/ is mistakenly(?) treated as link to a Markdown file and on rendering it gives an error because there's no suitable template for it.

(theme: 5.23.0, hugo: 0.120.0)

Screenshot 2023-10-30 at 16 14 05

That said, I'm incredibly grateful for the portable linking implementation (c836962) and the improved warnings (8b0214e)! This has already helped me to find quite a lot of hidden bugs :)

@McShelby
Copy link
Owner

This is the line with the warnf statement. It's explicitly just a warning to avoid build errors. Did you reconfigure Hugo's error handling in your config.toml.

I will relax the condition to ignore links if they are local and contain any suffix

@McShelby McShelby self-assigned this Oct 30, 2023
@McShelby McShelby added the bug Something isn't working label Oct 30, 2023
@McShelby McShelby added this to the 5.24.0 milestone Oct 30, 2023
@McShelby McShelby changed the title theme 5.23.0 too greedy when parsing for local markdown links links: ignore local markdown links linking to files with extension Oct 30, 2023
@cagix
Copy link
Author

cagix commented Oct 30, 2023

You are right, I have configured Hugo to consider warnings as errors.

On the other hand, the warning is coming from the Relearn theme because no matching template could be found for the linked file. I think the file (an ANTLR grammar) was incorrectly considered and treated as a local Markdown file?

@McShelby
Copy link
Owner

That's a correct observation. Thus

I will relax the condition to ignore links if they are local and contain any suffix.

@McShelby
Copy link
Owner

I made a new relese with this bug fixrd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants