ana*_*h.p 6 jekyll github-pages
jekyll new simple-sitegh-pages了回购的分支.现在该网站显示在github.io/下,但带有巨大的图标.
默认的jekyll生成站点中github和twitter的svg图标跨越页面的整个宽度.它们应该是16px左右.
同样,顶部出现3个巨大的块.它们又是svg,应该是细线.
这是我的网站:http://ananthp.github.io/carnatic_scores/
(repo:https://github.com/ananthp/carnatic_scores/tree/gh-pages)

Dav*_*uel 11
由于您的站点不在域ananthp.github.io/的根目录,但在"目录"carnatic_scores /中,您必须baseurl在_config.yml文件中设置变量.
baseurl: '/carnatic_scores'
Run Code Online (Sandbox Code Playgroud)
编辑:一些解释
在_includes/head.html中,您可以看到:
<link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
Run Code Online (Sandbox Code Playgroud)
这相当于
<link rel="stylesheet" href="{{ site.baseurl }}/css/main.css">
Run Code Online (Sandbox Code Playgroud)
随着baseurl设置为""(默认),您的相对URL是/css/main.css,其解析为http://ananthp.github.io/css/main.css通过浏览器= 404未找到.
随着baseurl设置为"/ carnatic_scores"你的相对URL是/carnatic_scores/css/main.css,其解析为http://ananthp.github.io/carnatic_scores/css/main.css您的浏览器=冷静CSS!
所有资产(css,js和image)都是如此:
<script src="{{ site.baseurl }}/path_to_scripts/script.js"></script>
<img src="{{ site.baseurl }}/path_to_images/image.jpg">
or in markdown

Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
797 次 |
| 最近记录: |