Add a cookie warning notice to a Hugo powered site

The Challenge

How to add a cookie warning notice to a Hugo powered website. But also avoid using a third party service.

The Solution

Build your own. Well, find someone who built one and shared it on youtube and github.

Disclaimer: This does not constitute any form of legal advice. Use at your own risk.

Of course if anyone has a better, more complete solution. I would really like hear from you. So drop me a message through GitHub.

So many thanks to the original author: Godson Thomas. You can find the references below:

YouTube:

Code located: GitHub

How I worked this code into my Hugo site.

I created three files under the content folder.

  1. layouts/partials/cookie-notice.html (using the key component needed for the notice.)