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

How to use Custom Banner Image instead of Github Banner #222

Open
pique-b opened this issue Aug 10, 2024 · 2 comments
Open

How to use Custom Banner Image instead of Github Banner #222

pique-b opened this issue Aug 10, 2024 · 2 comments

Comments

@pique-b
Copy link

pique-b commented Aug 10, 2024

In my Sphinx documentation I am using the Alabaster theme.

Now, for the purpose of adding my own banner image (ref document, I have added 'github_banner': True in html_theme_options in my conf.py.

Again, refering to the same section of the document (cited above), it says:

May also submit a string file path (as with logo, relative to $PROJECT/_static/) to be used as the banner image instead of the default.

which I am intending to do.

However, I am unable to find a way as to how may I submit a string path for the custom banner image.

To repeat, where exactly the custom banner image path needs to be added?

@AA-Turner
Copy link
Member

# conf.py
html_theme_options = {
    'github_banner': 'banner.png',
}

@pique-b
Copy link
Author

pique-b commented Aug 11, 2024

@AA-Turner - Thanks, that's working. So (I am dumb enough not to get it), instead of having:

# conf.py
html_theme_options = {
    'github_banner': True,
}

one should simply have:

'github_banner': 'github_banner.png', # True,

and that simply specifying the banner path tells the system that a banner is sought to be added.

For the likes of me out there, this work around (to get a custom banner) may be incorporated in the Alabaster docs.

If I may, could I extend your hospitality a little bit?

  1. How do I make the custom banner resized to cover the entire width? I have tried it with custom layout.html and it works. But, is there an option in Alabaster theme which provides for this?
  2. How do I put some text over the custom banner, say for example, the Project Name as has been done in case of Sphinx site (Sphinx):

sphinx_banner

  1. The top of the scroll bar in the sidebar housing ToC goes under the custom banner (image) like as shown in the image below. In the Sphinx.org page the top of the scroll bar is visible. What steps do I need to take to make the scroll bar completely visible?
  2. Finally, using the option 'show_relbars': True we can display the next and previous links which I have included in my conf.py. However, the links at the top of the page get hidden while using the custom banner image. Is there a way to pad the links so that they become visible?.

Here is the image displaying the items at s.no. 1 - 4:

how_tos_banner

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

No branches or pull requests

2 participants