Recently, I decided to start my Blog on Github Pages. I forked Jekyll-Now and pulled the code into my local environment.
Now I am running jekyll serve
but it is not reading the posts in the _posts folder!.
It seems that the site.posts
variable in index.html
couldn't be read. If I output the variable or inspect it as : {{ site.posts | inspect }}
then it is empty.
The posts names are within the correct format YYYY-MM-DD-TITLE.md
If I run jekyll serve
inside the _posts
folder, then I will get an IndexOf
page with all the posts listed without any problem.
The content of _config.yml
:
# Name of your site (displayed in the header)
name: My name
# Short bio or description (displayed in the header)
description: Blog on various topics
# URL of your avatar or profile pic (you could use your GitHub profile pic)
# avatar: https://raw.githubusercontent.com/barryclark/jekyll-now/master/images/jekyll-logo.png
# Includes an icon in the footer for each username you enter
footer-links:
github: motleis/blog
baseurl: ""
permalink: /:title/
# The release of Jekyll Now that you're using
version: v3.4.0
# Jekyll 3 now only supports Kramdown for Markdown
kramdown:
# Use GitHub flavored markdown, including triple backtick fenced code blocks
input: GFM
# Jekyll 3 and GitHub Pages now only support rouge for syntax highlighting
syntax_highlighter: rouge
syntax_highlighter_opts:
# Use existing pygments syntax highlighting css
css_class: 'highlight'
# Set the Sass partials directory, as we're using @imports
sass:
style: :expanded # You might prefer to minify using :compressed
# Use the following plug-ins
gems:
- jekyll-sitemap # Create a sitemap using the official Jekyll sitemap gem
- jekyll-feed # Create an Atom feed using the official Jekyll feed gem
# Exclude these files from your production _site
exclude:
- Gemfile
- Gemfile.lock
- LICENSE
- README.md
- CNAME
Under _posts: I have only simple sample file : 2014-3-3-Hello-World.md
---
layout: post
title: You're up and running!
---
Just a single line that should be displayed!
And here goes the content of index.html
, where the posts should be listed:
site.posts : {{ site.posts }}
My posts:
<ul>
{% for post in site.posts %}
<li>
<a href="{{ post.url }}">{{ post.title }}</a>
{{ post.excerpt }}
</li>
{% endfor %}
</ul>
The result is :
site.posts :
My Posts:
As you can see site.posts is empty!
What is your suggestions to debug this issue?
I am running jeykll-3.4.0
_posts
folder and its filename. Also_config.yml
. – marcanuyjekyll serve
at the root folder (i.e. the folder that contains_config.yml
) – marcanuyjekyll serve
at the root folder where the_config.yml
and_posts
folder are located.Index.html
is also located there, and it seems to be compiled fine into_site
folder. If I edit theindex.html
with a static content, it will be built fine. The problem is that the variables are not accessed for some reason. – mtleisYYYY-MM-DD-TITLE.md
is different than2014-3-3-Hello-World.md
– marcanuy