Add template_file config and document page customization#1923
Add template_file config and document page customization#1923rgaiacs wants to merge 7 commits intojupyterhub:mainfrom
Conversation
docs/source/customizing.rst
Outdated
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| BinderHub uses `Jinja <https://jinja.palletsprojects.com/en/stable/>`_ as template engine | ||
| to process the page template `binderhub/templates/page.html <https://github.com/jupyterhub/binderhub/blob/main/binderhub/templates/page.html>`. |
There was a problem hiding this comment.
There's something wrong with the link syntax- it's not linked:
https://binderhub--1923.org.readthedocs.build/en/1923/customizing.html#header-and-footer-customization
There was a problem hiding this comment.
I think it'd be helpful to also highlight the important parts of the template- is <div id="root"></div> the critical bit?
docs/source/customizing.rst
Outdated
| release: {{ .Release.Name }} | ||
| data: | ||
| {{- (.Files.Glob "files/*").AsConfig | nindent 2 }} | ||
|
|
There was a problem hiding this comment.
Is additional Helm configuration needed to mount the file in the ConfigMap into the BinderHub pod?
|
I will address the comments in a couple of weeks. |
151e661 to
dd7c67f
Compare
|
Sorry for the delay to return to this. I address the comments. Do I need to add some tests? If yes, can I have some help? Thanks! |
|
@rgaiacs thanks for this PR! How complicated would it be to customize components like For example, I can easily add header/footer but I cannot figure out a way to "replace" the binder logo with this design. Also, I think |
|
Hi @agahkarakuzu, the challenge to customise any file in We are using webpack to merge all JavaScript files into a single binderhub/binderhub/templates/page.html Line 27 in 837169d
If you want to change any of the JavaScript files, for example
|
|
Thanks @rgaiacs ! I actually created a new bundle.js. Would simply mounting the new distribution override the existing one? |
It should. |
|
It did! https://binder.evidencepub.io - name: custom-templates
mountPath: /usr/local/lib/python3.13/site-packages/binderhub/static/
subPath: staticThe Build sources are from https://github.com/evidencepub/binder-template/tree/preview. I'll add a github action to this repository to better streamline the builds. |
7ece9a3 to
2727bce
Compare
|
One of the tests are with I believe the failure not related with this pull request. @yuvipanda and @minrk this is blocking jupyterhub/mybinder.org-deploy#3186 and I would like to merge this earlier next week. |
|
Do we need the new Lines 791 to 798 in 43ecb3a |

Closes #1907
We might want to make add a new
traitletsfor users to provide their own Jinja template that will be used inbinderhub/binderhub/main.py
Line 42 in 4f0a91a
binderhub/binderhub/main.py
Lines 41 to 46 in 4f0a91a