Git Product home page Git Product logo

Comments (7)

ChristianMurphy avatar ChristianMurphy commented on August 28, 2024 1

Also based off the code, there may be an undocumented way to do this already

  content: {
    markdown: {
      plugins: [
        'remark-twemoji',
-        ['remark-frontmatter', 'yaml'],
+       'remark-frontmatter'
      ],
+    frontmatter: "yaml"
    },
  },

from content.

benjamincanac avatar benjamincanac commented on August 28, 2024 1

Hey,

Plugins can be configured as described here: https://content.nuxtjs.org/configuration#markdown.

Each plugin is configured using its name in camelCase: remark-external-links => externalLinks.

However, a PR is actually ongoing to refactor plugins, so you might be able to configure them this way.

from content.

Strahinja avatar Strahinja commented on August 28, 2024

Update: the issue with remark-twemoji is resolved by installing twemoji. As stated in the linked comment, it would be nice if this warning was made more clear.

remark-frontmatter part of the bug is still unresolved.

from content.

ChristianMurphy avatar ChristianMurphy commented on August 28, 2024

For remark-frontmatter, the issue is in nuxtjs/content

Nuxt content currently does not support settings in remark plugins
https://github.com/Strahinja/remark-bug/blob/110d158f46814454ed3b9eda0e40df5e1aa739aa/nuxt.config.js#L50

for (const name of this.plugins) {
try {
const plugin = require(name)
const options = this.options[camelCase(name.replace('remark-', ''))]
stream = stream.use(plugin, options)
} catch (e) {
logger.warn(`${name} is not installed`)
}
}

That is why the error is remark-frontmatter,yaml is not installed instead of separating the plugin from the settings it concatenated them together, creating an invalid package name.

from content.

Strahinja avatar Strahinja commented on August 28, 2024

@ChristianMurphy, thanks for the workaround. I think I'll take a look at that code and possibly try to come up with a PR.

from content.

benjamincanac avatar benjamincanac commented on August 28, 2024

@Strahinja If you're trying to get data using remark-frontmatter plugin, @nuxt/content already does this by default: https://content.nuxtjs.org/writing#front-matter

from content.

Strahinja avatar Strahinja commented on August 28, 2024

Thanks, it seems I missed that part of the documentation. I'm migrating from frontmatter-markdown-loader with markdown-it, so I thought that including that package explicitly was needed. Still, this warning message is misleading and comes up as inaccurate when the package is actually installed. Looking forward to the next iteration of @nuxt/content! :)

from content.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.