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

ENH: Add ability to specify custom icon images #542

Merged
merged 2 commits into from Jan 10, 2022

Conversation

choldgraf
Copy link
Collaborator

@choldgraf choldgraf commented Jan 8, 2022

Description

This adds the ability for people to specify local images for their icon links, instead of only allowing fontawesome icons. Here are the major changes:

  • Adds a type field for icon link config. The allowed values are type: "fontawesome" and type: "local". fontawesome is the default, so if people don't specify type, it'll default to the current behavior.
  • Adds type: "local" and then supports icon: path/to/img.png, which will resolve to an img element instead of a span.
  • Adds a helper if an incorrect type is added to tell people it's configured wrong.
  • Adds some testing for icon links because we weren't testing it before.
  • Adds a demo of this to our documentation with the pandas logo

Here's how it looks in our demo docs:

image

Rationale

My rationale for adding this is that projects may want to link out to a "parent site" with this theme. For example, the JupyterHub docs might want to link up to jupyter.org. In that case, we could use an icon link with the Jupyter logo, rather than using extra screen real estate by putting jupyter.org in the navbar links.

@choldgraf choldgraf force-pushed the ENH-custom-icons branch 2 times, most recently from cd05d6c to 169c417 Compare January 8, 2022 00:50
Co-authored-by: Damian Avila <damianavila82@yahoo.com.ar>
Copy link
Collaborator

@damianavila damianavila left a comment

Choose a reason for hiding this comment

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

Left some comment/suggestions that you already incorporated, so LGTM!

@choldgraf choldgraf changed the title Add ability to specify custom icon images END: Add ability to specify custom icon images Jan 10, 2022
@choldgraf choldgraf merged commit d1adbf8 into pydata:master Jan 10, 2022
@choldgraf choldgraf deleted the ENH-custom-icons branch January 10, 2022 21:01
@choldgraf
Copy link
Collaborator Author

great! thanks :-)

@jorisvandenbossche
Copy link
Member

Nice feature, thanks!

@jorisvandenbossche jorisvandenbossche changed the title END: Add ability to specify custom icon images ENH: Add ability to specify custom icon images Jan 10, 2022
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.

None yet

3 participants