$r
+ */
+ private function rowGroupColumnLabel(array $r, string $groupKey): string
+ {
+ if ($groupKey === 'lightning') {
+ return 'Lightning';
+ }
+ if (str_starts_with($groupKey, 'payto:')) {
+ $s = substr($groupKey, 6);
+ if ($s === 'other') {
+ return 'Pay to';
+ }
+
+ return $this->stylizePaytoTypeName($s);
+ }
+
+ return (string) ($r['type_label'] ?? 'Pay to');
}
/**
@@ -365,6 +448,32 @@ final class ProfilePaymentLinksBuilder
return substr($lnurl, 0, 10).'…'.substr($lnurl, -8);
}
+ /**
+ * Skips NIP-A3 / JSON {@see payto://lightning/…} rows that repeat the LUD16 lightning address
+ * (e.g. same as {@see TYPE_LIGHTNING_ADDRESS} with {@code lightning:user@host}).
+ */
+ private static function paytoLightningUriMatchesLightningAddress(string $uri, string $lud16Email): bool
+ {
+ if (!str_starts_with(strtolower($uri), 'payto://lightning/')) {
+ return false;
+ }
+ $lud = strtolower(trim($lud16Email));
+ if ($lud === '' || !str_contains($lud, '@')) {
+ return false;
+ }
+ if (1 !== preg_match('#^payto://lightning/(.+)$#i', $uri, $m)) {
+ return false;
+ }
+ $tail = (string) $m[1];
+ $first = (string) (str_contains($tail, '/') ? strstr($tail, '/', true) : $tail);
+ if ($first === '') {
+ $first = $tail;
+ }
+ $first = strtolower(rawurldecode($first));
+
+ return $first === $lud;
+ }
+
/**
* JSON: strings (full `payto:` / `payto://` URI), or objects with `type`+`authority` (NIP-A3-style).
*
diff --git a/templates/pages/author.html.twig b/templates/pages/author.html.twig
index c096dc6..9fa2c53 100644
--- a/templates/pages/author.html.twig
+++ b/templates/pages/author.html.twig
@@ -5,6 +5,7 @@
{% include 'partial/author_profile_header.html.twig' with {
author: author,
npub: npub,
+ show_nip05: true,
profile_websites: profile_websites,
profile_nip05: profile_nip05,
profile_payment_links: profile_payment_links,
diff --git a/templates/pages/featured_authors.html.twig b/templates/pages/featured_authors.html.twig
index 57cc7e0..8c2d849 100644
--- a/templates/pages/featured_authors.html.twig
+++ b/templates/pages/featured_authors.html.twig
@@ -22,11 +22,11 @@
author: row.author,
npub: row.npub,
header_tag: 'h2',
+ show_nip05: false,
+ profile_nip05: [],
profile_websites: row.profile_websites,
- profile_nip05: row.profile_nip05,
profile_payment_links: row.profile_payment_links,
jumble_profile_href: row.jumble_profile_href,
- site_nip05: row.site_nip05,
} only %}
diff --git a/templates/partial/author_profile_header.html.twig b/templates/partial/author_profile_header.html.twig
index c5cc3c1..1c99ccb 100644
--- a/templates/partial/author_profile_header.html.twig
+++ b/templates/partial/author_profile_header.html.twig
@@ -1,4 +1,4 @@
-{# Shared author “header” + about (no article list). Expects: author, npub, profile_*, jumble_profile_href; optional site_nip05 #}
+{# Shared author “header” + about (no article list). Expects: author, npub, profile_*, jumble_profile_href; show_nip05: true on full /p/ profile only #}
{% set author_pic = null %}
{% if author.picture is defined and author.picture %}
{% set author_pic = author.picture %}
@@ -20,37 +20,34 @@
{% if profile_websites is not empty %}
{% endif %}
- {% if site_nip05|default('')|trim != '' %}
-
- -
- Magazine
- {{ site_nip05|e }}
-
-
- {% endif %}
- {% if profile_nip05 is not empty %}
+ {% if show_nip05|default(false) and profile_nip05 is not empty %}
{% endif %}
{% if profile_payment_links is not empty %}
-