davestewart / nuxt-content-assets

Enable locally-located assets in Nuxt Content

Home Page:https://npmjs.com/package/nuxt-content-assets

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Any markdown filenames with a dot gets ignored by nuxt content

LoganTann opened this issue · comments

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:

  • Create a nuxt 3 project using this extension
  • Create a markdown file with a dot (eg : 1.test.md or in.dex.md)
  • When querying content, files having a dot before the extension gets ignored

Expected result:

  • When querying content, files having a dot and finishing with the .md extension should remain visible

Context

Screenshots

files list

query result

Environment info

v18.14.2

kagescan@
├── @nuxt/content@2.4.3
├── nuxt-content-assets@1.3.0
└── nuxt@3.3.3

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.

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.

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

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