lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
198 stars 98 forks source link

Feature request: "Subcribe to newsletters" page #138

Closed n0rdy closed 10 months ago

n0rdy commented 11 months ago

Hello there!

First of all, thanks a lot for the great Hugo theme: I like its minimalistic design and privacy-oriented approach (Plausible instead of Google Analytics, Reamrk42 out of the box, etc.). Also, kudos for GPL-3.0, even though it made me double-check what I should do in order to use Poison =)

There is one feature that. imho, Poison can benefit from: having the possibility to add a Subscribe to newsletters page (next to the About, Posts) or a partial to the end of each blog post. I was considering adding it to my blog by forking the Poison and hardcoding the page I need, however, it made me think maybe this is something that others can benefit from as well, so a more generic solution might be a better option.

By generic solution, I was thinking about smth like introducing a possibility to enable/disable it by setting dedicated params, like:

newsletters_page = true
newsletters_subscription_url = https://newsletters.myblog.tld
newsletters_subscription_http_method = POST                                         # default value - POST
newsletters_subscription_request_body = '{ "email": "$user_email" }'

The request body is partly inspired by the Listmonk API - an open-source mailing list and newsletter manager.

Alternatively, to be consistent with the privacy-oriented approach, simply provide support for Listmonk as the only option for the newsletters subscription with such config params:

listmonk = true
listmon_host = https://listmonk.myblog.tld

Does this sound like something worth adding to the theme?

If that sounds like something you see as a good feature to have here, I can take a look, try to implement this, and create a PR. Disclaimer though: I have 0 Hugo experience (only Go for the backend stuff), so I'm not sure whether this is doable at all (enabling pages based on the toml config file).

Thanks and have fun!

n0rdy commented 10 months ago

Hey! =) I created a draft PR for this: https://github.com/lukeorth/poison/pull/143 It is missing changes to the project documentation, but since I'm not sure whether it's something you (as the owner of the theme) will find useful to have at all in Poison, I decided to skip it for now. I'll add it once I get a thumb-up from you

lukeorth commented 10 months ago

Sorry for my (very) tardy reply, @n0rdy.

Thank you for the kind words! I looked at your PR and am a huge fan of this. I am more than happy to add this to the theme. :tada: