Skip to content

trigger :polyglot :post_write hook - #142

Closed
obfusk wants to merge 1 commit into
untra:masterfrom
obfusk:hook
Closed

obfusk wants to merge 1 commit into
untra:masterfrom
obfusk:hook

Conversation

@obfusk

@obfusk obfusk commented Jul 1, 2021

Copy link
Copy Markdown
Contributor

🔤 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

@obfusk obfusk mentioned this pull request Jul 1, 2021
2 tasks done
@untra

untra commented Jul 13, 2021

Copy link
Copy Markdown
Owner

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

obfusk commented Jul 22, 2021

Copy link
Copy Markdown
Contributor Author

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

untra commented Nov 19, 2021

Copy link
Copy Markdown
Owner

@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
4 of 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