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

fix(deadlinks): Check if public file exists #4283

Closed
wants to merge 2 commits into from

Conversation

veryard
Copy link
Contributor

@veryard veryard commented Oct 14, 2024

Description

Currently if you have a file inside the public/ folder like such as public/files/example.xlsx it will be flagged a dead link. So this just updates the markdownToVue file to check if it's a public file and it exists so it doesn't flag as dead link.
Ie.

[here](/files/example.xlsx)

The above would result in a dead link.

This was causing some build issues with a team of 10 people writing docs. Means they don't have to specify the full path to the file.

Happy to hear any feedback!

Thanks.

@brc-dd
Copy link
Member

brc-dd commented Oct 14, 2024

add this to top of your config file

process.env.VITE_EXTRA_EXTENSIONS = ['xlsx'].join(',') // add any other extensions you want

@veryard
Copy link
Contributor Author

veryard commented Oct 15, 2024

add this to top of your config file

process.env.VITE_EXTRA_EXTENSIONS = ['xlsx'].join(',') // add any other extensions you want

Yeah I understand, just thought it would be a bit more user friendly for non technical people writing docs to just have it work verses having them go and amend this every time a file type is added.

@brc-dd
Copy link
Member

brc-dd commented Oct 15, 2024

I don't think checking if the file exists in public directory is the right way to deal with this. Non-html files in public dir should simply be ignored (and I think html files in public directory should also be ignored, not sure why we aren't doing that already).

People have different workflows and even have different apps combined with vitepress. Many people are manually copying this stuff or keeping static files in different app's public directory. It works in runtime because all of those files end up in the same place. It will be a breaking change for them as they will need to add custom logic to ignoreDeadLinks.

@veryard veryard closed this Oct 15, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants