Closed iainmerrick closed 2 weeks ago
Not many people use HTML pages, but it'd still definitely be cool to support! I think this require some infrastructure though, as right now I don't believe we have an easy way to do this.
I might have a poke around to see what would be involved. I'm pretty sure this works in Vite, and I thought Astro uses Vite under the hood, so it seems like it should be possible.
For this feature request please start a discussion here: https://github.com/withastro/roadmap/discussions/new?category=proposal
HTML components are intentionally minimal and not processed in any way. See the docs for information on what is supported: https://docs.astro.build/en/basics/astro-components/#html-components
Re-filed as a proposal: https://github.com/withastro/roadmap/discussions/915
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I can add a
.md
file and the image files it uses into thepages
directory and Astro does the right thing -- the images are imported as assets and the correct URL is generated.However, I can't do this with
.html
files. Images referenced in an<img>
tag are not imported and the URL isn't fixed up. The user just sees a broken image.It would be good to be able to drop an existing, working HTML file into Astro and have it do the right thing.
What's the expected result?
Given a tag like this referencing a local image:
<img src="_foo.png">
I would expect the output to look like:
<img src="/_astro/_foo.123456.png">
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-uepn1b
Participation