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

This adds the mastodon fediverse icon as own option. #646

Merged
merged 2 commits into from May 11, 2022

Conversation

albig
Copy link
Contributor

@albig albig commented Apr 26, 2022

This adds the mastodon icon as own option mastodon_url as Mastodon seems to get more popular now.

Of course, this could be done already right now with

html_theme_options = {
  "icon_links": [
    {
        "name": "Mastodon",
        "url": "https://gruene.social/@albigdd",
        "icon": "fab fa-mastodon",
    },
  ],
}

@choldgraf
Copy link
Collaborator

Hmmm - I think we are actually moving away from these shortcuts so that we don't have a bunch of special-cases in there. Maybe instead you could just provide an example of how to add a mastadon button in the docs?

@albig
Copy link
Contributor Author

albig commented Apr 27, 2022

Ah, ok. Thank you.

Then I'll change my PR later to just add some information to the documentation.

Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

This LGTM if you're ready to go!

@albig
Copy link
Contributor Author

albig commented Apr 28, 2022

From my part, it would be ready.

I thought about to add a possibility to add a rel="me" or extend the current rel attribute to rel="noopener me", but not absolutely sure about. Mastodon suggests to do this.

What do you think? Would it be worth doing this in another PR?

@choldgraf
Copy link
Collaborator

That is pretty cool - I hadn't heart about that before. Hmm, maybe the way to do this would be to support other key: val pairs in the icon links config, that would be added to the "a" anchor, and this could be used to add stuff like rel=me?

@albig
Copy link
Contributor Author

albig commented Apr 29, 2022

I think, this would be the proper way to go. A configuration like this would be great:

html_theme_options = {
  "icon_links": [
    {
        "name": "Mastodon",
        "url": "https://gruene.social/@albigdd",
        "icon": "fab fa-mastodon",
        "rel": "noopener me",
    },
  ],
}

If no "rel" is set, the default rel="noopener" should be set.

@choldgraf
Copy link
Collaborator

I think that'd be fine as long as we don't imagine any other kinds of config being added to the "a" element. But if we do think other config would be added, we should just add a general extension mechanism for key: value pairs so that we don't grow the config surface area too much

@albig
Copy link
Contributor Author

albig commented May 3, 2022

What do you think about something like additionalAttributes like TYPO3 Fluid template engine is using.

The idea is to add additional attributes which have no own config field.

E.g.

html_theme_options = {
  "icon_links": [
    {
        "name": "Mastodon",
        "url": "https://gruene.social/@albigdd",
        "icon": "fab fa-mastodon",
        "additionalattributes": [
             "rel": "noopener me",
             "target": "_blank"
        ]
     },
  ],
}

@choldgraf
Copy link
Collaborator

That sounds great to me 👍

@choldgraf
Copy link
Collaborator

I'll merge this one in as-is, and we can tackle custom attributes etc in a follow-up if you wish!

@choldgraf choldgraf merged commit 761bec8 into pydata:master May 11, 2022
@jarrodmillman jarrodmillman added this to the 0.9 milestone May 25, 2022
@albig albig deleted the add-mastodon-icon-link branch May 27, 2022 21:51
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