0

On my github page I have a tab at the top called projects, and I have a bunch of my projects listed there. I created a second tab at the top called initiatives, however I was not able to fill in my initiatives.

Okay so the issue is that _postsi is not defined in _config.yml anyone know how I can do this?

My projects.md calls on my _posts folder (where I have projects listed), and I'm trying to make my initiatives.md call on my _postsi folder (where I have filler initiatives in there)

https://github.com/tusharjoshi1/tusharjoshi1.github.io www.tusharjoshi1.com

Tushar Joshi
  • 55
  • 1
  • 2
  • 7

2 Answers2

0

It sounds like you want to use separate categories for your posts. i.e. you would have your projects and initiatives as separate categories.

root
 | -- index.html
 | -- _posts
      | -- projects
           | -- 2014-12-02-Calculating-Molar-Values-Using-VBA.md
           | -- 2015-05-27-Air-Flow-Measurements.md
      | -- initiatives
           | -- 2015-02-13-hamlet-monologue.md
           | -- 2015-02-26-flake-it-till-you-make-it.md

Then for your pages you would reference the catetory.

{% for poem in site.categories.initiatives %}
  {{ initiative.output }}
{% endfor %}

Here's a link that covers this same question for more info.

Also, a little disappointed when I found the Hamlet Monologue.md file didn't include a monologue from Hamlet... the play's the thing Wherein I'll catch the conscience of the King.

Keif Kraken
  • 9,500
  • 1
  • 10
  • 12
  • By categories do I just have to put a folder called projects and initiatives inside _posts? Or is there something I have to change within the config.yml? – Tushar Joshi Sep 09 '16 at 22:41
0

After you set the category "initiatives" in your front matter of your post that you want to appear under the tab "initiatives", change you code in initiatives.md to below

Currently Being Updated.
<ul>
  {% for post in site.categories['initiatives'] %}
    <div>
      <a href="{{ post.url }}">{{ post.title }}</a>
      {{ post.excerpt }}
    <hr>
    </div>
  {% endfor %}
</ul>

Note the below line in initiatives.md

{% for post in site.categories.initiatives %}

should change to

{% for post in site.categories['initiatives'] %}

visamba
  • 174
  • 7
  • By categories do I just have to put a folder called projects and initiatives inside _posts? Or is there something I have to change within the config.yml? – Tushar Joshi Sep 09 '16 at 20:47
  • I dont think this will work for you. Your front matter in all the posts in your initiatives folder - for eg: 2015-02-13-hamlet-monologue.md has a category called "initiative" and your code in initiatives.md refers to {% for post in site.categories['initiatives'] %}. Either change your category in your post to category: initiatives or change the code in config file to {% for post in site.categories['initiative'] %} – visamba Sep 10 '16 at 00:46