Comments (3)
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.
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.
@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)
- Experimental Search: splitPageIntoSections fails if file does not have description
- [Landing] - Design review
- want some magic ? An image is switched with another one on client side HOT 2
- Add Default Language Field to Nuxt Config for Shiki Code Highlighting HOT 1
- bug: home page layout shift
- Can't Access Nuxt Studio Data in Frontend of Application HOT 1
- Error on Nuxt Content for Static Site Generation : Document not found, overwrite this content with #not-found slot in <ContentDoc>. HOT 1
- When I set useHead in app.vue, the webpage title does not change after leaving the content-related page
- bug(search): unicode characters display wrong on indexed mode HOT 1
- Unwanted class added on anchor links when target="_self"
- Image path changed in when linking images in markdown content HOT 2
- queryContent matches on start of path not directory name
- Unable to install nuxt with @nuxt/content with pnpm
- Unable to start project after creation (#internal/nitro/virtual/app-config is not defined) HOT 2
- Typecheck fail: Property 'useNuxtImage' does not exist on type HOT 1
- How to disable warnings like this: WARN [Vue warn]: Failed to resolve component: G?
- Unable to start examples/essentials/hello-world example HOT 1
- hook 'content:file:beforeParse' not working
- hook 'content:file:beforeParse' not working
- SSR and client divergence when processing link
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from content.