我正在学习如何最近使用Jekyll和Github,并且我很难让我的网站在线显示正确,但它在本地显示正确:Jekyll部署在Github上页面的格式不正确,链接中断
,我的工作就jekyll serve --baseurl ''
我的GitHub库是http://yungkickz.github.io/kingwizard
任何帮助或提示将是超级有用。
编辑:基本上这整个网站缺少正确的CSS和链接指向错误的地方;特别是第一个Home和About链接,因为其他链接都只是为了测试。
我config.yml:
name: kingwizard
description: wizardly blog
paginate: 5
url: "http://yungkickz.github.io"
baseurl: /kingwizard
markdown: rdiscount
而且,这里我添加的html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{{ site.description }}">
<meta name="author" content="">
<title>{{ site.name }}</title>
<!-- Bootstrap core CSS -->
<link href="{{ site.baseurl }}/css/bootstrap.css" rel="stylesheet">
<!-- Custom Arreis Style -->
<link href="{{ site.baseurl }}/css/custom-style.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="{{ site.baseurl}}js/html5shiv.js"></script>
<script src="{{ site.baseurl}}js/respond.min.js"></script>
<![endif]-->
</head>
谢谢你, 在我的'header.html'基本上就像你的 “前”,但我我应该在代码中的每个地方单独更改路径?我认为'site.baseurl'会动态地为我做这个部分,所以我不必这样做。 我很抱歉,但我真的很新,但真正感谢您的帮助! –
没关系,我发现'site.baseurl'的问题,所以你应该仍然使用它。当我在本地运行'jekyll serve --baseurl'''时,我注意到输出的第一行是'Configuration file:none'。事实证明,jekyll(本地和GitHub)没有加载你的配置文件,因为它被命名为'config.yml',而不是'_config.yml'(它应该是什么)。 –
很棒的发现!谢谢! (菜鸟错误)那肯定会解决CSS问题和其他许多错误!你怎么注意到'Configuration file:none',因为我在终端上运行jekyll时没有看到。 –