Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress导出到Jekyll-无法找到帖子的索引链接_Jekyll - Fatal编程技术网

Wordpress导出到Jekyll-无法找到帖子的索引链接

Wordpress导出到Jekyll-无法找到帖子的索引链接,jekyll,Jekyll,我使用了WordPress导出到Jekyll ExporterWordPress导出到Jekyll 我已将文件上载到mygithubname.Github.io存储库 我将以下代码放在index.md上 ## Welcome to {{ site.url }} ### Posts <ul> {% for post in site.posts %} <li> <a href="{{ post.url }}">{{ post.title

我使用了
WordPress导出到Jekyll Exporter
WordPress导出到Jekyll

我已将文件上载到
mygithubname.Github.io
存储库

我将以下代码放在
index.md

## Welcome to {{ site.url }}

### Posts

<ul>
  {% for post in site.posts %}
    <li>
      <a href="{{ post.url }}">{{ post.title }}</a>
    </li>
  {% endfor %}
</ul>

我如何让Jekyll生成有效的链接?

您之所以会得到像
/?p=247
这样的URL,是因为您的帖子在每个标记文件中都有定义。如果删除
permalink
属性,您将允许
jekyll
自动生成每篇文章的URL

如果您想要一些代码示例,这里有一个简单的基于
jekyll
的网站,它显示了当您在降价(即
*.md
)文件的前面省略
permalink
时会发生什么

下面是一个具体的帖子示例,展示了
jekyll
如何为帖子分配URL

一篇文章的源代码:

提供的职位:

我在记事本++中打开了所有post文件,并用
[/]查找并替换了
permalink
:#permalink
以注释掉所有permalink,它现在使用的是Jekyll生成的链接。@curtisp感谢您分享您所做的一切。这将有助于其他人谁是在相同的情况下,你的问题。
---
id: 247
title: Always remember to start Python Virtualenv
date: 2016-01-29T03:56:06+00:00
author: mygithubname
layout: post
guid: http://mygithubname.github.io/?p=247
permalink: /?p=247
categories:
  - django
  - Python
---