更改 Jekyll 站点中的 baseurl 破坏 CSS
Change baseurl in Jekyll site destroy the CSS
我是 Jekyll 的新用户,不熟悉网络技术。我用这些命令创建我的博客。添加文章并发布它们非常有效。但是,当我更改 _config.yml
中的 baseurl
参数时,破坏了 CSS 网站。
CSS Broken by baseurl modifications
这是我执行的命令:
git clone mypseudo.github.io (empty repository)
jekyll new mypseudo.github.io
cd mypseudo.github.io
bundle exec jekyll serve
git add --all
git commit -m "Initial commit"
git push origin master
到这一步,博客就完美了。现在我添加我的文件
git add --all
git commit -m "Adding articles"
git push origin master
到这一步,博客就完美了
修改_config.yml
。将值 baseurl: ""
更改为 baseurl: "/blog"
:
git add _config.yml
git commit -m "Modification of the base URL"
git push origin master
到了这一步。我的博客坏了。为什么它不自动管理。我该如何解决?
如果您的站点托管在 mypseudo.github.io,您的配置中必须有 baseurl: ""
。
如果您想在 mypseudo.github.io/blog 托管您的网站,您需要在 "blog" 存储库,然后设置 baseurl:"/blog"
以指示 Jekyll 为您的资源生成有效的 url。
我是 Jekyll 的新用户,不熟悉网络技术。我用这些命令创建我的博客。添加文章并发布它们非常有效。但是,当我更改 _config.yml
中的 baseurl
参数时,破坏了 CSS 网站。
CSS Broken by baseurl modifications
这是我执行的命令:
git clone mypseudo.github.io (empty repository)
jekyll new mypseudo.github.io
cd mypseudo.github.io
bundle exec jekyll serve
git add --all
git commit -m "Initial commit"
git push origin master
到这一步,博客就完美了。现在我添加我的文件
git add --all
git commit -m "Adding articles"
git push origin master
到这一步,博客就完美了
修改_config.yml
。将值 baseurl: ""
更改为 baseurl: "/blog"
:
git add _config.yml
git commit -m "Modification of the base URL"
git push origin master
到了这一步。我的博客坏了。为什么它不自动管理。我该如何解决?
如果您的站点托管在 mypseudo.github.io,您的配置中必须有 baseurl: ""
。
如果您想在 mypseudo.github.io/blog 托管您的网站,您需要在 "blog" 存储库,然后设置 baseurl:"/blog"
以指示 Jekyll 为您的资源生成有效的 url。