Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review how VeryOldArticle is updated #62

Open
renoirb opened this issue Oct 16, 2024 · 0 comments
Open

Review how VeryOldArticle is updated #62

renoirb opened this issue Oct 16, 2024 · 0 comments
Assignees

Comments

@renoirb
Copy link
Owner

renoirb commented Oct 16, 2024

It's too clunky the way it's implemented.

Maybe I can do the same from the page’s asyncData

Something that's like this in the beforeInsert hook docs:

You might want to parse markdown inside a .json file. You can access the parsers from the database object

export default {
  modules: [,
    '@nuxt/content'
  ],
  hooks: {
    'content:file:beforeInsert': async (document, database) => {
      if (document.extension === '.json' && document.body) {
        const data = await database.markdown.toJSON(document.body)

        Object.assign(document, data)
      }
    }
  }
}
const someFunctionName = async ($content, document) => {

}

Bookmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant