【问题标题】:jekyll posts not displaying/formatting correctly on github pages (rest of site is OK though)jekyll 帖子在 github 页面上未正确显示/格式(但站点的其余部分还可以)
【发布时间】:2015-11-22 01:51:55
【问题描述】:

当我终于设法让这个网站上线时,我非常高兴,但不幸的是,帖子的格式或样式不正确,我不知道问题出在哪里。它位于https://github.com/skydusk/skydusk.github.io,网站在这里:http://skydusk.github.io/

谁能告诉我这里做错了什么?

config.yml

##The website title
name: skydusk
url: "http://skydusk.github.io"
##Markdown processor
markdown: kramdown
##syntax highlighter. change it to pygments
highlighter: pygments

##define base_url for valid usage in sitemap.xml and robots.txt
base_url: /skydusk
sass:
  sass_dir: _sass
  style: :compressed
paginate: 5
paginate_path: "page:num"
##The website description (to be used in meta tags)
description: just another personal blog
##Some frequently used keywords on your website
keywords: windows, storage, crashplan, synology, backups, itunes

##define this for disqus comment support
#disqus: skydusk

##set this to enable google analytics
#ga_id: UA-66844898-1
#ga_domain: www.skydusk.com

##Some commonly used links
links:
  facebook: username
  twitter: username
  email: info@skydusk.com
  github: username

##put desired image in img/ directory and set the value accordingly. If not defined, a placeholder image will be used.
about_image: placeholder.jpg
##comment this if you want full width posts with no sidebar
sidebar: off

【问题讨论】:

  • 您遇到了什么问题?

标签: ruby github jekyll


【解决方案1】:

您的_layout/post 文件 (here) 似乎有问题,它没有加载 CSS。检查帖子的 CSS 是否良好或尝试其他模板。

【讨论】:

  • 问题出在 default.html 中。 必须改为 开始时缺少破折号这就是它的原因,这要归功于 reddit 上的 nowonmai666。我希望这可以帮助某人。
  • 太棒了!享受你的杰基尔
【解决方案2】:

问题出在 default.html 中。 <link rel="stylesheet" href="css/style.css"> 必须改为

<link rel="stylesheet" href="/css/style.css"> 

多亏了 reddit 上的 nowonmai666,导致它在开始时缺少破折号。我希望这可以帮助某人。

【讨论】:

    【解决方案3】:

    您从 bitwiser 派生的原始代码已被修改。

    在 jekyll 中调用资产通常是这样的:

    <link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
    

    <script src="{{ site.baseurl }}/js/script.js"></script>
    

    在你的情况下:

    baseurl 设置为空 (baseurl :) 并适当地调用资产是可以的。

    【讨论】:

      【解决方案4】:

      baseurl 在某处损坏,需要有人解决。 '/' 指向卷的根,不正确。 './' 更正确。

      【讨论】:

      • 救命!谢谢!这个答案需要点赞!
      猜你喜欢
      • 2017-02-19
      • 2017-02-19
      • 1970-01-01
      • 2016-06-07
      • 2023-03-30
      • 1970-01-01
      • 2011-11-28
      • 2021-07-12
      • 2021-05-17
      相关资源
      最近更新 更多