This is a Jekyll-specific way to render HTML source for a given page (in this case, one in a collection) alongside the markup itself without having to duplicate content in includes.
Created
November 21, 2016 15:37
-
-
Save shawnbot/2138bd77d1a685d76a5178464efe96df to your computer and use it in GitHub Desktop.
Jekyll page preview + source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
--- | |
{% for component in site.components %} | |
<h1>{{ component.title }}</h1> | |
<div class="preview">{{ component.content }}</div> | |
{% capture markup %} | |
```html | |
{{ component.content }} | |
``` | |
{% endcapture %} | |
<pre class="code">{{ markup | markdownify }}</pre> | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment