Questions tagged [nuxt-content]

Use this tag for questions related to Content module of Nuxt.JS. This module is optional for Nuxt projects and provide ability to fill project with content using Markdown, JSON, YAML, CSV and XML files. Shortly - Git-based CMS

Links

Official website - https://content.nuxtjs.org

Github Repo - https://github.com/nuxt/content

Installation

Docs: https://content.nuxtjs.org/installation

  • NPM: npm install @nuxt/content
  • Yarn: yarn add @nuxt/content
  • Also available as option when creating project with create-nuxt-app

Features:

  • Blazing fast hot reload in development
  • Vue components in Markdown
  • Full-text search
  • Support static site generation with nuxt generate
  • Powerful QueryBuilder API (MongoDB like)
  • Syntax highlighting to code blocks in markdown files using PrismJS.
  • Table of contents generation
  • Handles Markdown, CSV, YAML, JSON, XML
  • Extend with custom parsers
  • Extend with hooks

Tutorial

Create a blog with Nuxt Content

Description taken from Introduction markdown file

69 questions
1
vote
1 answer

Nuxt/Content surround for previous and next

I cannot retrive prev and next article with nuxt content. in my slug page I have this code: async asyncData({ $content, params }) { const article = await $content('onstep', params.slug).fetch(); const [prev, next] = await $content('onstep') …
Stefano Martini
  • 408
  • 2
  • 17
1
vote
1 answer

Vue / Nuxt webpack resolve error on require image file

I'm getting a webpack error when trying to require an image file I know exists in my v-img component here: imgSrcFancy (imgsize) { try { // if in production, unless no imgsize is specified, use .imgs instead of fullsize //…
1
vote
1 answer

How to set og:image in Nuxt.js Nuxt/Content blog with images in content folders

How do I get a string representation of a deployed image's final location that I can supply to the og:image header code and have the og:header point to the correct url when deployed? I have a website that is based on Nuxt.js and Nuxt Content. To…
1
vote
0 answers

How to do a nuxt-content fetch join (or deep fetch)?

I have multiple json5 files that I need to join. Like in MySQL but with nuxt-content for a static stite with no SSR. I have done something but it doesn't work when I do nuxt generate Ex: data.json5 { title: 'title' date: date, cars:…
Derian André
  • 220
  • 3
  • 12
1
vote
1 answer

Get number of items in content folder in a nuxt blog

In my Nuxt page I have a navigation component where I try to achieve something like [Logo] [Product] [Infos] [Jobs(2)] Where (2) is a flag representing the number of items in the corresponding "jobs" content folder. I tried to fill the state but…
1
vote
1 answer

@nuxt/content : currently no loaders are configured to process this file

I have installed @nuxt/content, but when running npm run dev I get this error message although everything works fine: WARN in ./content/foo.md …
DevonDahon
  • 7,460
  • 6
  • 69
  • 114
1
vote
1 answer

Nuxt Content + Vuetify components = how to remove block of imports in template page which will render markdown content

In my "personal page" project I'm using NuxtJS, with it's @nuxt/content module for content and Vuetify UI framework. Recently found a problem: Vuetify component inside markdown files are not rendered when generating static site, but rendered…
0
votes
0 answers

How to use "useUnwrap()" composable in nuxt-content?

I was reading nuxt-content docs about useUnwrap() composable. It says that the functionality is the same as unwrap prop in component. But the docs does not give any example about using this composable. For example if I have a component…
hamid-davodi
  • 1,602
  • 2
  • 12
  • 26
0
votes
0 answers

why "_dir.yml" file does not work in "Navigation" in nuxt-content?

I was reading Navigation part of nuxt-content docs. I could not understand what is the actual purpose of that? In some part of this docs, it says: the navigation also allows you to configure directory nodes via _dir.yml files I could not…
hamid-davodi
  • 1,602
  • 2
  • 12
  • 26
0
votes
0 answers

_payload.json is not generated by `nuxi generate` when deploying nuxt-content website

I use nuxt 3, pinia and nuxt-content to build my blog and everything works well with dev server (nuxi dev). However, when I want to deploy it as a static website, I run nuxi generate and find that my posts are not rendered and chrome dev console…
why
  • 59
  • 4
0
votes
0 answers

Is it possible to use ssr: true and ssr: false for different routes?

I am using nuxt3 with route rules. I was wondering if it was possible to use the following route rules: export default defineNuxtConfig({ components: true, routeRules: { '/**': { ssr: false}, '/blogs/**': { ssr: true}, …
Mathijs
  • 177
  • 3
  • 18
0
votes
0 answers

NuxtContent doesn't work with spa and target static

I use nuxt3 with nuxtcontent. My blog posts are rendered perfectly on localhost and locally when I use nuxt build. However, as soon as I deploy it to production, the blog posts can't be found. Error message: …
Mathijs
  • 177
  • 3
  • 18
0
votes
1 answer

generating dynamic routes with nuxt and nuxt content

I am generating dynamic links using nuxt content, which worked fine till I updated my nuxt version and nuxt content version. I'm getting the following error when running npm run build. This code that is throwing an error is in my…
Otto
  • 663
  • 3
  • 17
  • 33
0
votes
0 answers

Nuxt 3 + content module: querying content by locare broke default routing

I'm having trouble setting up a multilingual site with the @nuxt/content module in Nuxt 3. I thought I had correctly configured the query for the ContentDoc component, but now the fallback routing from / to /index.md is not working anymore. This is…
Corrado
  • 1
  • 1
0
votes
0 answers

Accessing Route In Validation/Middleware & In Normal Code Without Duplication?

I have a blog using Nuxt 3 and Nuxt Content. My posts are divided into several categories. For each category, there is a page listing all posts belonging to this category. I do this with a generic category page and a validation function that checks…
muell
  • 383
  • 1
  • 15