-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Silently setting site.baseurl breaks htmlproofer #87
Comments
If you set |
No. That makes things worse. With
without, I get:
whereas I didn't get errors before. I'm pretty sure the problem is in the code here: # Set `site.url` and `site.baseurl` if unset and in production mode.
if Jekyll.env == "production"
site.config["url"] ||= drop.url
site.config["baseurl"] = drop.baseurl if site.config["baseurl"].to_s.empty?
end If I'm reading this correctly, the intent is if the baseurl is unset, then it should be rewritten. In my case, baseurl is correctly set to the empty string and gets rewritten even though it's actually set. |
FYI, I was able to replicate the issue with an (almost) vanilla jekyll site using .bundle/config:
Gemfile: source 'https://rubygems.org'
# use Kernel.require as a workaround per https://github.com/bundler/bundler/issues/5346
Kernel.require 'json'
Kernel.require 'open-uri'
version = JSON.parse(open('https://pages.github.com/versions.json').read)
ruby version['ruby']
gem 'github-pages', version['github-pages'], group: :jekyll_plugins
gem 'html-proofer', group: :htmlproofer _config.yml: # Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.
# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: Your awesome title
email: your-email@domain.com
description: > # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
github_username: jekyll
# Build settings
markdown: kramdown
theme: minima
gems:
- jekyll-feed
exclude:
- Gemfile
- Gemfile.lock
- vendor ./script/cibuild:
./script/cibuild full output:
|
This issue has been automatically marked as stale because it has not been commented on for at least two months. The resources of the Jekyll team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial. This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions. |
Is there more information needed? I'm still seeing this behavior. |
jekyll/github-metadata#87 breaks baseurl when: - _config.yml defines baseurl as "" - Jekyll.env is set to "production" - The site is not generated by GitHub pages We are working around the issue by using the name "prod" for the environment rather than "production". Resolve #5
This issue has been automatically marked as stale because it has not been commented on for at least two months. The resources of the Jekyll team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial. This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions. |
PR #76 implemented code that silently sets
site.url
andsite.baseurl
if site.baseurl is "unset:" andJEKYLL_ENV="production"
:Per the Jekyll docs on continuous integration, I'm running htmlproof. I'd like to validate using
JEKYLL_ENV="production"
, using the following script:Since
site.baseurl
is set as""
in my_config.yml
, executing this script changes thesite.baseurl
to/pages/information-safety
which causes breakage in site generation and htmlproofer:I've been trying to find a workaround to disable the github-metadata gem but haven't found it. Building with
JEKYLL_ENV="production"
used to work for me before GitHub added github-metadata to the github-pages dependencies.The text was updated successfully, but these errors were encountered: