Git Product home page Git Product logo

Comments (3)

benjamincanac avatar benjamincanac commented on August 28, 2024 2

Hey @andyfensham,

When using nuxt-content component, all the document variables are injected inside the markdown, so you can do for example:

---
title: Introduction
src: https://content.nuxtjs.org/icon.png
---

<img :src="src"></img>

from content.

crazymind avatar crazymind commented on August 28, 2024

@benjamincanac

What would be the solution here, if you try display a variable not in a html attribute?
This for an example won't work:

---
title: Introduction
src: https://content.nuxtjs.org/icon.png
---
 
<h1>{{ title }}</h1>

from content.

nwittwer avatar nwittwer commented on August 28, 2024

@crazymind As far as I can tell, there isn't a solution for interpolating these frontmatter YML variables within the document in Nuxt Content v1, i.e. {{ title }} should become Introduction once compiled, but currently it just shows {{ title }} still.

It does look like this is coming to Nuxt Content v2, along with a new MDC (Markdown Components) format. Looks like the PR has been merged, but is not yet released as of v2.0.1: #1266

That being said, it would be really great to see the frontmatter variable interpolation in Nuxt Content v1 as well. Nuxt v2 + Content v2 are not yet stable and documented enough for the static site use case I have.

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.