From bcb2b1be7e6dc3867ade719592fae1f3f50bff2a Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Tue, 24 Feb 2026 09:58:30 -0600 Subject: [PATCH] add the ability to specify the content license in the footer e.g. for marking all pages as CC BY-SA 4.0 Signed-off-by: Brian S. Stephan --- incorporealcms/templates/base.html | 6 +++++- tests/test_markdown.py | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/incorporealcms/templates/base.html b/incorporealcms/templates/base.html index 958887a..cc41d39 100644 --- a/incorporealcms/templates/base.html +++ b/incorporealcms/templates/base.html @@ -44,7 +44,11 @@ SPDX-License-Identifier: GPL-3.0-or-later
{% if extra_footer %}{% endif %} - +
{% endblock %} diff --git a/tests/test_markdown.py b/tests/test_markdown.py index 04da58e..fb954ae 100644 --- a/tests/test_markdown.py +++ b/tests/test_markdown.py @@ -217,3 +217,15 @@ def test_index_in_source_link_is_stripped(): assert 'Anchored This Index' in content assert 'Parent' in content assert 'Anchored Parent' in content + + +def test_license_link(): + """Test that the config's license HTML is displayed in the footer.""" + with patch('incorporealcms.Config.LICENSE', + 'CC BY-SA 4.0', create=True): + assert 'Available via CC BY-SA 4.0.'\ + in handle_markdown_file_path('index.md', PAGES_DIR) + + # default, no config + assert 'CC BY-SA 4.0'\ + not in handle_markdown_file_path('index.md', PAGES_DIR)