Github Pages上的Jekyll部署格式不正确(无样式) [英] Jekyll Deployment on Github Pages doesn't format correctly (No styling)

查看:370
本文介绍了Github Pages上的Jekyll部署格式不正确(无样式)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我想说我已经尝试了2个多小时来尝试纠正此错误,但是我无法弄清楚.我还是Jekyll和Github Pages的新手.但是,我有足够的代码能力,并且可以更正所有错误.

First of all, I would like to say I have tried for 2+ hours to try and correct this error, but alas I cannot figure it out. I am also a newbie to Jekyll and Github Pages. However, I am competent in code and can correct any errors.

当我进入该存储库的github页面时:

When I go to my github pages for this repository:

存储库链接2: https://github.com/jeffward01/Conscience-Alchemy.git

Github页面链接: https://jeffward01.github.io/Conscience-Alchemy

Github pages link: https://jeffward01.github.io/Conscience-Alchemy

没有应用格式.我知道/怀疑我的base.url和/或_config.yml文件中的url有问题.我尝试了14种组合,但无法弄清楚.

There is no formating applied. I know/suspect its a problem with my base.url and/or url in the _config.yml file. I have tried 14 combinations and cannot figure it out.

当我运行jekyll serve --baseurl时,它将运行并应用格式/样式...但是,当我转到GitHub页面时,它不会...

When I run jekyll serve --baseurl it runs and applies the formating/styles... But, when I go to the GitHub pages, it does not...

有人有任何提示/建议/答案吗?

Does anyone have any tips/advice/answers?

谢谢!

为了您的方便,这是我的_config.yml文件:

For your ease, here is my _config.yml file:

`
# Site settings
title: Conscience Alchemy
description: "A blog about Conscienceness and Alchemy"
url: "http://jeffward01.github.io"
author:
  name: "Jeff Ward"
  email: "conscience-alchemy@gmail.com"
  url: "http://jeffward01.github.io"
  baseurl: /Conscience-Alchemy

# Build settings
baseurl: /Conscience-Alchemy
markdown: kramdown
source: .
destination: ./_site
permalink: /:title
paginate: 8
paginate_path: /page:num/

# Default values
defaults:
  -
    scope:
      path: ""
      type: "posts"
    values:
      layout: "post"

# Custom variables
version: "1.68"

# Options
custom_header: false
custom_nav_footer: false
reverse: false
'

这是我的index.html文件的开头(我不确定您是否需要其他文件,所以我没有添加它们.它们在我的GitHub Tree上.)

And here is the beginning of my index.html file (I was not sure if you needed other file so I did not add them. They are on my GitHub Tree tho.)

---
layout: default
---
<!-- Posts -->
<ul id="posts">

    {% for post in paginator.posts %}

      <li class="post">
        <h2><a href="{% if site.baseurl == "/" %}{{ post.url }}{% else %}{{ post.url | prepend: site.baseurl }}{% endif %}">{{ post.title }}</a></h2>
        <time datetime="{{ post.date | date_to_xmlschema }}" class="by-line">{{ post.date | date_to_string }}</time>
        <p>{{ post.content | strip_html | truncatewords:50 }}</p>
      </li>

    {% endfor %}

</ul>

推荐答案

在您的_config.yml存储库中,您有baseurl: /,我认为您必须将其更改为baseurl: /Conscience-Alchemy.

In your _config.yml repository you have baseurl: /, I think you must change it to baseurl: /Conscience-Alchemy.

这篇关于Github Pages上的Jekyll部署格式不正确(无样式)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆