3

I am learning about how to use Jekyll and Github recently and I am having a hard time getting my website to display correctly online but it does display correctly locally when I run:

jekyll serve --baseurl ''

My Github repo that I am working on is http://yungkickz.github.io/kingwizard

Github Tree

Any help or hints would be super helpful.

Edit: Basically this entire website is missing the correct CSS and links are pointing to the wrong place; especially the first Home and About link as any the other links were made to just test.

My config.yml:

name: kingwizard
description: wizardly blog

paginate: 5
url: "http://yungkickz.github.io"
baseurl: /kingwizard


markdown: rdiscount

Also here I've added the beginning of the 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>
4

1 回答 1

4

您网站的源代码来看,我注意到了一些问题:

  1. 您对 HTML、CSS 和 JavaScript 文件的许多引用都以//. 尽管您的配置文件中进行了设置,但出于某种原因似乎site.baseurl已在 GitHub 上设置为。/但是,您经常在路径后添加斜杠site.baseurl,这会导致出现第二个斜杠。

  2. 因为site.baseurl/,浏览器会期望在http://yungkickz.github.io/SOME_PATH. 但是,您的站点实际上已部署到http://yungkickz.github.io/kingwizard,因此您的链接应该指向http://yungkickz.github.io/kingwizard/SOME_PATH

  3. 由于 404 错误,您的 CSS 样式未加载,这就是您的网站看起来格式不正确的原因。

前:

<link href="{{ site.baseurl }}/css/bootstrap.css" rel="stylesheet">

后:

<link href="/kingwizard/css/bootstrap.css" rel="stylesheet">
于 2013-11-04T06:17:50.320 回答