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");
response.render("activitypub-followers", {
title: response.locals.__("activitypub.followers"),
title: `${totalCount} ${response.locals.__("activitypub.followers")}`,
followers,
followerCount: totalCount,
mountPath,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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