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

Main page footer can be overridden #1471

Closed
wants to merge 2 commits into from

Conversation

manics
Copy link
Member

@manics manics commented Apr 23, 2022

This allows the footer on the main (index) page to be replaced with custom HTML.

Related to jupyterhub/mybinder.org-deploy#2156

Current default:
image

With c.BinderHub.main_footer_message = '<div class="row text-center" style="transform:rotate(10deg);padding-top:3em;"><h3>This is a custom footer message.</h3></div>':
image

I decided to override the main page footer instead of prefixing/suffixing it to give us more flexibility in layout.

This allows the footer on the main (index) page to be replaced with custom HTML.

Related to jupyterhub/mybinder.org-deploy#2156
@choldgraf
Copy link
Member

Nice start! I think this would be enough to make good progress here. The other thing we might want is a button in the top right or something, but we could always absolutely position an element in the footer 🤷

The other page I had in mind was the loading screen, since that is a very common one for people to see 🙂

… footer

If `about_summary_message` is set it is used when rendering `index.html` and `loading.html`
@manics
Copy link
Member Author

manics commented Apr 24, 2022

I've updated it so instead of replacing the footer it's now a new section above the footer.... it should appear on the index and loading pages

image

Adding a button at the top should already by doable:
https://github.com/jupyterhub/mybinder.org-deploy/blob/945d2accd7e400a0230ecd6be9e549d9281a762d/mybinder/values.yaml#L128-L129

@betatim
Copy link
Member

betatim commented Apr 25, 2022

I like it. My only nitpick is that "summary message" as config option name had me thinking "a summary as well, i thought we are doing the footer in this PR" -> why call it summary message? Somehow I was primed to expect it to be called a footer. What was your thinking around calling it summary instead?

@minrk
Copy link
Member

minrk commented Apr 25, 2022

We have established a pattern for ourselves of using extra_. Maybe extra_footer and put it inside the footer block (but not inside the footer container?)?

@manics
Copy link
Member Author

manics commented Apr 25, 2022

Originally this was just to customise the footer on the main page (hence the now misleading PR title), but after feedback I attempted to give the property some sort of semantic meaning, since it appears in the main and loading pages, but not the others.

I could rename it to something like extra_footer, but since it's only for some pages I'm worried about creating an impenetrable mess of HTML configuration options where the only option is to grep the templates. Maybe that's the best option though?

@minrk
Copy link
Member

minrk commented Apr 25, 2022

None of these placeholder strings-as-config are necessary if using a custom template is practical, because all we need is:

{% block footer %}
custom stuff
{{ super() }}
{% endblock %}

and the only impediment to that is getting the template to the container via helm. Maybe that's what we should do?

I'm okay with this as-is as a short-term fix, though, since we are under some time pressure.

@minrk
Copy link
Member

minrk commented Apr 25, 2022

#1472 supports arbitrary custom templates

@manics
Copy link
Member Author

manics commented Apr 25, 2022

I like #1472

@manics manics closed this Apr 25, 2022
@manics manics deleted the custom-main-footer branch July 30, 2022 16:00
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.

4 participants