Has anyone added a custom footer to Discourse?

Updated instructions for how to find this in 2020

  1. Hamburger > Settings > Customize > [Select a Theme] > “Edit CSS/HTML” button > Footer
  2. Enter your custom HTML in the box and hit ‘Save’.
  3. Repeat for each Theme that users can select.

A decent, basic copyright section

I started with the following HTML for my copyright footer, which I thought worked well for both the default light and dark themes:

<div style="text-align: center; color: #999; font-size: 90%; padding: 2em 0;">
Copyright &copy; 2020 INSERT YOUR COMPANY HERE. All rights reserved.
</div>

Automatically updating the year

Of course, I don’t want to have to change the year in the footer every 12 months, so I’ve ugpraded it to have this HTML in the footer:

<div style="text-align: center; color: #999; font-size: 90%; padding: 2em 0;">
Copyright &copy; <span id="footer-copyright-current-year"></span> INSERT YOUR COMPANY HERE. All rights reserved.
</div>

And this in the </body> section (probably not the ideal code, but I’m new to hacking Discourse):

<script>
    function setCopyrightYear() {
        var el = document.getElementById("footer-copyright-current-year");
        if (el) {
            el.innerHTML = new Date().getFullYear();
        } else {
            setTimeout(setCopyrightYear, 100);
        }
    }
    document.addEventListener("DOMContentLoaded", setCopyrightYear);
</script>

Again, you need to copy/paste it to every theme where you want it to show up.