Post permalinks not being parsed in Jekyll on GitHub Pages

为君一笑 提交于 2019-12-11 10:40:46

问题


I've created a new site at GitHub Pages, using Jekyll. I'm using a custom permalink format in the following form:

permalink: /:title

This is because I've moved my blog over from WordPress and want previously existing links to continue working. When I run the server locally with "jekyll serve", it works fine - however, once it's hosted on GitHub Pages, the links don't get parsed correctly, leading to tags like this one:

<a class="post-link" href="/:title">Markdown and HTML</a>

Further information - I am using a custom domain, with my _config.yml containing:

url: http://domain.com

And my CNAME containing:

domain.com

Could anyone shed some light on why this occurs? Thanks.


回答1:


You're trying to use a functionality that was implemented in Jekyll 2.5. As Github pages runs Jekyll 2.4, it breaks :-(

The only way to do what you want is to set default permalink in you _config.yml file.

permalink: :title/


来源:https://stackoverflow.com/questions/29061077/post-permalinks-not-being-parsed-in-jekyll-on-github-pages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!