fix: make topics reachable and stop the head fighting itself
Every topic archive rendered its character art gate against the design master, which package-theme.sh deliberately strips, so production showed an empty stage on all eight of them. Gate on the derivative the markup actually loads instead. Nothing linked to a topic archive: the only filter was a select inside a form, invisible to crawlers and to anyone not looking for it. The stream now also lists the non-empty topics as links, marking the current one. Empty topics stay out, because a dead archive is worse than no link. Rank Math already owns the document head, so the theme's own og: tags were a second, conflicting set and core's title tag was a literal duplicate. Both now yield when an SEO plugin is active. Category archives listed the same posts as their topic at a second indexable URL. They now redirect to the same-slug topic, or the Journal. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
28 files changed
+165
-25
No files matched your search
@@ -2,7 +2,7 @@
|
||||
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||
"apiVersion": 3,
|
||||
"name": "chrnx/topic-hero",
|
||||
"version": "0.3.0",
|
||||
"version": "0.4.0",
|
||||
"title": "Topic Hero",
|
||||
"category": "theme",
|
||||
"description": "A fixed-art hero for an editorial topic.",
|
||||
|
||||
@@ -22,7 +22,14 @@ $chrnx_art_topic = 'chrnx_show' === $chrnx_taxonomy ? 'podcasts' : $chrnx_topic;
|
||||
$chrnx_asset = chrnx_get_topic_art_asset( $chrnx_art_topic );
|
||||
$chrnx_size = chrnx_get_topic_art_dimensions( $chrnx_art_topic );
|
||||
$chrnx_has_art = '' !== $chrnx_asset && 2 === count( $chrnx_size );
|
||||
$chrnx_has_image = $chrnx_has_art && is_readable( get_theme_file_path( $chrnx_asset ) );
|
||||
/*
|
||||
* The packaged theme ships only assets/images/generated, so the design master
|
||||
* is absent in production and gating on it hid the art on every topic archive.
|
||||
* Check the derivative the markup actually loads.
|
||||
*/
|
||||
$chrnx_has_image = $chrnx_has_art && is_readable(
|
||||
get_theme_file_path( 'assets/images/generated/' . pathinfo( $chrnx_asset, PATHINFO_FILENAME ) . '-768.webp' )
|
||||
);
|
||||
$chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 2, 2 );
|
||||
$chrnx_term = $chrnx_queried instanceof WP_Term && $chrnx_queried->slug === $chrnx_topic ? $chrnx_queried : get_term_by( 'slug', $chrnx_topic, 'chrnx_topic' );
|
||||
$chrnx_label = $chrnx_term instanceof WP_Term ? $chrnx_term->name : ucwords( str_replace( '-', ' ', $chrnx_topic ) );
|
||||
|
||||
Reference in new issue
Block a user