Skip to content

Create a chapter_config for chapter specific properties to be exposed to the handlebars template. #1465

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

adam-kerrigan
Copy link

I wanted to expose my own properties to the handlebars.js template so added a config field to Chapter that is merged with the book ctx.data when rendered. As a use case I wrote a preprocessor that strips TOML front matter from a markdown file into this config so that meta tags can be populated and things like the date of creation for a file can be tracked. I think this should solve #277 and also achieve the same goal as #1381. I hope you like the idea/implementation and welcome any feedback.

@rustbot
Copy link
Collaborator

rustbot commented Apr 30, 2025

☔ The latest upstream changes (possibly #2681) made this pull request unmergeable. Please resolve the merge conflicts.

@rustbot rustbot added the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants