|
1 | 1 | Customizing your BinderHub deployment
|
2 | 2 | =====================================
|
3 | 3 |
|
| 4 | +Frontend |
| 5 | +-------- |
| 6 | + |
| 7 | +Header and Footer customization |
| 8 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 9 | + |
| 10 | +BinderHub uses `Jinja <https://jinja.palletsprojects.com/en/stable/>`_ as template engine |
| 11 | +to process the page template `binderhub/templates/page.html <https://github.com/jupyterhub/binderhub/blob/main/binderhub/templates/page.html>`. |
| 12 | +To add a custom header and footer, |
| 13 | + |
| 14 | +1. copy ``binderhub/templates/page.html`` into ``files/custom-page.html`` |
| 15 | +2. edit ``files/custom-page.html`` to include the desired header and footer. |
| 16 | + For example:: |
| 17 | + |
| 18 | + <body> |
| 19 | + <header> |
| 20 | + My Own BinderHub |
| 21 | + </header> |
| 22 | + <div id="root"></div> |
| 23 | + <footer> |
| 24 | + Powered by BinderHub |
| 25 | + </footer> |
| 26 | + </body> |
| 27 | +3. add a `ConfigMap <https://kubernetes.io/docs/concepts/configuration/configmap/>`_ to your Helm configuration. |
| 28 | + For example:: |
| 29 | + |
| 30 | + kind: ConfigMap |
| 31 | + apiVersion: v1 |
| 32 | + metadata: |
| 33 | + name: binderhub-template-custom |
| 34 | + labels: |
| 35 | + app: binder |
| 36 | + component: etc-binderhub |
| 37 | + heritage: {{ .Release.Service }} |
| 38 | + release: {{ .Release.Name }} |
| 39 | + data: |
| 40 | + {{- (.Files.Glob "files/*").AsConfig | nindent 2 }} |
| 41 | + |
| 42 | +Banner customization |
| 43 | +~~~~~~~~~~~~~~~~~~~~ |
| 44 | + |
| 45 | +By default BinderHub shows a banner at the top of all pages. |
| 46 | +You can define the content of the banner by setting |
| 47 | +the ``c.BinderHub.banner_message`` configuration option |
| 48 | +to the raw HTML you would like to add. |
| 49 | + |
| 50 | +About page customization |
| 51 | +~~~~~~~~~~~~~~~~~~~~~~~~ |
| 52 | + |
| 53 | +BinderHub serves a simple about page at ``https://BINDERHOST/about``. |
| 54 | +By default this shows the version of BinderHub you are running. |
| 55 | +You can add additional HTML to the page by setting |
| 56 | +the ``c.BinderHub.about_message`` configuration option |
| 57 | +to the raw HTML you would like to add. |
| 58 | +You can use this to display contact information |
| 59 | +or other details about your deployment. |
| 60 | + |
4 | 61 | JupyterHub customization
|
5 | 62 | ------------------------
|
6 | 63 |
|
@@ -42,15 +99,6 @@ For example, ``BinderSpawner`` is defined under the ``00-binder`` key.
|
42 | 99 | Keys are evaluated in alphanumeric order, so later keys such as
|
43 | 100 | ``10-binder-customisations`` can use objects defined in earlier keys.
|
44 | 101 |
|
45 |
| -About page customization |
46 |
| ------------------------- |
47 |
| - |
48 |
| -BinderHub serves a simple about page at ``https://BINDERHOST/about``. By default |
49 |
| -this shows the version of BinderHub you are running. You can add additional |
50 |
| -HTML to the page by setting the ``c.BinderHub.about_message`` configuration |
51 |
| -option to the raw HTML you would like to add. You can use this to display |
52 |
| -contact information or other details about your deployment. |
53 |
| - |
54 | 102 | .. _repo-specific-config:
|
55 | 103 |
|
56 | 104 | Custom configuration for specific repositories
|
|
0 commit comments