ppoffice / hexo-theme-icarus

A simple, delicate, and modern theme for the static site generator Hexo.
https://ppoffice.github.io/hexo-theme-icarus/
MIT License
6.35k stars 1.54k forks source link

ShareThis Button Display Problem and URL Update #1311

Open leimao opened 1 month ago

leimao commented 1 month ago

Describe the bug Occationally, the ShareThis buttons on my website do not display well. It might look like this. sharethis-1

However, after refreshing the web page, the buttons become normal. sharethis-2

I don't know what happened. So I looked into the source code a little bit.

It seems that hexo-inferno ShareThis requires this script.

      <>
        <div class="sharethis-inline-share-buttons"></div>
        <script src={installUrl} defer={true}></script>
      </>

However, from the ShareThis website, it seems that I no longer need this script.

image

Do you think hexo-inferno requires an update for ShareThis? (Although I am not sure if it can fix my button display problem)

System and Environment The version and configuration of Hexo and Icarus.

leimao commented 1 month ago

After looking at the ShareThis instruction again, I think this <script src={installUrl} defer={true}></script> is required. However, the ShareThis website recommended using <script src={installUrl} async></script>. Will this make a difference?

leimao commented 1 month ago

Also according to the ShareThis instruction, this script should go to the head before <div class="sharethis-inline-share-buttons"></div>.

ppoffice commented 1 month ago

When the widget didn't render correctly, does it stuck in that state or it eventually rendered correctly after waiting? The widget should display without issues no matter the <script> is marked async or defer.

leimao commented 1 month ago

@ppoffice It will not render correctly unless I refresh the web page in the browser. This happens from time to time on my Linux and MacOS OS (I mostly use Chrome), but not very often. I don't know if it's the service provider's issue or our implementation issue.

ppoffice commented 1 month ago

I cannot reproduce the issue with my ISP. Could you please change to another CDN provider and see if the issue resolve for you?

leimao commented 3 weeks ago

Screenshot from 2024-08-22 21-49-56

I just encountered this again. It happens once every few days. Because it's not always reproducible, switching CDN providers is not a good solution.