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

v13.0.2 introduced bug in detecting static assets #78

Closed
4 tasks done
dereknola opened this issue Nov 4, 2024 · 5 comments
Closed
4 tasks done

v13.0.2 introduced bug in detecting static assets #78

dereknola opened this issue Nov 4, 2024 · 5 comments
Labels
🤞 phase/open Post is being triaged manually

Comments

@dereknola
Copy link

Initial checklist

Affected packages and versions

13.0.2

Link to runnable example

https://github.com/rancher/rke2-docs/actions/runs/11658790536/job/32458348363?pr=277

Steps to reproduce

Prior to 13.02, usage of assets under the root/static/ folder via Docusarous Static Assests support https://docusaurus.io/docs/static-assets did not trigger broken links.

Expected behavior

For example, https://github.com/rancher/rke2-docs/blob/main/docs/security/fips_support.md?plain=1#L7, which points to a PDF, works correctly on the actual website, https://docs.rke2.io/security/fips_support. This is because Docusarous will

Docusaurus will try to look for it in both static/img/docusaurus.png and public/img/docusaurus.png. The link will then be converted to a require() call instead of staying as a URL.

The remarks-validate-links should not identify this link as broken.

Actual behavior

The remarks-validate-links identify this link as broken.

Affected runtime and version

[email protected]

Affected package manager and version

yarn version v1.22.22

Affected OS and version

No response

Build and bundle tools

Docusaurus

@dereknola dereknola changed the title v13.0.2 introduced bug in detecting static assest v13.0.2 introduced bug in detecting static assets Nov 4, 2024
@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Nov 4, 2024
@wooorm
Copy link
Member

wooorm commented Nov 5, 2024

Hi!

If I go to https://github.com/rancher/rke2-docs/blob/main/docs/security/fips_support.md, and click that link, it 404s.

Same for the other things, if I go to https://github.com/rancher/rke2-docs/blob/main/docs/architecture.md, that image does not show.

This is covered by the paragraph “This is specifically for Git repos. Like this one. Not for say a website” in the intro and the “When should I use this?” section in the readme.

For a website, which uses more complex algorithms to look up things, as you describe for docusaurus with both static and public, that’s something dependent on particular tools, not something this tool does.

Perhaps https://github.com/remarkjs/remark-lint-no-dead-urls is what you are looking for?

@dereknola
Copy link
Author

Unfortunately, https://github.com/remarkjs/remark-lint-no-dead-urls only covers "external" link, while your plugin which checks "internal" links.

I take your point that this is only intended for git repos and not websites. Worst case I can pin the dependency and tell dependabot to ignore it.

I bring this issue up only because previous versions did not have this issue and thus this is an unexpected change in functionality.

https://xkcd.com/1172/

@wooorm
Copy link
Member

wooorm commented Nov 6, 2024

remark-lint-no-dead-urls is not limited to external links: when it is known what the href of a page is, it can resolve things relative to it (this is the internal you mean I think?)

Now, plugins are configured “in total”, not per file. So while there is one from option, you probably need to set an origin and pathname in file.data.meta: https://github.com/remarkjs/remark-lint-no-dead-urls#options

Right, xkcd.com/1172](https://xkcd.com/1172/ indeed 😅

@dereknola
Copy link
Author

Thanks I will try that approach.

Copy link

github-actions bot commented Nov 6, 2024

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤞 phase/open Post is being triaged manually
Development

No branches or pull requests

2 participants