I have pages with quite a bit of content on them. I want to make the content more appealing to the reader and not just a “wall of text”.
In order to do this, I want to divide the content up into sections that have varying styling and introduce imagery.
I find this pretty hard to do with jekyll.
Example pages that illustrate what I mean:
- Sentia Technology | Cloud technology to lead the way
- The institutions Denmark counts on, count on us | Aeven
- Job Openings and Benefits | Forethought
- What We Do • Altec
- About HubSpot | HubSpot’s Story
Here each subsection (H2 element and accompagnying text) is placed inside a
How can I do this with jekyll?
If I just put
Like:
<div class="section1">
## section 1
lorem ipsum
dolor amet...
</div>
This would just lead to the following content:
<div class="section1">## section 1 lorem ipsum dolor amet...</div>
and not expected
<div class="section1">
<h2>section 1</h2>
<p>
lorem ipsum
</p>
<p>
dolor amet...
</p>
</div>
Another approach that might work is to instead of haveing all the content in mypage.md, then have mypage.md, and then have that {{ include }} the content for each section and then have the html styling outside of the include.
While this might work, it would be a huge mess to organize. Firstly, because all the included files would have to just float around inside _include folder. Secondly, because the number of files would be huge. I am currently working on a single page that has 10 h2 subsections. I would then need 10 include pages just for that page alone. This site probably have at least 50 of such pages. So that is 500 include pages…
Thirdly, this approach would make it very difficult to actually change the content because I would have to open and manage 10 include pages just to change the content…
I think doing this type of page design with varying styles on sections is a pretty common pattern nowadays and thus, I hope there is a better way of doing this with jekyll. I am sure others have thought about this too.