fix: correct entry layout, light mode and editor parity
The single/page/404 templates set contentSize to 70ch, which resolves against each child's own font size: the display-size h1 asked for ~2660px and broke full bleed while the body stayed narrow. They now inherit the 720px from theme.json. Also drops the About facets that duplicated the portrait, adds the missing prefers-color-scheme branch for the character stage copy surface (dark text on a dark panel in System light), loads components.css in the editor, and replaces the unstyled index fallback with the journal stream. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
13 files changed
+221
-92
No files matched your search
+61
-1
@@ -13,9 +13,69 @@ function chrnx_setup() {
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
add_theme_support( 'responsive-embeds' );
|
||||
add_theme_support( 'editor-styles' );
|
||||
add_editor_style( array( 'assets/css/base.css', 'assets/css/layout.css' ) );
|
||||
add_editor_style( array( 'assets/css/base.css', 'assets/css/layout.css', 'assets/css/components.css' ) );
|
||||
remove_action( 'wp_footer', 'the_block_template_skip_link' );
|
||||
|
||||
add_image_size( 'chrnx-card', 720, 480, true );
|
||||
|
||||
register_nav_menus(
|
||||
array(
|
||||
'chrnx-primary' => __( 'Primary navigation', 'chrnx' ),
|
||||
'chrnx-footer' => __( 'Footer navigation', 'chrnx' ),
|
||||
)
|
||||
);
|
||||
|
||||
// No template renders a comment thread, so nothing is collected silently.
|
||||
remove_post_type_support( 'post', 'comments' );
|
||||
remove_post_type_support( 'page', 'comments' );
|
||||
}
|
||||
add_action( 'after_setup_theme', 'chrnx_setup' );
|
||||
add_filter( 'comments_open', '__return_false' );
|
||||
|
||||
/**
|
||||
* Print Open Graph and Twitter card tags for the current request.
|
||||
*
|
||||
* ponytail: hand-rolled because the theme needs four tags, not an SEO plugin.
|
||||
*/
|
||||
function chrnx_print_social_meta() {
|
||||
if ( is_singular() ) {
|
||||
$title = get_the_title();
|
||||
$url = get_permalink();
|
||||
$description = wp_strip_all_tags( get_the_excerpt() );
|
||||
$type = 'article';
|
||||
$image_id = get_post_thumbnail_id();
|
||||
} else {
|
||||
$title = get_bloginfo( 'name' );
|
||||
$url = home_url( '/' );
|
||||
$description = get_bloginfo( 'description' );
|
||||
$type = 'website';
|
||||
$image_id = 0;
|
||||
}
|
||||
|
||||
// Generated derivative, not the design master: masters are not shipped.
|
||||
$image = $image_id
|
||||
? wp_get_attachment_image_url( $image_id, 'full' )
|
||||
: get_theme_file_uri( 'assets/images/generated/about-grunge-1536.webp' );
|
||||
|
||||
$tags = array(
|
||||
'og:site_name' => get_bloginfo( 'name' ),
|
||||
'og:type' => $type,
|
||||
'og:title' => $title,
|
||||
'og:description' => $description,
|
||||
'og:url' => $url,
|
||||
'og:image' => $image,
|
||||
);
|
||||
|
||||
foreach ( $tags as $property => $content ) {
|
||||
if ( '' === $content ) {
|
||||
continue;
|
||||
}
|
||||
printf(
|
||||
'<meta property="%1$s" content="%2$s" />' . "\n",
|
||||
esc_attr( $property ),
|
||||
esc_attr( $content )
|
||||
);
|
||||
}
|
||||
echo '<meta name="twitter:card" content="summary_large_image" />' . "\n";
|
||||
}
|
||||
add_action( 'wp_head', 'chrnx_print_social_meta' );
|
||||
Reference in new issue
Block a user