Joshua
Joshua

Reputation: 6241

Jekyll serve generate wrong path in localhost

I believe this is caued by gem "github-pages". When I run bundle exec jekyll serve, all the links is generated with a prefix of /pages/<user_name> or /pages/<user_name>/<repo_name> depends on repository in _config.yml.

For example, /js/jquery.js becomes /pages/<user_name>/js/jquery.js. This make all the JavaScript, CSS, and page broken.

However, it generates fine if it is built by GitHub. Also, if I remove repository in _config.yml cause the following error.

GitHub Metadata: Error processing value 'baseurl':

Liquid Exception: No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository. in /_layouts/layout.html

ERROR: YOUR SITE COULD NOT BE BUILT:


No repo name found. Specify using PAGES_REPO_NWO environment variables, 'repository' in your configuration, or set up an 'origin' git remote pointing to your github.com repository.

Upvotes: 1

Views: 368

Answers (1)

Joshua
Joshua

Reputation: 6241

Setting JEKYLL_ENV to development solved the problem.

On Windows, you can run the following:

set JEKYLL_ENV=development

Upvotes: 2

Related Questions