fix: remove duplicate page headings across all AP templates

document.njk already renders title as h1 via the heading macro.
All 14 AP templates were also calling heading() with level 1 inside
their content block, producing two h1 elements per page. Removed
the redundant calls and moved dynamic count prefixes into the title
variable in followers/following controllers.
This commit is contained in:
Ricardo
2026-02-21 21:32:56 +01:00
parent 81373d662f
commit 0cf49e037c
15 changed files with 2 additions and 28 deletions

View File

@@ -32,7 +32,7 @@ export function followersController(mountPath) {
const cursor = buildCursor(page, totalPages, mountPath + "/admin/followers"); const cursor = buildCursor(page, totalPages, mountPath + "/admin/followers");
response.render("activitypub-followers", { response.render("activitypub-followers", {
title: response.locals.__("activitypub.followers"), title: `${totalCount} ${response.locals.__("activitypub.followers")}`,
followers, followers,
followerCount: totalCount, followerCount: totalCount,
mountPath, mountPath,

View File

@@ -32,7 +32,7 @@ export function followingController(mountPath) {
const cursor = buildCursor(page, totalPages, mountPath + "/admin/following"); const cursor = buildCursor(page, totalPages, mountPath + "/admin/following");
response.render("activitypub-following", { response.render("activitypub-following", {
title: response.locals.__("activitypub.following"), title: `${totalCount} ${response.locals.__("activitypub.following")}`,
following, following,
followingCount: totalCount, followingCount: totalCount,
mountPath, mountPath,

View File

@@ -7,8 +7,6 @@
{% from "pagination/macro.njk" import pagination with context %} {% from "pagination/macro.njk" import pagination with context %}
{% block content %} {% block content %}
{{ heading({ text: __("activitypub.activities"), level: 1 }) }}
{% if activities.length > 0 %} {% if activities.length > 0 %}
{% for activity in activities %} {% for activity in activities %}
{{ card({ {{ card({

View File

@@ -3,8 +3,6 @@
{% from "heading/macro.njk" import heading with context %} {% from "heading/macro.njk" import heading with context %}
{% block readercontent %} {% block readercontent %}
{{ heading({ text: title, level: 1 }) }}
{# Reply context — show the post being replied to #} {# Reply context — show the post being replied to #}
{% if replyContext %} {% if replyContext %}
<div class="ap-compose__context"> <div class="ap-compose__context">

View File

@@ -7,8 +7,6 @@
{% from "badge/macro.njk" import badge with context %} {% from "badge/macro.njk" import badge with context %}
{% block content %} {% block content %}
{{ heading({ text: title, level: 1 }) }}
{{ cardGrid({ cardSize: "16rem", items: [ {{ cardGrid({ cardSize: "16rem", items: [
{ {
title: followerCount + " " + __("activitypub.followers"), title: followerCount + " " + __("activitypub.followers"),

View File

@@ -4,8 +4,6 @@
{% from "prose/macro.njk" import prose with context %} {% from "prose/macro.njk" import prose with context %}
{% block content %} {% block content %}
{{ heading({ text: title, level: 1 }) }}
{% if tags.length > 0 %} {% if tags.length > 0 %}
<table class="table"> <table class="table">
<thead> <thead>

View File

@@ -4,8 +4,6 @@
{% from "prose/macro.njk" import prose with context %} {% from "prose/macro.njk" import prose with context %}
{% block content %} {% block content %}
{{ heading({ text: title, level: 1 }) }}
{% if pinned.length > 0 %} {% if pinned.length > 0 %}
<table class="table"> <table class="table">
<thead> <thead>

View File

@@ -6,8 +6,6 @@
{% from "pagination/macro.njk" import pagination with context %} {% from "pagination/macro.njk" import pagination with context %}
{% block content %} {% block content %}
{{ heading({ text: followerCount + " " + __("activitypub.followers"), level: 1 }) }}
{% if followers.length > 0 %} {% if followers.length > 0 %}
{% for follower in followers %} {% for follower in followers %}
{{ card({ {{ card({

View File

@@ -7,8 +7,6 @@
{% from "pagination/macro.njk" import pagination with context %} {% from "pagination/macro.njk" import pagination with context %}
{% block content %} {% block content %}
{{ heading({ text: followingCount + " " + __("activitypub.following"), level: 1 }) }}
{% if following.length > 0 %} {% if following.length > 0 %}
{% for account in following %} {% for account in following %}
{% if account.source === "import" %} {% if account.source === "import" %}

View File

@@ -8,8 +8,6 @@
{% from "prose/macro.njk" import prose with context %} {% from "prose/macro.njk" import prose with context %}
{% block content %} {% block content %}
{{ heading({ text: title, level: 1 }) }}
{% if result %} {% if result %}
{{ notificationBanner({ type: result.type, text: result.text }) }} {{ notificationBanner({ type: result.type, text: result.text }) }}
{% endif %} {% endif %}

View File

@@ -4,8 +4,6 @@
{% from "prose/macro.njk" import prose with context %} {% from "prose/macro.njk" import prose with context %}
{% block readercontent %} {% block readercontent %}
{{ heading({ text: title, level: 1 }) }}
{# Blocked actors #} {# Blocked actors #}
<section class="ap-moderation__section"> <section class="ap-moderation__section">
<h2>{{ __("activitypub.moderation.blockedTitle") }}</h2> <h2>{{ __("activitypub.moderation.blockedTitle") }}</h2>

View File

@@ -4,8 +4,6 @@
{% from "prose/macro.njk" import prose with context %} {% from "prose/macro.njk" import prose with context %}
{% block readercontent %} {% block readercontent %}
{{ heading({ text: __("activitypub.notifications.title"), level: 1 }) }}
{% if items.length > 0 %} {% if items.length > 0 %}
<div class="ap-notifications__toolbar"> <div class="ap-notifications__toolbar">
{% if unreadCount > 0 %} {% if unreadCount > 0 %}

View File

@@ -3,8 +3,6 @@
{% from "heading/macro.njk" import heading with context %} {% from "heading/macro.njk" import heading with context %}
{% block readercontent %} {% block readercontent %}
{{ heading({ text: title, level: 1 }) }}
<div class="ap-post-detail" data-mount-path="{{ mountPath }}"> <div class="ap-post-detail" data-mount-path="{{ mountPath }}">
{# Back button #} {# Back button #}
<div class="ap-post-detail__back"> <div class="ap-post-detail__back">

View File

@@ -10,8 +10,6 @@
{% from "prose/macro.njk" import prose with context %} {% from "prose/macro.njk" import prose with context %}
{% block content %} {% block content %}
{{ heading({ text: title, level: 1 }) }}
{% if result %} {% if result %}
{{ notificationBanner({ type: result.type, text: result.text }) }} {{ notificationBanner({ type: result.type, text: result.text }) }}
{% endif %} {% endif %}

View File

@@ -4,8 +4,6 @@
{% from "prose/macro.njk" import prose with context %} {% from "prose/macro.njk" import prose with context %}
{% block readercontent %} {% block readercontent %}
{{ heading({ text: title, level: 1 }) }}
<div class="ap-profile" <div class="ap-profile"
x-data="{ x-data="{
following: {{ 'true' if isFollowing else 'false' }}, following: {{ 'true' if isFollowing else 'false' }},