Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jekyll not generating pages in subfolders

I use GitHub Pages and created some pages in a sub folder. It seems to be not generating pages I created in sub folder. All other pages work fine. The directory structure is like this:

/
/index.html
/_config.yaml
/_includes
/_layouts
/_posts
/tag
/tag/personal.html
/tag/videos.html

The pages inside the /tag directory are not generated by Jekyll. Also, usually GitHub sends an email if Jekyll build fails, but did not, in this case. Also, if I do any other changes it works, so the build is apparently not failing.

The /tag/personal.html is here:

---
layout: default
title: Tag-personal
permalink: /tag/personal/index.html
tagspec: personal
---
<div id="tagpage">
  <h1>Posts tagged personal</h1>
{% include tags.html %}
</div>

and /_includes/tags.html is here:

{% for tag in post.tags %}
  {% if tag == page.tagspec %}
    {% assign ispostviable = true %}
  {% endif %}
{% endfor %}

  <ul class="posts">
{% for post in site.posts %}
  {% if ispostviable == true %}
    <li><a href="{{ post.url }}"></li>
  {% endif %}
{% endfor %}
  </ul>

PS: I use GitHub Pages and have no access to a Jekyll instance at my development machine (Windows).

like image 707
Ameer Avatar asked Aug 23 '13 11:08

Ameer


1 Answers

Joshua Powell provided step-by-step directions in reply to a similar question on Github.

  1. Edit _config.yml to add the following line (or expand the array, if it exists)

    include: ['_pages']

    where _pages is the name of the folder in which you wish to keep your files. (This also works for nested folders if you explicitly add them, e.g., ['_pages', '_pages/foo'].)

  2. Move your pages into that folder. (These pages may be HTML, Markdown, or whatever else Jekyll renders when it’s placed in the root folder.)

  3. Give them front matter with an appropiate permalink including a trailing slash, e.g., permalink: "/about/".

like image 75
tjanson Avatar answered Sep 18 '22 02:09

tjanson