I have published a recipe for how to generate dynamic license pages with Caddy. The pages show an MIT License with your specified copyright years. For example, https://dbohdan.com/mit-license/2019-2020,2023,2025 shows one with “Copyright (c) 2019-2020, 2023, 2025 D. Bohdan”. This makes it easy to include a license anywhere with just a URL.
The recipe uses two path_regexp matchers and a regexp placeholder in two templates. It generates both HTML pages and downloadable plain-text files (via /license.txt). The regular expression validates the year ranges and prevents arbitrary text injection.
The recipe is inspired by mit-license.org. I wanted to self-host something like it. You can easily modify it to serve a different license.