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

Grids and multiple layouts? #622

Closed
dhatcode opened this issue Jan 3, 2017 · 1 comment
Closed

Grids and multiple layouts? #622

dhatcode opened this issue Jan 3, 2017 · 1 comment

Comments

@dhatcode
Copy link

dhatcode commented Jan 3, 2017

What's the proper way to integrate any grid in layout/template? Should I edit md.js wrapper for this?

How can I have multiple layout option and how to switch between them right from markdown file?

What "layout: post" in all markdown files mean? Can I change layouts? How to manage them, where are they stored? Is there any other layouts beside "post"?

@KyleAMathews
Copy link
Contributor

Hrrmm... the layout stuff in the frontmatter (for the starter-blog) were leftover from older version of things — I just removed them. They weren't being used for anything atm.

So you want to have multiple layouts for posts?

One way you can do that is add a layout: 'MY_LAYOUT' in your markdown files then in your md.js render function, check what layout is set and then return a different component e.g.

if (post.data.layout === `post`) {
  return <PostLayout {...post} />
} else if (post.data.layout === `something-else`) {
  return <SomethingElse {...post} />
}

You might want to check out this issue as well #605

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

2 participants