0
votes

I've created a default web _layout for my jekyll site. Liquid tags get processed as expected in the default.html which is great. In the excerpt below, the loop and post.url & post.title expand as expected. But I want to load the content into the with id="page-content-wrapper". The content that load in the div comes from pages/blog.html. If I put Liquid directives in that file, jekyll is not processing them, so the content that renders just show the literal "{{ content }}".

How do I get jekyll to process the liquid tags in the pages/blog.html?

enter image description here

1
Did you have a github repository ?David Jacquel
I've just checked it in: github.com/purpleHey/monroeatxpurplehey

1 Answers

1
votes

OK, get it !

Your pages are not generated by jekyll, they are just copied as static files. In order to generate your pages, your need to add a front matter to them.

page/home.html

---
layout: null
---
<div class="row-fluid">
  <div class="row">
    <div class="col-md-8">
      <h1>Home Page</h1>
        {{ site.name }}
      <p>Content will go here</p>
    </div>
    <div class="col-md-4">
      <h3>Sidebar</h3>
      <p>Sidebar content goes here.</p>
    </div>
  </div>
</div>

This will generate the html fragment needed by your ajax call. Do this on every file in pages folder.

A little problem come with your permalink setup permalink: pretty. With this setup, pages/home.html becomes pages/home/index.html and your ajax call returns a 404 error.

You can set permalink: :title and it will work fine.