Skip to content
This repository was archived by the owner on Aug 27, 2018. It is now read-only.

Try to use favicon for no-blavatar sites.#247

Open
kwight wants to merge 1 commit intomasterfrom
add/blavatar-favicon-fallback
Open

Try to use favicon for no-blavatar sites.#247
kwight wants to merge 1 commit intomasterfrom
add/blavatar-favicon-fallback

Conversation

@kwight
Copy link
Contributor

@kwight kwight commented Apr 4, 2018

Copied over from notifications-client pull #449

Resolves #357 - we want to be able to use the favicon for a site if they don't have a blavatar.

What happens before this PR:

In the notification builder, we attempt to retrieve the blavatar_url(), if it's blank, we set the image for these pingback header blocks to a default blavatar url (mystery man).

What we want:

We would like to load the favicon.ico (if they have one).

What happens after this PR:

In building this user block, we check the image url, if it's the same as the default blavatar url, we switch it for the favicon.ico url. We add an error handler in case the site does not have a favicon. If there's an error loading, then we swap the image for the original default blavatar (mystery man image).

Now then:

If the site has a blavatar => use the blavatar like before
If the site has no blavatar and a favicon.ico => uses the favicon.ico (for wordpress.com sites, this means the default image becomes the W logo instead of the mystery man)
If the site has no blavatar and no favicon.ico => falls back to the default blavatar (mystery man)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants