我正在尝试使用由我的大学提供的域名,使用Jekyll建立个人主页。
我遇到的问题是,Jekyll强制我使用绝对路径,这与网页托管服务不兼容,我一直无法解决。
_config.yml文件确定了Jekyll在index.html文件中生成链接的方式,该文件是主页。_config.yml如下...
我遇到的问题是,Jekyll强制我使用绝对路径,这与网页托管服务不兼容,我一直无法解决。
_config.yml文件确定了Jekyll在index.html文件中生成链接的方式,该文件是主页。_config.yml如下...
title: Homepage | Ishank Juneja
email: ishankjuneja@gmail.com
description: >- # this means to ignore newlines until "baseurl:"
Personal homepage Beta version
baseurl: "foobar" # the subpath of your
site, e.g. /blog
url: "http://home.iitb.ac.in/~ishankjuneja" # the base hostname & protocol for your site, e.g.
http://example.com
twitter_username: ishankjuneja
github_username: ishank-juneja
# Build settings
markdown: kramdown
theme: minima
plugins:
- jekyll-feed
它生成的 index.html 文件中 (许多) 链接的一个示例是
<link rel="stylesheet" href="/foobar/assets/main.css">
这个链接告诉我,这实际上是一个绝对路径,这对我来说似乎不是问题,但Web托管服务上的目录树看起来像这样:
public_html
├── 404.html
├── about
│ └── index.html
├── assets
│ ├── main.css
│ └── minima-social-icons.svg
├── feed.xml
├── index.html
└── jekyll
└── update
└── 2018
└── 10
└── 04
└── test-post.html
我的主页网址 http://home.iitb.ac.in/~ishankjuneja/
与文件夹 public_html
相关联,所以以上的 main.css 路径是不正确的。类似于 href="assets/main.css"
这样的路径可以正常工作,但是我在 _config.yml
中似乎无法输入任何内容来得到这个结果。
.yml
是否有特定的原因(而不是根据yaml.org网站应该使用的.yaml
扩展名)? - Anthon