Jekyll 搭建 Blog 上传到 Github,访问报错 404?


我用Jekyll 搭建了blog,项目在本地( $jekyll --server )启动完全正常,上传到github之后,输入wushijing30.github.io直接转到404页面。尝试了好多方法,都找不到解决方法,麻烦实现了的哥们指点指点,代码托管在 https://github.com/wushijing30/wushijing30.github.io ,真是万分感激。

补充说明:
之前访问直接为404,后来在本地 $ jekyll build 之后,push到github,这次可以访问wushijing30.github.io,但是,里面的跳转链接如 “Welcome to Jekyll!”,点击之后还是404,查看 /_site/index.html ,生成的链接都不对,如


 <a class="post-link" href="/wushijing30.github.io//jekyll/update/2015/10/07/welcome-to-jekyll.html">Welcome to Jekyll!</a>

实际点击时跳转的网页地址为 http://wushijing30.github.io/wushijing30.github.io//jekyll/update/2015/10/07/welcome-to-jekyll.html
两者不一致,此时 _config.yml 为:


 # Site settings
title: Your awesome title
email: [email protected]
description: > # this means to ignore newlines until "baseurl:"
  Write an awesome description for your new site here. You can edit this
  line in _config.yml. It will appear in your document head meta (for
  Google search results) and in your feed.xml site description.
baseurl: /wushijing30.github.io/ # the subpath of your site, e.g. /blog/
url: "https://wushijing30.github.io" # the base hostname & protocol for your site
twitter_username: jekyllrb
github_username:  jekyll

# Build settings
markdown: kramdown

我也尝试过将 baseurl: /wushijing30.github.io/ 的配置改为 baseurl: / 依然不行,跳转的链接为:jekyll/update/2015/10/07/welcome-to-jekyll.html。

jekyll github-pages

吴克的叔叔葛炮 8 years, 6 months ago

Your Answer