Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@parkr
Copy link
Member

@parkr parkr commented Mar 22, 2017

Should fix #93 (comment)


def generate(site)
if defined?(@_already_generated)
Jekyll::GitHubMetadata.log :debug, "Nothing left to do!"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already are exposing users to unnecessary friction with unclear output, I'd suggest making it clear what's going on here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed – I'm just going to nix it.

attr_reader :site

def generate(site)
if defined?(@_already_generated)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we hook into after_init instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after_init was introduced only a few versions ago so this would stop working for older versions. Probably fine, but just calling that out.

In the GitHub Pages gem, we call the configuration reset in after_reset, which is called towards the top. Does that seem OK?

@benbalter
Copy link
Contributor

Is it possible to tests this?

@parkr parkr force-pushed the dont-double-process branch from 14f143c to ba830fd Compare March 24, 2017 02:24
@parkr
Copy link
Member Author

parkr commented Mar 24, 2017

@benbalter Can you please take another look?

Is it possible to tests this?

Uhhhh I guess call it twice for the same site and make sure it doesn't call anything?

end

Jekyll::Hooks.register :site, :after_reset do |site|
Jekyll::GitHubMetadata::SiteGitHubMunger.munge(site)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would after_init save us from having to check if we've already processes it (since it only fires once)?

@parkr
Copy link
Member Author

parkr commented Mar 30, 2017

Using :after_init now – don't need that test anymore. Thoughts?

Copy link
Contributor

@benbalter benbalter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@parkr
Copy link
Member Author

parkr commented Mar 31, 2017

@jekyllbot: merge

@jekyllbot jekyllbot merged commit 54942a4 into master Mar 31, 2017
@jekyllbot jekyllbot deleted the dont-double-process branch March 31, 2017 01:29
jekyllbot added a commit that referenced this pull request Mar 31, 2017
@jekyll jekyll locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to disable GitHub metadata when running locally

3 participants