daattali / beautiful-jekyll

✨ Build a beautiful and simple website in literally minutes. Demo at https://beautifuljekyll.com
https://beautifuljekyll.com
MIT License
5.32k stars 16.06k forks source link

AddToThis replcaing the share buttons #1296

Closed daattali closed 1 week ago

daattali commented 6 months ago

Discussed in https://github.com/daattali/beautiful-jekyll/discussions/1283

Originally posted by **monksy** January 30, 2024 I was asking for enhancements for the share buttons, but this might look like a better way to handle that situation: https://www.addtoany.com/ Thoughts?
daattali commented 6 months ago

@monksy transferring this to be an issue

daattali commented 6 months ago

It's a good idea, and I do like their lightweight design. I wish I knew about them 8 years ago. I'm not sure how to handle this change in the config, this should not warrant a breaking change, but it doesn't really work well with the current config parameteres. Adding a brand new feature is easy becaue a new config parameter gets added and for old websites we can use a default value, but changing the way an existing feature works is very tricky. Let me know if you have a good solution for this.

ccorsi commented 3 weeks ago

It's a good idea, and I do like their lightweight design. I wish I knew about them 8 years ago. I'm not sure how to handle this change in the config, this should not warrant a breaking change, but it doesn't really work well with the current config parameteres. Adding a brand new feature is easy becaue a new config parameter gets added and for old websites we can use a default value, but changing the way an existing feature works is very tricky. Let me know if you have a good solution for this.

@daattali It seems that you already have a similar solution with respect to your use of the external url and css files. You check if the given attribute is a simple entry or an object. You could extend this feature using the same technique. For example let's use the email link thus you can go from:

social-network-links: email: name@host.com

to

social-network-links: email: name: name@host.com img: [uri]

such that your check will be able to determine if the email field is the first case or the second case like you do with you ext-js.html include file.

The other suggestion is that you can create a general include file that will be able to generate the li entry. Looking at the social-network-links.html include file. It is clear that you have several fields that you can define like:

The above will make it easier to add and update the format for the generated li entry.

daattali commented 1 week ago

Thanks for your input @ccorsi. While the AddToThis library is nice, I've come to the conclusion by now that it's not actually very necessary. It gets difficult to strike the balance between being feature-rich and being simple, and I'd prefer to keep this more on the simple side and keep the config as-is.