Closed mathieunicolas closed 1 year ago
Hey! Thanks for creating this.
I'm actually considering dropping all the path transform stuff altogether, and just mirroring the final content folder structure.
I originally put it in so users could upload a single folder to image CDNs but it does make things more complicated.
I'm currently working on the watch folder functionality and that is complex enough without additional transforms!
I'll let you know when I get the next version out, hopefully in the next day or so.
OK @mathieunicolas...
A big refactor took place over the last couple of days:
Do you want to try 0.9.0-alpha
and let me know how you get on?
The sockets code is a bit rough, but it works. I have been trying to extract it to an external module but it's been a little problematic.
The 1.0.0 will probably wait until I can do this.
You did an amazing job ! It's really impressive, big thanks to you ! The image URL issue is now fixed ! All the new features you added look very cool and I can't wait to try them on an other project !
One more thing, it looks like the _dir.yml
files are either ignored or not processed, for example I set the title "alloé18" in such a file here and it's not applied in the header :
You can see it live in my Kaleidoscopic Brioche ! Do you want me to create a new issue related to this ?
I also have this error in my VSCode editor, related to additionalExtensions
in 'content-assets'
nuxt.config.ts :
In theory we don't need additional extensions anymore as I've flipped how assets are determined.
However, the yaml thing you posted needs investigation so yeah, please make a new issue for that and I'll take a look!
One other thing, I saw that there was a jump when your images loaded in.
If you set the setting imageSize
to attrs
the module will correctly size your images and you won't get the jolt:
'content-assets': {
imageSize: 'attrs'
}
If you want the image small (I notice you set the width) you might be better with a max-height
rule in your CSS to retain the ratio but make sure they never get too big:
.page-body img {
max-height: 400px;
}
// could even do this
.page-body img:first-of-type {
max-height: 400px;
}
Closing as the paths issue is considered fixed.
PS. the docs for this alpha version are here: https://github.com/davestewart/nuxt-content-assets/tree/0001-watch-assets
Thanks for asking me to create a new issue, I've been able to look at the problem deeper and I think it's more simpler than I thought !
Describe the bug
I have a problem with SRC rewriting on IMG tags :
content
files (slighly different setup but mostly the same files) https://6433e915f7271a7c8fcfd222--kaleidoscopic-brioche-dc7d6b.netlify.app/alloe18/partie1/chapitre1the IMG tag :
Expected behaviour
IMO the expected behaviour should be an image SRC =
/alloe18/machine.png
, which is where the image has been copied : since the URL doesn't start with a/
it's considered as a relative path and interpreted by the browser as/alloe18/partie1/alloe18/machine.png
machine.png
is inserted in the/alloe18/partie1/chapitre1.md
file with the code![image](../machine.png)
,/alloe18/machine.png
alloe18/machine.png
in the generated HTML tag.To Reproduce
my
nuxt.config.ts
for the external files setup, same for the local content files with thesources
object commented :Additional context
Maybe it's just a
/
missing !Software versions: