Skip to content

Conversation

@artoftheblue
Copy link
Contributor

@artoftheblue artoftheblue commented Jun 16, 2025

Originally was supposed to implement functionality discussed in

However, the PR was expanded to allow the user to define a custom footer in the primary sidebar to replace the default Made with MyST footer.

The config is similar to how the site-wide footer is currently added:

site:
  parts:
    footer: footer.md                              # side-wide
    sidebar_footer: sidebar_footer.md              # new addition

For example, creating the file named sidebar_footer.md with the following contents

:::{warning} Warning!
This site is currently WIP.
:::

renders as

image

@changeset-bot
Copy link

changeset-bot bot commented Jun 16, 2025

🦋 Changeset detected

Latest commit: 804f922

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
@myst-theme/site Patch
@myst-theme/book Patch
@myst-theme/providers Patch
@myst-theme/frontmatter Patch
@myst-theme/diagrams Patch
@myst-theme/jupyter Patch
@myst-theme/styles Patch
@myst-theme/common Patch
@myst-theme/icons Patch
@myst-theme/search Patch
@myst-theme/search-minisearch Patch
@myst-theme/landing-pages Patch
@myst-theme/article Patch
myst-to-react Patch
myst-demo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@choldgraf
Copy link
Contributor

I definitely agree we need to let users disable this if they wish. I have one suggestion but it would require a bit of extra work so it's not a huge deal if you dont have the bandwidth for it now:

Rather than making this a feature flag, could we make it an option to modify the content in the sidebar footer?

For example rather than hide_myst_branfing call this primary_sidebar_footer. It could accept any myst markdown and parse it before inserting it. It would default to the branding language+image listed now, and if it were none or false etc, it would simply be removed.

@artoftheblue
Copy link
Contributor Author

artoftheblue commented Jun 16, 2025

@choldgraf that's a neat rendition of this issue! I'll expand this PR to feature your suggestion too.

@artoftheblue artoftheblue changed the title 🪵 Add a site.option.hide_myst_branding option 👣 Add a site.option.primary_sidebar_footer option Jun 16, 2025
@artoftheblue
Copy link
Contributor Author

@choldgraf this works on my end — I've added a sidebar_footer option to site.parts.sidebar_footer instead

@choldgraf
Copy link
Contributor

Ah interesting - so you can define the sidebar footer in a separate part rather than in the config directly? Could you give demo config or a link to an example that I could use to try out?

@artoftheblue artoftheblue changed the title 👣 Add a site.option.primary_sidebar_footer option 👣 Add a site.parts.sidebar_footer option Jun 17, 2025
@artoftheblue
Copy link
Contributor Author

artoftheblue commented Jun 17, 2025

@choldgraf updated the PR description to include an example!

Overall, this feels like a better approach than writing a footer in MyST Markdown in the config.

@agoose77
Copy link
Collaborator

agoose77 commented Jun 20, 2025

Thanks for authoring this PR @artoftheblue!

I saw your request for review on Discord. I need to commit more time than I have today to review this PR, because there are a few things we need to think about such as context-providers. I'm away next week, so hopefully someone else can pick up the reviewing role before then!

@artoftheblue
Copy link
Contributor Author

@agoose77 sure! Thanks for the heads-up.

@choldgraf
Copy link
Contributor

Just noting that a similar thing was added here for the site-wide footer:

My assumption would be that this can follow a similar pattern. Perhaps @stefanv could provide guidance about how that was implemented and how this is similar or different?

@stefanv
Copy link
Collaborator

stefanv commented Jun 20, 2025

My assumption would be that this can follow a similar pattern.

Yes, I think this PR already uses part in the same way, so 👍

It could be useful to wrap in a special element or a div, so it can be styled in CSS. See https://github.com/jupyter-book/myst-theme/blob/main/themes/book/app/components/Footer.tsx#L8.

@stefanv
Copy link
Collaborator

stefanv commented Jun 20, 2025

Would be good to also add some documentation for this feature.

@agoose77
Copy link
Collaborator

@choldgraf see also!

@netlify
Copy link

netlify bot commented Nov 12, 2025

Deploy Preview for myst-theme ready!

Name Link
🔨 Latest commit 804f922
🔍 Latest deploy log https://app.netlify.com/projects/myst-theme/deploys/6914eb591c093500090a459a
😎 Deploy Preview https://deploy-preview-613--myst-theme.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@choldgraf
Copy link
Contributor

choldgraf commented Nov 12, 2025

I've updated this PR a little bit to reflect some recent work I did in this direction:

  • Updated to main
  • Renamed it to primary_sidebar_footer in case we want to support this on the other (secondary) sidebar
  • Added an example, so we can preview here what it looks like

Here's what the Netlify preview looks like (see bottom left)

CleanShot 2025-11-12 at 09 47 32@2x

@choldgraf choldgraf changed the title 👣 Add a site.parts.sidebar_footer option 👣 Add custom primary sidebar footer Nov 12, 2025
@choldgraf choldgraf changed the title 👣 Add custom primary sidebar footer 👣 Allow custom primary sidebar footer Nov 12, 2025
}

return (
<div className="text-sm text-slate-900 dark:text-white [&>*]:m-0 [&_a]:underline [&_a]:font-semibold">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to add a myst- class here to enable styling.
Link this to #667 so that we can follow up there.

@agoose77
Copy link
Collaborator

I'm not totally sure yet on whether we should add special styling to sidebars, etc. I don't think we do for footer, on the basis it can have wierd consequences for complex markup trees.

@stefanv
Copy link
Collaborator

stefanv commented Nov 12, 2025

@agoose77 So, what would you like to see changed here before merge?

@agoose77
Copy link
Collaborator

I'm I terested in what others think. We can probably ship something and refine it down the road if needs be.

@choldgraf
Copy link
Contributor

choldgraf commented Nov 12, 2025

My feeling is that this is a simple change that unblocks users who don't want the made with myst logo forced on them, or who otherwise want a custom sidebar footer. I'm not sure what you mean by "special styling", but I am fine adding any language to these docs to clarify that anything "special" is not supported, even going so far as to say only common mark is supported.

It is easy to add more functionality in the future if need be, and I think we can bias towards incremental progress by merging this so long as there isn't a major strategic risk here.

My criteria for major strategic risks would be:

  • we are taking an action we cannot undo or fix and that may do extreme harm to our users or maintainers
  • OR, we could technically fix something but it will be a huge lift and we may not have the capacity to fix it

My suggestion here (and in every other PR) is that if concerns don't rise to this level, we should just merge things and move forward. For an under-resourced project like ours, slowing down too much is a bigger risk than moving too quickly.

sidebarRef={toc}
hide_toc={hide_toc}
footer={<MadeWithMyst />}
footer={<SidebarFooter content={projectParts?.primary_sidebar_footer?.mdast} />}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a follow-up, we may want to rename footer here to something more descriptive, since this does not refer to the main page footer.

Maybe sidebarFooter.

Copy link
Contributor

@choldgraf choldgraf Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, ideally this would be primarySidebarFooter and it could live alongside secondarySidebarFooter one day. Or, call it something more generic like primarySidebarEnd to recognize that other things than footers might be placed there one day.

I think my suggestion would be we just try to re-use the JB1 structure naming as much as possible for the book theme, since it has been used and battle-tested for a long time now:

https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html

@stefanv stefanv merged commit b5a3495 into jupyter-book:main Nov 12, 2025
3 checks passed
@choldgraf choldgraf added the enhancement New feature or request label Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make Made with MyST plaque below the TOC toggleable

4 participants