简体   繁体   English

无法链接GitHub博客上的帖子

[英]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. 在我的github页面上,我在顶部有一个名为project的标签,并且在那里列出了很多我的项目。 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? 好的,问题是_postsi没有在_config.yml中定义,有人知道我该怎么做?

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) 我的projects.md调用我的_posts文件夹(其中列出了项目),而我正在尝试创建我的Initiatives.md调用我的_postsi文件夹(其中存在填充器倡议)

https://github.com/tusharjoshi1/tusharjoshi1.github.io www.tusharjoshi1.com 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. 另外,当我发现《哈姆雷特》的Monologue.md文件没有包含《哈姆雷特》的独白时,我有点失望…… 这出戏就是我要抓住国王的良心。

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 在要显示在“启动项”标签下的帖子开头设置类别“启动项”后,请将您在Initiative.md中的代码更改为以下内容

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 请注意Initiative.md中的以下行

{% for post in site.categories.initiatives %} {%for site.categories.initiatives%中的帖子}

should change to 应该更改为

{% for post in site.categories['initiatives'] %} {%for site.categories ['initiatives']%}中的帖子

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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