简体   繁体   中英

Cannot link posts on blog for github

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

It sounds like you want to use separate categories for your posts. ie 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.

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'] %}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM