jekyll / jekyll-help

NO LONGER MAINTAINED. USE JEKYLL TALK INSTEAD.
https://talk.jekyllrb.com
146 stars 19 forks source link

Broken build due to load tag #323

Closed raybesiga closed 8 years ago

raybesiga commented 8 years ago

Still experiencing this bug. I am using Jekyll 3.1.1 on Mac OS X 10.11.2 and I am using Rouge for syntax highlighting in a .markdown post file.

I use regular markdown for text and headers and the highlight command for special commands. I have encountered an issue while using {% raw %} and {% endraw %} to wrap code that I wanted Liquid to leave as is, as shown below:

Before we can show data in the `index.html` file, we need to get the context data within the views file. Let is make those changes to our `yokogao/views.py` file.

{% highlight django %}
import dateutil.parser
from django.shortcuts import render
import requests

def index(request):
    yoko = requests.get('https://api.github.com/users/raybesiga')
    context = yoko.json()

    # context has a created_at key with a string value
    # parse the string value into a python date object
    context['created_at'] = dateutil.parser.parse(context['created_at'])
    return render(request, 'yokogao/index.html', context)
{% endhighlight %}

Then edit the `index.html` file

{% raw %}
{% extends "base.html" %}

{% block title %} Github Yokogao {% endblock %}

{% block content %}
<div class="columns centered">
    <div class="one-third column centered">
        <h3>Basic Django app with the Github API</h3>
    </div>
</div>
<div class="columns">
  <div class="one-third column centered">
    <img class="avatar" src="{{ avatar_url }}" width="300" height="300" style="border-radius: 50%;">
  </div>
  <div class="one-third column centered">
    <p><br></p>
  </div>
  <div class="one-third column centered">
        <nav class="menu">
            <a class="menu-item" href="#">
            <span class="octicon octicon-person"></span>
            {{ name }}
          </a>
          <a class="menu-item" href="#">
            <span class="octicon octicon-location"></span>
            {{ location }}
          </a>
          <a class="menu-item" href="#">
            <span class="octicon octicon-list-ordered"></span>
            <span class="counter">{{ public_repos }}</span>
            Public Repos
          </a>
          <a class="menu-item" href="#">
            <span class="octicon octicon-bookmark" ></span>
            <span class="counter">{{ followers }}</span>
            Followers
          </a>
          <a class="menu-item" href="#">
            <span class="octicon octicon-eye"></span>
            <span class="counter">{{ following }}</span>
            Following
          </a>
          <a class="menu-item" href="#">
            <span class="octicon octicon-calendar"></span>
            Member for {{ created_at|timesince }}
          </a>
          <a class="menu-item " href="{{ blog }}" target="_blank">
            <span class="octicon octicon-globe"></span>
            Website: {{ blog }}
          </a>
        </nav>
    </div>
</div>
<div clas="columns">
    <div class="one-third column centered">
        <h4>Built with <span class="octicon octicon-heart" ></span> using the Github API and Primer</h4>
    </div>
</div>
{% endblock %}
{% endraw %}

Now if you run your server, you should have the browser showing your yokogao on the index page.

However, when I run jekyll serve, I get the following error:

test-site git:(master) ✗ jekyll serve --profile
Configuration file: /Users/raybesiga/Projects/test-site/_config.yml
            Source: /Users/raybesiga/Projects/test-site
       Destination: /Users/raybesiga/Projects/test-site/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
  Liquid Exception: Liquid syntax error: Unknown tag 'load' in /Users/raybesiga/Projects/test-site/_posts/2016-02-23-basic-django-app-github-api.markdown
jekyll 3.1.1 | Error:  Liquid syntax error: Unknown tag 'load'

Will appreciate any help and support. Cheers.

jekyllbot commented 8 years ago

This repository is no longer maintained. If you're still experiencing this problem, please search for your issue on Jekyll Talk, our new community forum. If it isn't there, feel free to post to the Help category and someone will assist you. Thanks!