Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing pages.data to yaml front matter. #955

Open
Stefany93 opened this issue Jul 27, 2018 · 7 comments
Open

Passing pages.data to yaml front matter. #955

Stefany93 opened this issue Jul 27, 2018 · 7 comments

Comments

@Stefany93
Copy link

Stefany93 commented Jul 27, 2018

version

[email protected]

description

I want to generate YAML from matter from JSON data passed directly


blog_posts:{
        options: {
          layout: 'single-blog-post.hbs',
          pages: createPages('data/blog/blog.json','app/layouts/single-blog-post.hbs')
        },
      files: {'<%= dirs.output %>/blog/' : ['!*'] } //We need to trick assemble here using !* as the src
      
    }

[description]

  --- 
title : {{data.name}}
--- 

It returns [object Object] rather than the title name. When I add {{name}} in the hbs file it outputs it directly but it doesn't want to output it as YAML Front Matter.

@assemblebot
Copy link

@Stefany93 Thanks for the issue! If you're reporting a bug, please be sure to include:

  • The version of assemble you are using.
  • Your assemblefile.js (This can be in a gist)
  • The commandline output. (Screenshot or gist is fine)
  • What you expected to happen instead.

If your issue is related to one of the following, please open an issue there:

  • grunt-assemble Issues with using assemble in grunt or the grunt-assemble library.
  • handlebars-helpers Issues with using handlebars helpers from the handlebars-helpers library.

@Stefany93
Copy link
Author

that assemble bot is annoying.

@jonschlinkert
Copy link
Member

jonschlinkert commented Jul 27, 2018

Thanks for the candid feedback. It's a catch-22, unfortunately. If we didn't use the bot, two people would have been annoyed.

edit: jk btw. I'm writing an answer to your question. Also it looks like you're using grunt-assemble, not assemble, is that correct? They are completely different applications.

@Stefany93
Copy link
Author

^^ Haha! Yes it is grunt-assemble.

@Stefany93
Copy link
Author

Anyone ?

@doowb
Copy link
Member

doowb commented Aug 15, 2018

@Stefany93 sorry for the delay. I'm not exactly sure how to answer the question, but I think it would have to do with how front-matter is parsed.

Is there a repository I can look at to get a better idea of what's happening?

@Stefany93
Copy link
Author

^^ Thank you jon & doowb, but I think I got front matter wrong - it is for hardcoding and I needed it populated from JSON which doesn't make sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants