I've just installed Jekyll and I'm following a few tuts. I get that you define your content in a .md file in the root and that generates your html file based on the layout file you chose but what I don't get is how to split your {{ content }}
up.
Say for instance I want one piece of content from my .md file in a <article>
and the other in an <aside>
How would I go about doing this? Code in question is pasted below. Thanks
.md file
---
layout: page
title: Page Test
permalink: /page-test/
bodyclass: page-test
---
Article content
* Hey this is my content!
Aside content
* Test links
Layout file
---
layout: default
---
<div class="post">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
</header>
<article class="post-content">
{{ content }}
</article>
<aside>
</aside>
</div>
You can use the post.excerpt
functionality.
_config.yml
excerpt_separator: "<!--more-->"
post
---
frontmatter
---
Excerpt text
<!--more-->
Body text
....
layout
---
layout: default
---
<div class="post">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
</header>
<article class="post-content">
{% assign contentArray = page.content | markdownify | split: site.excerpt_separator %}
{{ contentArray.last }}
</article>
<aside>
{{ contentArray.first }}
</aside>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With