hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.28k stars 4.83k forks source link

Gravatat Helper related #3584

Closed SukkaW closed 5 years ago

SukkaW commented 5 years ago

For question

From pull #1561 Hexo gravatar helper start to using https instead of http://.

Using HTTPS is definitely much safer, but it is certain that there are still some blog using HTTP. In this case using '//' might be more suitable.

Besides that, the documents related to gravatar helper is outdated (and still showing http://www.gravatar.com).

I can open new pr if hexo team thinks it is necessary.

tcrowe commented 5 years ago

Hello @SukkaW 👋

Do you know how this is usually used?

Like so? <img src="<%- gravatar("someone@nowhere.dev") %>">

If it is used like that we do not actually need to specify the protocol. https:// can become just //.


For reference:

https://github.com/hexojs/hexo/blob/master/lib/plugins/helper/gravatar.js#L15

SukkaW commented 5 years ago

From the docs and the code I believe <img src="<%- gravatar("someone@nowhere.dev") %>"> is the use case. The // is better not just because it is shorter, as for people who still stick to ****y HTTP, just a simple gravatar loading using HTTPS is not helpful to the safety and security. The // would cause issue only if the page is under file://.

And whatever, at least the document of gravatar helper need updated. I have already forked the site repo and ready for the PR.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.