From 0afc76fb78518bf8185c02e548e83e63c8bb0153 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Sat, 31 Oct 2026 19:07:58 +0100 Subject: chore(core): add djlint template tooling Add djlint to the development toolchain with Jinja, CSS, and JavaScript formatting rules so template style can be checked and normalized consistently. Reformat existing templates to match the configured conventions. --- webmentions_ssg/templates/.djlintrc | 14 ++++++++++++++ webmentions_ssg/templates/base.html | 24 +++++++++++++----------- webmentions_ssg/templates/login.html | 2 ++ webmentions_ssg/templates/received.html | 3 +++ webmentions_ssg/templates/sent.html | 5 ++++- webmentions_ssg/templates/sent_source.html | 7 +++++-- webmentions_ssg/templates/status.html | 2 ++ 7 files changed, 43 insertions(+), 14 deletions(-) create mode 100644 webmentions_ssg/templates/.djlintrc (limited to 'webmentions_ssg/templates') diff --git a/webmentions_ssg/templates/.djlintrc b/webmentions_ssg/templates/.djlintrc new file mode 100644 index 0000000..75c02c7 --- /dev/null +++ b/webmentions_ssg/templates/.djlintrc @@ -0,0 +1,14 @@ +{ + "blank_line_before_tag": "macro,block", + "blank_line_after_tag": "endmacro,extends", + "profile": "jinja", + "format_css": true, + "css": { + "indent_size": 2 + }, + "format_js": true, + "js": { + "indent_size": 2 + }, + "indent": "2" +} diff --git a/webmentions_ssg/templates/base.html b/webmentions_ssg/templates/base.html index 15739ab..19412ed 100644 --- a/webmentions_ssg/templates/base.html +++ b/webmentions_ssg/templates/base.html @@ -20,6 +20,7 @@ SPDX-License-Identifier: BSD-3-Clause type="image/png" sizes="32x32" href="{{ url_for('static', filename='images/favicon.png') }}"> + {% block styles %} {{ bootstrap.load_css() }} @@ -31,7 +32,7 @@ SPDX-License-Identifier: BSD-3-Clause
-
{{ render_messages(container=True) }}
-
- {% block content %}{% endblock %} -
- {% block scripts %} - - {{ bootstrap.load_js() }} - {% endblock %} - +
{{ render_messages(container=True) }}
+
+ {% block content %}{% endblock %} +
+ + {% block scripts %} + + {{ bootstrap.load_js() }} + {% endblock %} + diff --git a/webmentions_ssg/templates/login.html b/webmentions_ssg/templates/login.html index 3c40ea6..0431c96 100644 --- a/webmentions_ssg/templates/login.html +++ b/webmentions_ssg/templates/login.html @@ -4,8 +4,10 @@ SPDX-FileCopyrightText: 2026 Dennis Fink SPDX-License-Identifier: BSD-3-Clause --> {% extends "base.html" %} + {% set title = "Login" %} {% from "bootstrap5/form.html" import render_form %} + {% block content %}
{{ render_form(form) }}
diff --git a/webmentions_ssg/templates/received.html b/webmentions_ssg/templates/received.html index e4064b5..1ff3690 100644 --- a/webmentions_ssg/templates/received.html +++ b/webmentions_ssg/templates/received.html @@ -4,7 +4,9 @@ SPDX-FileCopyrightText: 2026 Dennis Fink SPDX-License-Identifier: BSD-3-Clause --> {% extends "base.html" %} + {% from "bootstrap5/pagination.html" import render_pagination %} + {% block content %}

Received Webmentions

@@ -95,6 +97,7 @@ SPDX-License-Identifier: BSD-3-Clause

No Webmentions have been received yet.

{% endif %} {% endblock %} + {% block scripts %} {{ super() }} diff --git a/webmentions_ssg/templates/sent.html b/webmentions_ssg/templates/sent.html index 844a243..c9662b9 100644 --- a/webmentions_ssg/templates/sent.html +++ b/webmentions_ssg/templates/sent.html @@ -4,7 +4,9 @@ SPDX-FileCopyrightText: 2026 Dennis Fink SPDX-License-Identifier: BSD-3-Clause --> {% extends "base.html" %} + {% from "bootstrap5/pagination.html" import render_pagination %} + {% block content %}

Sources

@@ -14,7 +16,7 @@ SPDX-License-Identifier: BSD-3-Clause class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#confirmation-modal" - data-action="{{ url_for("root.rescan_sent_sources") }}" + data-action="{{ url_for('root.rescan_sent_sources') }}" data-title="Rescan sources?" data-message="All sources will be scanned again for changes and webmentions." data-confirm-label="Rescan" @@ -79,6 +81,7 @@ SPDX-License-Identifier: BSD-3-Clause

No Webmention sources have been discovered yet.

{% endif %} {% endblock %} + {% block scripts %} {{ super() }} diff --git a/webmentions_ssg/templates/sent_source.html b/webmentions_ssg/templates/sent_source.html index 8d22068..689c651 100644 --- a/webmentions_ssg/templates/sent_source.html +++ b/webmentions_ssg/templates/sent_source.html @@ -4,10 +4,12 @@ SPDX-FileCopyrightText: 2026 Dennis Fink SPDX-License-Identifier: BSD-3-Clause --> {% extends "base.html" %} + {% from "bootstrap5/pagination.html" import render_pagination %} + {% block content %}

Source Details

@@ -191,7 +193,7 @@ SPDX-License-Identifier: BSD-3-Clause class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#confirmation-modal" - data-action="{{ url_for("root.resend_sent_webmention", source_identifier=source.uuid, webmention_identifier=webmention.uuid) }}" + data-action="{{ url_for('root.resend_sent_webmention', source_identifier=source.uuid, webmention_identifier=webmention.uuid) }}" data-title="Resend Webmention?" data-message="This Webmention will be queued again for delivery to {{ webmention.target }}." data-confirm-label="Resend" @@ -209,6 +211,7 @@ SPDX-License-Identifier: BSD-3-Clause

No Webmentions have been discovered for this source.

{% endif %} {% endblock %} + {% block scripts %} {{ super() }} diff --git a/webmentions_ssg/templates/status.html b/webmentions_ssg/templates/status.html index 437a507..2db2741 100644 --- a/webmentions_ssg/templates/status.html +++ b/webmentions_ssg/templates/status.html @@ -4,7 +4,9 @@ SPDX-FileCopyrightText: 2026 Dennis Fink SPDX-License-Identifier: BSD-3-Clause --> {% extends "base.html" %} + {% from "bootstrap5/utils.html" import render_icon %} + {% block content %}
-- cgit v1.3.1