Seamlessly use content files in your Nuxt.js sites.
https://nuxtent-module.netlify.com/
I unfortunately don't use this module anymore (interests changed), so I'm hoping that people that do use it can step up as maintainers / contributors. Please join Nuxtent's slack channel and DM me if interested.
The goal of Nuxtent is to make using Nuxt for content heavy sites as easy as using Jekyll, Hugo, or any other static site generator.
Nuxtent mainly does this in two ways:
- By compiling all the data from
markdown
oryaml
files based on configured rules. - By providing helpers for dynamically accessing this data inside Nuxt pages.
But, we didn't just want to make Nuxtent as good as a static site generator–we wanted to make it better.
So, along with that, Nuxtent also supports:
- The usage of content files in both static sites and dynamic applications.
- The usage of
Vue components
inside markdown files. - Automatic content navigation, between pages via
path
and within pages viaanchors
.
There you go: five reasons to give Nuxtent
a try, and maybe even star and share it. 😏
Nuxtent was created to integrate with Nuxt (otherwise, you're just building another Jekyll-like tool, with the same amount of mental overhead).
Nuxtent's API is simple yet flexible. All you have to do is 1) configure the content and 2) fetch the files with the $content
helper inside the asyncData
method that is available in Nuxt pages.
Here's a basic example:
// nuxtent.config.js
module.exports = {
content: {
page: '/_post',
permalink: ':year/:slug'
}
}
// pages/_post.vue
export default {
asyncData: async ({ app, route }) => ({
post: await app.$content('posts').get(route.path)
})
}
If you're starting a new site, you can use the nuxtent-starter template.
$ vue init nuxt-community/nuxtent-template my-site
$ cd my-site
# install dependencies
$ npm install # Or yarn install
npm install nuxtent --save
Then, under nuxt.config.js
install the module:
modules: [
'nuxtent'
]
Documentation available at: https://nuxtent.now.sh/ (built with Nuxtent).
Have a site using Nuxtent? Fork the repo and add it to the list below!
Copyright (c) 2017 Nuxt Community