How to pass {% captured %} variable from a view to the layout in Jekyll/Liquid? -
i trying rebuild blog in jekyll , have stubled upon simple task.
provided have following set of templates:
default.html:
{{ head }} {{ content }}
frontpage.html:
--- layout: default --- {% capture head %} frontpage {% end %} {{ content }}
index.html:
--- layout: frontpage --- other stuff
i expecting {% capture head %}
pass variable layout. seems variables front matter being passed page.variable_name
.
is there way pass capture
-d var layout in jekyll?
guess make 2 different layouts frontpage
, normal_page
replace whole {{head}}{{content}}
block in layout. that's twice html, i'd rather solve capture
if possible.
you can't capture, can using include. every level of page hierarchy can override head
key point different include file required
default.html
{% include {{ page.head }} %} {{ content }}
frontpage.html
--- layout: default head: header1.html --- {{ content }}
_includes/header1.html
(frontpage header content)
Comments
Post a Comment