-
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
Spike out setting site.url and site.baseurl #76
Conversation
@parkr I believe you have a similar implementation... if you want to take this over, or close in favor of yours, please feel free to do so if you think you can get it across the 🏁 . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this a lot. Happy to take over fixing the tests if you need.
def generate(site) | ||
Jekyll::GitHubMetadata.log :debug, "Initializing..." | ||
@site = site | ||
site.config["github"] = github_namespace | ||
site.config["url"] = drop.url if site.config["url"].nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be site.config["url"] ||= drop.url
and same for baseurl
. Would save you an explicit if
😄
before { stub_api("/repos/jekyll/jekyll.github.io" , "repo") } | ||
before { stub_api("/repos/jekyll/jekyll.github.io/pages" , "repo_pages") } | ||
before { stub_api("/repos/jekyll/jekyll.github.com" , "repo") } | ||
before { stub_api("/repos/jekyll/jekyll.github.com/pages" , "repo_pages") } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put all of these into one before(:each)
block. Should be a bit faster. Same with the env vars below.
@parkr made the |
@benbalter Got them working on my machine. Does this LGTY? |
@benbalter Because you made the PR you can't approve or request changes, but feel free to comment and I'll check back for your final 👍 . |
@parkr Nice work. Thanks for the help with the tests. Really like your implementation (which is where I was getting stuck). Think this is going to be a big improvement. ✨ |
* master: Update history to reflect release of 2.1.0 Bump to 2.1.0 format history Update history to reflect merge of #76 Only set `site.url` and `site.baseurl` if in JEKYLL_ENV=production Fix 2 incorrect tests Fix repository spec per removed ApiStub class Unify the way we stub all API requests use ||= spike out setting site.url and site.baseurl
This allows
relative_url
andabsolute_url
to "just work" in most cases, by silently settingsite.url
andsite.baseurl
if either are not already set by the user.This is a quick spike, and could use: