Pelican-Elegant / elegant

Best theme for Pelican Static Blog Generator
https://elegant.oncrashreboot.com/
MIT License
293 stars 187 forks source link

Add Flattr support #104

Closed silverhook closed 5 years ago

silverhook commented 10 years ago

Flattr is a pretty cool system for awarding creations (e.g. blog posts) with micropayments.

It'd be great to have.

This can be done by simply adding some snippet to the theme, but would it make more sense to write it as a separate plugin and connect it into the theme in an if statement?

tshepang commented 10 years ago

Making it a plugin sounds like a better idea, though maybe it would be too short to justify making it so (is there a limit?).

talha131 commented 10 years ago

Flattr snippet should be added as a plugin to Pelican. Once it is accepted there, Elegant can use it.

silverhook commented 10 years ago

OK, I’ve post the plugin proposal there and will see if it magically pops up, before I find the time and courage to do it myself ;)

silverhook commented 10 years ago

According to https://github.com/getpelican/pelican-plugins/issues/128#issuecomment-34437978 it should be just done in the theme and not as a plugin.

/me shrugs

talha131 commented 10 years ago

@silverhook that may be so. Unfortunately I am unable to look into it myself.

In any case, this item is labelled as "pull request welcomed", so please feel free to submit a patch for it.

silverhook commented 10 years ago

Might do when I find the time. Thanks :)

Schnouki commented 10 years ago

FYI I added the Flattr button in my fork: https://github.com/Schnouki/pelican-elegant/commit/225d7a1fd86e9f9adde2b48882f6a0365f259756 Works for me; will clean it up and open a pull request later.

silverhook commented 10 years ago

@Schnouki beat me to it and I like his solution quite a bit.

silverhook commented 10 years ago

@Schnouki Great stuff!

If your plugin were able to show the button also in the Atom feed, it’d be perfect! :smile_cat:

Schnouki commented 10 years ago

@silverhook Do you mean as a <link rel="payment" href="..."/> (documented here), or the "full" Flattr button? Because the latter needs JS, and I'm not sure if it's a good idea to add JS in an Atom feed...

silverhook commented 10 years ago

@Schnouki To be honest, initally I was thinking about the “full” button, but wasn’t aware of the solution that you mention. And now that I read about it I agree that <link rel="payment …> is a nicer match for Pelican.

Schnouki commented 10 years ago

@silverhook I had a look at it, but the RSS and Atom feeds are generated by Pelican itself (and not by a theme). So to add this you would need either to hack Pelican, or to create a plugin. But right now I'm a little too lazy busy (and not interested enough) to do that :)

silverhook commented 10 years ago

I thought that this would have to be a plugin :stuck_out_tongue_closed_eyes:

I’m very busy until end of this year, but if you don’t find the time, I might take a stab at it and hope you’ll be able to help fix my crap later on :wink:

silverhook commented 10 years ago

@Schnouki I just tested your per on my website and even if I add the templates/flattr_button.html file that’s not mentioned in your pull request, but present on your website, I can’t seem to make it work.

Another thing I struggled with, was figuring out that FLATTR_USER needs to be set in publishconf.py – is there a good reason it’s there and not in pelicanconf.py (I’m assuming there is)?

I withdraw this suggestion: In addition, here’s an odd idea: would it make sense to move the flattr button into the SOCIAL area in the theme or not really?

Schnouki commented 10 years ago

@silverhook Hmmm, I believe that in my repo templates/flattr_button.html is used for another theme (the one I used before Elegant). So it shouldn't be necessary :)

I added FLATTR_USER to publishconf.py instead of pelicanconf.py because if I added it to pelicanconf.py and browsed the dev site, Flattr "things" would be created for my articles with the http://localhost/... URL. And I don't want that to happen :)

What problem do you have exactly?

silverhook commented 10 years ago

@Schnouki Very simply put: I’ve done all that I’ve mentioned, cleanly rebuild the HTML, but the Flattr button just doesn’t show up …no trace of it even in the HTML.

Schnouki commented 10 years ago

@silverhook Weird... Did you set FLATTR_USER in publishconf.py or pelicanconf.py, and did you build the HTML with make html or make publish? (Or their fabric equivalents). Also, which version of Pelican are you using?

silverhook commented 10 years ago

I'm using pelican 3.4 and run it with

make html

I did try first with having FLATTR_USER set in pelicanconf.pt and it didn't work, and then I noticed you use it in pelicanpublish.py, so I tried to move it there, but it also didn't work.

It could be that in between the two trials I downloaded another file from you ...not sure.

silverhook commented 10 years ago

Obviously pelicanconf.py and publishconf.py ...sorry, using the mobile app to reply ATM.

silverhook commented 10 years ago

I moved it back to pelicanconf.py and now it works. Yay! :D

I guess I forgot to change one of the files before, upsies...

I also confirm that it was not that button file - I removed it and it still works.

Thanks again, it looks lovely :)

P.s. I hate typing on the screen ...sorry for all the weirdness that this causes.

Schnouki commented 10 years ago

Glad it works :)

silverhook commented 9 years ago

Can we finally merge that? That’d be so super :3

silverhook commented 5 years ago

Flattr 2.0 does not work this way any more. Closing.

Dear @Schnouki, thanks again for implementing this. I’m truly sorry it wasn’t merged in time.

silverhook commented 5 years ago

I did some small research and found out that some other Pelican theme already implemented Flattr 2.0 support. It’s super-easy.

All we would need to is to add a <meta> tag (in an if statement) – see e.g. https://github.com/Kdecherf/Nicholas/commit/3d3c6c9698cf76494f801d378d8f1e107452e574

Reopening as this is an easy thing to work on.

silverhook commented 5 years ago

Personally, I lost interest in Flattr. Since I seem to be the only one who was interested in it for at 4 years, I will close this issue.

If anyone else finds interest in it, feel free to (ask me to) re-open it or create a new issue.

iranzo commented 5 years ago

TBH, I haven't seen this issue as interesting as didn't knew about Flattr, seems that as it's easy to do as per previous comments could be good.

I did heard in the past about other things like patron or even the 'ransom' style webs for github issues like https://www.bountysource.com/ but never tried tbh.

silverhook commented 5 years ago

@iranzo, if it scratches your interest, happy to reopen it. It should be rather easy to implement.

iranzo commented 5 years ago

https://techcrunch.com/2019/05/23/github-launches-sponsors-lets-you-pay-your-favorite-open-source-contributors/

Another one has come :-)

silverhook commented 5 years ago

@iranzo, I haven’t checked the GitHub one yet, but suspect it is limited to things on GitHub. Questionable if it’s only about code.

If there’s interest, I can check it.