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

Adding link to (non-html) files from md #265

Closed
davay42 opened this issue Mar 20, 2021 · 8 comments · Fixed by #515
Closed

Adding link to (non-html) files from md #265

davay42 opened this issue Mar 20, 2021 · 8 comments · Fixed by #515
Labels
enhancement New feature or request

Comments

@davay42
Copy link

davay42 commented Mar 20, 2021

Vitepress keeps adding .html extension to any link referencing a pdf file relative to the page. Seems like it's hard-coded here

url = url.replace(/[?#].*$/, '').replace(/\.(html|md)$/, '')

May be it's the right way and any non-routed link should be put as <a> tag? Just wanted to share this observation.

@davay42 davay42 changed the title Adding link to a pdf file from md Adding link to a (non-html) file from md Mar 20, 2021
@davay42 davay42 changed the title Adding link to a (non-html) file from md Adding link to (non-html) files from md Mar 20, 2021
@jarrodu
Copy link

jarrodu commented Mar 26, 2021

I just ran into the same issue. I am also trying to link to a pdf file.

@kiaking kiaking added the enhancement New feature or request label Apr 15, 2021
@kiaking
Copy link
Member

kiaking commented Apr 15, 2021

Ah good point. Wasn't thinking about this use case. Hmmm should we have whitelist to filter out major extensions?

@davay42
Copy link
Author

davay42 commented Apr 15, 2021

@kiaking Yeah, that could be a nice solution. The actual extensions may differ for different sites significantly – some may share books, others provide 3d models and so on. So there may be an option in config.js file with some default state with the list of most used file extensions.

@jarrodu
Copy link

jarrodu commented Apr 15, 2021

That would be a great solution. Thanks for thinking about it.

@davay42
Copy link
Author

davay42 commented Apr 15, 2021

@kiaking @jarrodu I'm deep into vitepress now and have many ideas on improving it, but can't figure out where to discuss them. Vue discord has a vitepress channel, but it's quite silent. I think vitepress may become a great tool for users to create and publish their digital gardens (which are quite a hype now!). I have my little snippets running for the purpose and I'll be glad to share these ideas and collaborate on implementing them.

@davay42
Copy link
Author

davay42 commented Jun 27, 2021

Any updates on this issue? @kiaking @jarrodu ?

@jarrodu
Copy link

jarrodu commented Jun 28, 2021

I have not worked on this issue. Since I am using vitepress for a personal project this issue is not urgent.

Are you thinking of picking up the issue?

@davay42
Copy link
Author

davay42 commented Jun 30, 2021

It's ok. ) I have a couple of workarounds for this issue with custom components just for the cases. Vitepress is so flexible, so any problem is solvable with a nice SFC ))))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
3 participants