Is it possible to modify the file name of a parsed content file when saving to the .nuxt/content-cache
directory?
#2651
Unanswered
andrew-boyd
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I currently have a custom transformer that allows me to load
.vue
,.js
, and.ts
files and convert them into markdown. I essentially get the raw file content and then wrap the content in triple backticks with the computed syntax. This is working great for me to be able to write .vue and javascript examples as content partials and then have them loaded and processed with Nuxt content's syntax highlighting. I also need to preserve these items as actual.vue
and javascript files because I'm also dynamically importing them and rendering their real output on the page next to the code for documentation examples.This is all working great in dev, but when I run a build I get errors such as:
This is because the actual file in the
.nuxt/content-cache
directory ends in a.js
file extension even though it's been converted to Markdown and its contents look like the shape of data you'd see when you open a parsed.md
file in the same directory.I think all I need to do at this point is somehow tell Nuxt Content to save my file as a
.md
file and I'll be good to go. I've tried modifying the_id
in the return value of my transformer but that didn't have any affect.Does anyone have suggestions for how I could modify the file extension for my
.vue
,.js
and.ts
files that I'm processing with nuxt content to reflect the fact that they have indeed been transformed into parsed markdown?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions