Mpr*_*ron 4 jekyll twitter-bootstrap
我已经有一个username.github.io存储库用于我的个人博客,现在我的目标是使用我发现的完全不同的主题创建另一个由 github 托管的 jekyll 页面。这是我正在使用的主题的链接:https : //github.com/jeromelachaud/freelancer-theme
所以我在我的机器和github上创建了一个新的仓库,将本地仓库连接到远程github上,创建了一个孤儿gh-pages分支,然后fork了freelancer-theme并将其克隆到我创建的新仓库的文件夹中在 gh-pages 分支上。我使用一个命令将所有文件(我认为的 git init 除外)移动到新存储库的父文件夹中。我删除了 freelancer-theme fork 文件夹并使用 gem install jekyll 安装了最新版本的 Jekyll。然后我运行 jekyll serve 并且该站点在我的机器上完美呈现。做了一些修改,新的修改仍然可以很好地呈现。将这些更改推送到我在 github 上的存储库的 gh-pages 分支后,我现在转到 username.github。
有没有人处理过这个主题,他们知道可能的原因吗?它的文档非常稀少。
这是我的 github 页面的 url,样式表不起作用:http : //mpron.github.io/mybrotheriswrong/
这是我在 gh-pages 分支上的新仓库:https : //github.com/mpron/mybrotheriswrong/tree/gh-pages
由于您的 github pages 站点是一个项目站点,因此他的默认 url 看起来像user.github.io/projectrepository。
这意味着当您在/resourcefolder/ressource.css 中查找资源(css、js 或 img)时,它会在user.github.io/resourcefolder/ressource.css 中查找。
该/ projectrepository部分缺失,这就是为什么你必须使用的BaseURL参数_config.yml
在您的情况下,您只需要添加:
baseurl: /mybrotheriswrong
Run Code Online (Sandbox Code Playgroud)
在你的_config.yml 中。
这 然后标记会将其添加到您的 css href 并在/mybrotheriswrong/css/font-awesome/css/font-awesome.min.css 中成功找到它。
这也将解决您的 js 问题。
你也应该使用site.baseurl您的图像,如果你计划有不同的级别像网页约/ index.html的或使用后的永久像somefolder /
<img src="{{ site.baseurl }}/img/portfolio/{{ post.img }}" class="img-responsive" alt="{{ post.alt }}">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2889 次 |
| 最近记录: |