Skip to content

Instantly share code, notes, and snippets.

@tonyfast
Created July 30, 2014 04:35
Show Gist options
  • Select an option

  • Save tonyfast/2142f1ae8e6f5e9e8357 to your computer and use it in GitHub Desktop.

Select an option

Save tonyfast/2142f1ae8e6f5e9e8357 to your computer and use it in GitHub Desktop.
Work Around to Using YAML Front Matter in Javascript
---
foo: bar
---
<div id="frontmatter" style-"display:none;">{{page['foo']}}</div>
<script>
// In Jquery
jsvar = $(".fields").text();
// In d3
jsvar = d3.select(".fields").text();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment