Hi folks!
I’m helping develop some new content for a GH pages site maintained by my lab, and have been unable to convince Jekyll 3.01 /Liquid/Kramdown to parse YAML copy as markdown. I suspect this is a user error issue, but I have been unable to identify a solution that doesn’t involve hard-coding the page in HTML.
I have scoured stackOverflow, and poked around with markdown="1"
, and the markdownify
filter with no luck. Again, this may be user error. I would prefer a minor tweak along those lines, but am willing to tackle structural/organizational changes if that yields a working product.
The current setup:
- A YAML file with a header and many subsections. Looks like this:
- name: This is the page name
subsections:
- name: Subsection 1
summary: >
This section is the main body copy for the subsection. It has a [link](http://endless.horse/), and an unordered list:
* item one
* item two
github: socialLink
- name: Subsection 2
summary: >
This section is the main body copy for the subsection and goes on for quite a while about important things.
twitter: socialButterfly
- An HTML page using Liquid to parse and display the YAML data:
---
layout: page
title: SomePageTitle
permalink: /undergrad/
color: MediumVioletRed
---
{% for section in site.data.mypage %}
<h1 id="{{section.name | downcase | replace:' ','_' }}">{{section.name}}</h1>
{% for subsection in section.subsections %}
<div class="myClass">
<div class="myClass__container">
<div class="myClass__header">
<span class="myClass__title">
{% if subsection.site %}
<a href="{{subsection.site}}" target="_blank">{{subsection.name}}</a>
{% else %}
{{subsection.name}}
{% endif %}
</span>
<span class="myClass__social">
{% if subsection.github %}
<a href="https://github.com/{{subsection.github}}" target="_blank"><i class="fa fa-github"></i></a>
{% endif %}
{% if subsection.twitter %}
<a href="https://twitter.com/{{subsection.twitter}}" target="_blank"><i class="fa fa-twitter"></i></a>
{% endif %}
</span>
</div>
<div class="ug__summary">
{{subsection.summary}}
</div>
</div>
</div>
{% endfor %}
{% endfor %}
A final note: I have also attempted to build this page using a .md
file in place of the YAML data/HTML/Liquid combination. This would not be ideal if it worked (because the styling is less DRY), but that’s moot. In that implementation, Header styling, links, and some other markdown features parse properly, but unordered lists (using *
or -
) do not render as such.
Thanks for your time and support!
Chris