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

Some suggestions #2

Open
dieghernan opened this issue Dec 20, 2022 · 2 comments
Open

Some suggestions #2

dieghernan opened this issue Dec 20, 2022 · 2 comments

Comments

@dieghernan
Copy link

Hi @roughike

As you already know, I implemented welcomments on https://dieghernan.github.io/chulapa/docs/02-config#xx-other-settings

I share here with you some thoughs:

On the bot

  • AFAIK there is no way to tell Welcomments that the site is being deployed from a folder. Say, Chulapa docs (Jekyll) are deployed from https://github.com/dieghernan/chulapa/tree/master/docs but the bot commited to ./_data instead to ./docs/_data. Then, on the site deployment the comments are gathered via your js plugin and not from the local storage on GitHub. So If a user with this setup opts out of the js plugin the comments are not shown, since Jekyll would look for data on docs/_data. My workaround was to move the content from _data to docs/data.

On the templates

  • At least on Jekyll, the current template does not make use of author website. I think this is easy to fix on the templates with something like
        <h3 class="welcomments__author-name" itemprop="author" itemscope itemtype="https://schema.org/Person">
        {% if author_website %}
          <span itemprop="name"><a href ="{{ author_website }}"> {{ author_name }}</a></span>
        {% else %}
       <span itemprop="name">{{ author_name }}</span>
        {% endif %}
        </h3>

A new css rule would be needed, something like

.welcomments__container .welcomments__author-name a:hover {
    text-decoration: underline;
    background: none;
}

On the css

I noticed that the custom css https://cdn.welcomments.io/welcomments.css interacts badly with Fontawesome, basically due to this kind of rules:

.welcomments__container * {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
    line-height: 1.5;
}
.welcomments__container * {
    font-family: inherit;
    line-height: inherit;
}
...

In my case I needed to ship a modified version of the welcomments removing the font-family rules.

Misc

On avatar image, welcomments seems to be ready to use custom images but it is not integrated (at least not in the customr form). My understanding is that providing a form for inputting an url to an avatar is easy. Would it be something that you may consider to expand?

Regards and thanks for this coooool plugin

@dieghernan
Copy link
Author

More on images:

If an user provides the email the app can try to get the avatar from Gravatar, using https://ui-avatars.com/ as fallback, see in the ui-avatar docs:

https://www.gravatar.com/avatar/EMAIL_MD5?s=64&d=https%3A%2F%2Fui-avatars.com%2Fapi%2F/Lasse+Rafn/64

On an existing user:


https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50?s=64&d=https%3A%2F%2Fui-avatars.com%2Fapi%2F/Lasse+Rafn/64

The MD5 hash of the email can be derived as explained https://es.gravatar.com/site/implement/hash/

My concern here is privacy, since MD5 is not fully secured (can be broken by brute force to get back the email). I would favored that or, at least, give the user the option to opt out

@dieghernan
Copy link
Author

Oh, I see on https://welcomments.io/blog/november-2021-update

I did consider Gravatar, but I’m not sure if it’s a good idea in 2022 to expose the md5 hashes of users’ email addresses to everyone visiting a given site.

I will have to look at the “proper” way to add avatars, maybe it’s Gravatar, maybe it’s something else.

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

1 participant