Skip to content
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

trigger :polyglot :post_write hook #142

Closed
wants to merge 1 commit into from
Closed

Conversation

obfusk
Copy link
Contributor

@obfusk obfusk commented Jul 1, 2021

🔤 Polyglot PR

With parallel_localization, hooks like these:

Jekyll::Hooks.register :site, :post_write do |site|
  ...
end

run in all the child processes.

Currently, if you want a :post_write hook that only runs once, after all languages have been processed, you need to figure out which of the hooks is the last one to run (not that hard with a lock file, but not ideal).

This adds a custom :post_write hook that runs exactly once, after all languages been processed (whether or not parallel_localization is used):

Jekyll::Hooks.register :polyglot, :post_write do |site|
  ...
end

Type of change

  • Docs update (changes to the readme or a site page, no code changes)
  • Ops wrangling (automation or test improvements)
  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Sweet release (needs a lot of work and effort)
  • Something else (explain please)

Checklists

  • If modifying code, at least one test has been added to the suite

@untra
Copy link
Owner

untra commented Jul 13, 2021

yeah, so this will require a test, and documentation updates. but the value of this hook trigger really comes from having hooks defined to do interesting things that trigger from it.

I do see the value in having jekyll hooks that trigger on :polyglot, :post_write but this PR doesn't even define one. not ready yet.

@obfusk
Copy link
Contributor Author

obfusk commented Jul 22, 2021

yeah, so this will require a test,

I don't think it's really required, but certainly a good idea. I'll work on that when I have some more time :)

and documentation updates.

Agreed.

but the value of this hook trigger really comes from having hooks defined to do interesting things that trigger from it.
I do see the value in having jekyll hooks that trigger on :polyglot, :post_write but this PR doesn't even define one. not ready yet.

This confuses me though. The hook doesn't need to be "defined". It's already perfectly usable with this PR, as I've tested.

@untra
Copy link
Owner

untra commented Nov 19, 2021

@obfusk I'll write some words in the documentation for this, if you'd still like to see it get in.

@untra untra mentioned this pull request Mar 17, 2024
8 tasks
@untra untra closed this in #193 Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants