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

Layout specified in site.json is not applied when page does not have front matter #630

Closed
Xenonym opened this issue Jan 24, 2019 · 1 comment

Comments

@Xenonym
Copy link
Contributor

Xenonym commented Jan 24, 2019

Tell us about your environment

  • MarkBind Version: 1.17.0

What did you do? Please include the actual source code causing the issue.
I created a MarkBind site with two layouts, default and testLayout.

In _markbind/layouts/default/footer.md:

<footer>
  <div class="text-center">
    Default footer
  </div>
</footer>

In _markbind/layouts/testLayout/footer.md:

<footer>
  <div class="text-center">
    testLayout footer
  </div>
</footer>

I then specified that "layout: "testLayout" for index.md in site.json:

{
  "src": "index.md",
  "title": "Hello World",
  "layout": "testLayout"
},

In index.md:

# Hello world
Welcome to your page generated with MarkBind.

I then did markbind serve.

What did you expect to happen?
I expected testLayout to apply to index.md, displaying testLayout footer for the footer.

What actually happened? Please include the actual, raw output.
The footer from the default layout displayed instead. This also happens when a empty <frontmatter> is included.

If I include a <frontmatter> with content in index.md, then testLayout does get applied:

<frontmatter>
	title: Hello World
</frontmatter>
# Hello world
Welcome to your page generated with MarkBind.
@damithc damithc added this to Nice-To-Have in V2 Feb 3, 2019
@damithc damithc removed this from Nice-To-Have in V2 May 20, 2019
@ang-zeyu
Copy link
Contributor

ang-zeyu commented Oct 3, 2020

oops. fixed in #1321

@ang-zeyu ang-zeyu closed this as completed Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants