davestewart / nuxt-content-assets

Enable locally-located assets in Nuxt Content
https://npmjs.com/package/nuxt-content-assets
108 stars 7 forks source link

Any markdown filenames with a dot gets ignored by nuxt content #36

Closed LoganTann closed 1 year ago

LoganTann commented 1 year ago

Description

In nuxt content, the standard way to order articles is to prefix the filename with a number. After processing, this prefix gets automatically removed from the "path" attribute

However, it seems like this plugin registers filenames having a dot before the extension to be completely ignored by nuxt content (may be due to this regex pattern)

To reproduce:

Expected result:

Context

Screenshots

![files list](https://user-images.githubusercontent.com/28659185/234255464-9ba69f54-6b1e-4d4e-8384-809ddecffe9a.png) ![query result](https://user-images.githubusercontent.com/28659185/234255403-710f7990-72c7-4d45-8c11-7a4af56aff66.png)

Environment info

v18.14.2

kagescan@
├── @nuxt/content@2.4.3
├── nuxt-content-assets@1.3.0
└── nuxt@3.3.3
davestewart commented 1 year ago

Hey, thanks for picking this up.

The internal Nuxt Content ignores RegExp is a little strange as it "bakes in" the delimiters from unstorage (see this issue) hence the RegExp Nuxt Content Assets passes to it being a little gnarly.

It may be that I didn't test ordered content with it in the demo (though I have in other projects) so let me check and get back to you.

davestewart commented 1 year ago

OK, I can confirm that the RegExp is the issue 😢

The good news is that it seems to be solvable, so I'm working on getting a patch release out now.

davestewart commented 1 year ago

OK, that's released now:

LoganTann commented 1 year ago

Works like a charm, thank you for fixing this issue 😁

davestewart commented 1 year ago

Thanks for bringing it to my attention.. What a show-stopper! 😬