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

Add a before hook #42

Closed
wants to merge 2 commits into from
Closed

Add a before hook #42

wants to merge 2 commits into from

Conversation

tao
Copy link
Contributor

@tao tao commented Dec 25, 2020

I'm working on a Static Pagination solution, but it requires generating many new urls for each page. I need to create these dynamically based on the number of entries, pagination size, etc.

To generate the URLs I need to use some facades like Entry and Term, however you can't use these directly in the config files. This pull request allows you to hook into the generator before the config files are loaded, which allows you to modify the config and dynamically add new urls.

Hopefully it will also be useful for other purposes.

@tao
Copy link
Contributor Author

tao commented Dec 30, 2020

Should be able to close issue #19 with this too.

@tao tao mentioned this pull request Jan 24, 2021
@jasonvarga jasonvarga mentioned this pull request Apr 22, 2021
@jasonvarga
Copy link
Member

Thanks for the PR but I wasn't a fan of introducing a generic callback which is probably always going to be used to add urls. I just made a method to explicitly add the urls in #49

@brighttank
Copy link

A before hook would be useful to set env variables, clear caches, generate responsive images, etc.

@tao tao deleted the ssg-before-hook branch August 30, 2021 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants