在jekyll中,默认的环境为开发环境,但是官方文档中对site.url这个变量的定义为: Contains the url of your site as it is configured in the _config.yml. For example, if you have url: http://mysite.com in your configuration file, then it will be accessible in Liquid as site.url. For the development environment there is an exception, if you are running jekyll serve in a development environment site.url will be set to the value of host, port, and SSL-related options. This defaults to url: http://localhost:4000。 即需要在生产环境中才可以将网站的url更改为_config.yaml中配置的url。此时需要在项目中配置一个yaml文件在其中写入以下内容: