You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually you can do this when running gray-matter in Node using the JS parser:
---js{NODE_ENV: process.env.NODE_ENV}---
Alternatively you could supply a custom parser engine:
import{javascript}from'gray-matter/lib/engines.js'constparsed=matter(str,{engines: {'embedded-js': (str,options)=>{// naive implementation but you get the gistreturnjavascript.parse(str.replace(/\$/g,'process.env.'),options)}}})
Hello,
I would like to pass environment variables to the yaml file header. I tried the following:
None of them worked. Would it be something possible to do?
Thanks!
The text was updated successfully, but these errors were encountered: