0

I've to define a post like as shown which is derived from mylayout.html:

---
layout: mylayout
title:   "My Post"
varA: default
---
This post is bla bla bla ...

How can i have a layout that makes use of varA in mylayout.html?. I wish to achieve mylayout.html as something like following:

---
layout:default
---
<H1>This is {{post.varA}}</H1>

{{content}}
yaitloutou
  • 1,691
  • 19
  • 23
SACn
  • 1,862
  • 1
  • 14
  • 29

1 Answers1

0

Found a solution, I was using {{post.varA}} in layout considering it's a post variable. But, I guess inside layout it is accessed as {{page.editorfile}}. Using following mylayout.html solved this issue:

---
layout:default
---
<H1>This is {{page.varA}}</H1>

{{content}}
SACn
  • 1,862
  • 1
  • 14
  • 29