-
Notifications
You must be signed in to change notification settings - Fork 9
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
Custom pages with periods in the slug are reported as invalid #84
Comments
I think this may be more a duplicate of #39 where custom pages are not validated. If you rename validating links
14:35:54 [ERROR] ✗ Found 1 invalid link in 1 file.
14:35:54 ▶ /
14:35:54 └─ /foobar/ - invalid link I mentioned in the linked issue, I cannot really provide the same kind of validation for custom pages, e.g. headings, i18n, fallbacks, etc. My initial approach to the issue was that if I cannot provide the same level of validation, I should not validate them and these pages should be part of an |
That makes sense! I was going to say that we have other custom pages that work but we are actually already excluding them 🤦. My line of thinking was that the routes appear in sitemaps (which uses the same Now that I know our other custom pages were already excluded and that this isn't the same special characters edge case, I'm happy to follow #39 and close this issue if you want! I wonder if there's a way to determine "this is a custom page" and add some additional information in the "invalid link" report, such as they are not currently validated and linking to the |
That's a great idea, my initial thought is "yes, that may be possible" but I'll experiment and report back. |
I've opened #85 which should improve the warning for such cases. When an invalid link is pointing to a custom page, the error type now indicates it: ![]() If the entire report contains at least one such error, the error hint now also shows an additional message with a link to the ![]() The PR also includes a dynamic page in a test fixture with a slug including a dot to be sure to avoid errors like #31 with dots. I'll give myself a few days to think about it more and potential wording improvements, but I think this should be a good improvement nonetheless thanks to your great idea. |
Sorry for the delay, got sick last week and only got back to this today. Just released version |
Describe the bug
I believe this is effectively the same as #31, but the fix that relies on
file.data.astro
does not apply to custom pages.To Reproduce
StackBlitz
src/pages/foo.bar.astro
.src/content/docs/foo.mdx
.a. Add
title: foo
andslug: foo.baz
to the frontmatter.[foo](/foo.bar/)
and[foo](/foo.baz/)
in a Markdown file.npx astro build
, and observe that/foo.bar/index.html
and/foo.baz/index.html
are generated./foo.bar/
, the custom page, will be reported as an invalid link.Expected behavior
/foo.bar/
is reported as a valid link.How often does this bug happen?
Every time
System Info
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: