feat: add CHRNX templates and editorial patterns
This commit is contained in:
20 files changed
+561
-4
No files matched your search
@@ -24,7 +24,7 @@ $chrnx_label = $chrnx_term instanceof WP_Term ? $chrnx_term->name : ucfirst( $
|
||||
</div>
|
||||
<div class="chrnx-topic-hero__art">
|
||||
<?php if ( is_readable( get_theme_file_path( $chrnx_asset ) ) ) : ?>
|
||||
<img src="<?php echo esc_url( get_theme_file_uri( $chrnx_asset ) ); ?>" alt="<?php echo esc_attr( $chrnx_label ); ?>">
|
||||
<img src="<?php echo esc_url( get_theme_file_uri( $chrnx_asset ) ); ?>" width="1122" height="1402" loading="lazy" decoding="async" alt="" aria-hidden="true">
|
||||
<?php else : ?>
|
||||
<span class="chrnx-topic-hero__fallback" aria-hidden="true"></span>
|
||||
<?php endif; ?>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Title: About profile
|
||||
* Slug: chrnx/about
|
||||
* Categories: chrnx-about
|
||||
* Description: A dignified work-first profile with concise human context.
|
||||
* Inserter: yes
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
$chrnx_research_url = esc_url( 'https://arxiv.org/abs/2603.05352' );
|
||||
?>
|
||||
<!-- wp:group {"tagName":"section","className":"chrnx-about","layout":{"type":"constrained","contentSize":"70ch"}} -->
|
||||
<section class="wp-block-group chrnx-about">
|
||||
<!-- wp:heading {"level":1} --><h1 class="wp-block-heading"><?php echo esc_html__( 'About', 'chrnx' ); ?></h1><!-- /wp:heading -->
|
||||
<!-- wp:paragraph --><p><?php echo esc_html__( 'I am an autistic Level 1 independent researcher and software developer exploring emotion modeling and game AI.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
|
||||
<!-- wp:paragraph --><p><?php echo esc_html__( 'I work as Lead Developer @Expressive Tea, building full-stack software with JavaScript and Python. My practice includes open source work and amateur data science.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
|
||||
<!-- wp:paragraph --><p><?php echo esc_html__( 'I am a published researcher. My current paper is available on', 'chrnx' ); ?> <a href="<?php echo $chrnx_research_url; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped at assignment. ?>" target="_blank" rel="noopener noreferrer external"><?php echo esc_html__( 'arXiv:2603.05352', 'chrnx' ); ?></a>.</p><!-- /wp:paragraph -->
|
||||
<!-- wp:heading --><h2 class="wp-block-heading"><?php echo esc_html__( 'Beyond the work', 'chrnx' ); ?></h2><!-- /wp:heading -->
|
||||
<!-- wp:paragraph --><p><?php echo esc_html__( 'I am the father of three wonderful children, a musician, a gamer, and pet-friendly.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
|
||||
</section>
|
||||
<!-- /wp:group -->
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* Title: Home introduction
|
||||
* Slug: chrnx/home-intro
|
||||
* Categories: chrnx-home
|
||||
* Description: A concise work-first introduction for the home page.
|
||||
* Inserter: yes
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
?>
|
||||
<!-- wp:group {"tagName":"section","className":"chrnx-home-intro","layout":{"type":"constrained"}} -->
|
||||
<section class="wp-block-group chrnx-home-intro">
|
||||
<!-- wp:heading {"level":1} --><h1 class="wp-block-heading"><?php echo esc_html__( 'Ideas made tangible through software, research, and stories.', 'chrnx' ); ?></h1><!-- /wp:heading -->
|
||||
<!-- wp:paragraph --><p><?php echo esc_html__( 'Chrnx explores expressive systems, open technology, and the everyday life that gives the work meaning.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
|
||||
</section>
|
||||
<!-- /wp:group -->
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Title: Home music
|
||||
* Slug: chrnx/home-music
|
||||
* Categories: chrnx-home, chrnx-music
|
||||
* Description: A restrained introduction to The No Names.
|
||||
* Inserter: yes
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
$chrnx_home_music_art = get_theme_file_uri( 'assets/images/the-no-names-musician-cutout.png' );
|
||||
?>
|
||||
<!-- wp:group {"tagName":"section","className":"chrnx-home-music","layout":{"type":"constrained"}} -->
|
||||
<section class="wp-block-group chrnx-home-music">
|
||||
<!-- wp:columns {"verticalAlignment":"center"} -->
|
||||
<div class="wp-block-columns are-vertically-aligned-center">
|
||||
<!-- wp:column {"verticalAlignment":"center"} --><div class="wp-block-column is-vertically-aligned-center">
|
||||
<!-- wp:heading --><h2 class="wp-block-heading"><?php echo esc_html__( 'The No Names', 'chrnx' ); ?></h2><!-- /wp:heading -->
|
||||
<!-- wp:paragraph --><p><?php echo esc_html__( 'Grunge mexicano para cerebros que no se callan.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
|
||||
<!-- wp:paragraph --><p><?php echo esc_html__( 'Un proyecto de banda activo hecho en Sinaloa: estudio crudo, cero live.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
|
||||
</div><!-- /wp:column -->
|
||||
<!-- wp:column {"verticalAlignment":"center"} --><div class="wp-block-column is-vertically-aligned-center">
|
||||
<!-- wp:html --><img class="chrnx-home-music__art" src="<?php echo esc_url( $chrnx_home_music_art ); ?>" width="1122" height="1402" loading="lazy" decoding="async" alt="<?php echo esc_attr__( 'The No Names musician portrait', 'chrnx' ); ?>"><!-- /wp:html -->
|
||||
</div><!-- /wp:column -->
|
||||
</div>
|
||||
<!-- /wp:columns -->
|
||||
</section>
|
||||
<!-- /wp:group -->
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Title: Home projects
|
||||
* Slug: chrnx/home-projects
|
||||
* Categories: chrnx-home, chrnx-projects
|
||||
* Description: Selected areas of public work without fabricated metrics or links.
|
||||
* Inserter: yes
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
?>
|
||||
<!-- wp:group {"tagName":"section","className":"chrnx-home-projects","layout":{"type":"constrained"}} -->
|
||||
<section class="wp-block-group chrnx-home-projects">
|
||||
<!-- wp:heading --><h2 class="wp-block-heading"><?php echo esc_html__( 'Selected work', 'chrnx' ); ?></h2><!-- /wp:heading -->
|
||||
<!-- wp:columns -->
|
||||
<div class="wp-block-columns">
|
||||
<!-- wp:column --><div class="wp-block-column"><!-- wp:heading {"level":3} --><h3 class="wp-block-heading"><?php echo esc_html__( 'Expressive Tea', 'chrnx' ); ?></h3><!-- /wp:heading --></div><!-- /wp:column -->
|
||||
<!-- wp:column --><div class="wp-block-column"><!-- wp:heading {"level":3} --><h3 class="wp-block-heading"><?php echo esc_html__( 'Ailed', 'chrnx' ); ?></h3><!-- /wp:heading --></div><!-- /wp:column -->
|
||||
<!-- wp:column --><div class="wp-block-column"><!-- wp:heading {"level":3} --><h3 class="wp-block-heading"><?php echo esc_html__( 'Published research', 'chrnx' ); ?></h3><!-- /wp:heading --></div><!-- /wp:column -->
|
||||
</div>
|
||||
<!-- /wp:columns -->
|
||||
</section>
|
||||
<!-- /wp:group -->
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* Title: Music landing
|
||||
* Slug: chrnx/music-landing
|
||||
* Categories: chrnx-music
|
||||
* Description: Honest public introduction and approved starter releases for The No Names.
|
||||
* Inserter: yes
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
$chrnx_music_collage = get_theme_file_uri( 'assets/images/the-no-names-collage.jpeg' );
|
||||
?>
|
||||
<!-- wp:group {"tagName":"section","className":"chrnx-music-landing","layout":{"type":"constrained"}} -->
|
||||
<section class="wp-block-group chrnx-music-landing">
|
||||
<!-- wp:heading {"level":1} --><h1 class="wp-block-heading"><?php echo esc_html__( 'The No Names', 'chrnx' ); ?></h1><!-- /wp:heading -->
|
||||
<!-- wp:paragraph --><p><?php echo esc_html__( 'Grunge mexicano para cerebros que no se callan.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
|
||||
<!-- wp:paragraph --><p><?php echo esc_html__( 'The No Names es una banda activa y un proyecto de grunge en español mexicano desde Sinaloa: guitarras sucias, graves físicos, dinámica cruda de estudio y una voz que va de la contención a la ruptura. estudio crudo, cero live.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
|
||||
<!-- wp:paragraph --><p><?php echo esc_html__( 'El proceso usa generative AI anclada en la voz humana real de Chrnx. Es una herramienta de producción, no una mitología ficticia ni una promesa sobre lo que la tecnología puede hacer.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
|
||||
<!-- wp:html --><img class="chrnx-music-landing__art" src="<?php echo esc_url( $chrnx_music_collage ); ?>" width="1122" height="1402" loading="lazy" decoding="async" alt="<?php echo esc_attr__( 'The No Names collage', 'chrnx' ); ?>"><!-- /wp:html -->
|
||||
<!-- wp:heading --><h2 class="wp-block-heading"><?php echo esc_html__( 'Releases in progress', 'chrnx' ); ?></h2><!-- /wp:heading -->
|
||||
<!-- wp:group {"className":"chrnx-release-list","layout":{"type":"grid","minimumColumnWidth":"18rem"}} -->
|
||||
<div class="wp-block-group chrnx-release-list">
|
||||
<!-- wp:group {"tagName":"article","className":"chrnx-release-card"} --><article class="wp-block-group chrnx-release-card"><!-- wp:heading {"level":3} --><h3 class="wp-block-heading"><?php echo esc_html__( 'El Hermoso Caos que habita en mi cabeza', 'chrnx' ); ?></h3><!-- /wp:heading --><!-- wp:paragraph --><p><?php echo esc_html__( '13-track debut album — draft/in production', 'chrnx' ); ?></p><!-- /wp:paragraph --></article><!-- /wp:group -->
|
||||
<!-- wp:group {"tagName":"article","className":"chrnx-release-card"} --><article class="wp-block-group chrnx-release-card"><!-- wp:heading {"level":3} --><h3 class="wp-block-heading"><?php echo esc_html__( 'Ando Bien Arriba', 'chrnx' ); ?></h3><!-- /wp:heading --><!-- wp:paragraph --><p><?php echo esc_html__( 'six-track bright mirrored EP — draft/in production', 'chrnx' ); ?></p><!-- /wp:paragraph --></article><!-- /wp:group -->
|
||||
<!-- wp:group {"tagName":"article","className":"chrnx-release-card"} --><article class="wp-block-group chrnx-release-card"><!-- wp:heading {"level":3} --><h3 class="wp-block-heading"><?php echo esc_html__( 'Aquí se Rompió una Jerga', 'chrnx' ); ?></h3><!-- /wp:heading --><!-- wp:paragraph --><p><?php echo esc_html__( 'six-track dark mirrored EP — draft/in production', 'chrnx' ); ?></p><!-- /wp:paragraph --></article><!-- /wp:group -->
|
||||
</div>
|
||||
<!-- /wp:group -->
|
||||
</section>
|
||||
<!-- /wp:group -->
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* Title: Music release card
|
||||
* Slug: chrnx/music-release
|
||||
* Categories: chrnx-music
|
||||
* Description: A neutral editable release card without invented release data.
|
||||
* Inserter: yes
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
?>
|
||||
<!-- wp:group {"tagName":"article","metadata":{"name":"chrnx/release-card"},"className":"chrnx-release-card","layout":{"type":"constrained"}} -->
|
||||
<article class="wp-block-group chrnx-release-card">
|
||||
<!-- wp:heading {"level":2,"metadata":{"name":"chrnx/release-title"}} --><h2 class="wp-block-heading"></h2><!-- /wp:heading -->
|
||||
<!-- wp:paragraph {"metadata":{"name":"chrnx/release-status"}} --><p></p><!-- /wp:paragraph -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/release-summary"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/release-artwork"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/release-tracklist"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
</article>
|
||||
<!-- /wp:group -->
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Title: Podcast episode
|
||||
* Slug: chrnx/podcast-episode
|
||||
* Categories: chrnx-podcasts
|
||||
* Description: Editable episode fields with one optional content embed region.
|
||||
* Inserter: yes
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
?>
|
||||
<!-- wp:group {"tagName":"article","className":"chrnx-podcast-episode","layout":{"type":"constrained"}} -->
|
||||
<article class="wp-block-group chrnx-podcast-episode">
|
||||
<!-- wp:post-title {"level":1} /-->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/episode-show"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/episode-number"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/episode-duration"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/episode-participants"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/episode-canonical-url"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/episode-embed"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/episode-show-notes"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
</article>
|
||||
<!-- /wp:group -->
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Title: Podcast landing
|
||||
* Slug: chrnx/podcast-landing
|
||||
* Categories: chrnx-podcasts
|
||||
* Description: Empty structural regions for show discovery, latest episodes, and archives.
|
||||
* Inserter: yes
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
$chrnx_podcast_art = get_theme_file_uri( 'assets/images/alter-ego-podcasts.png' );
|
||||
?>
|
||||
<!-- wp:group {"tagName":"section","className":"chrnx-podcast-landing","layout":{"type":"constrained"}} -->
|
||||
<section class="wp-block-group chrnx-podcast-landing">
|
||||
<!-- wp:heading {"level":1} --><h1 class="wp-block-heading"><?php echo esc_html__( 'Podcasts', 'chrnx' ); ?></h1><!-- /wp:heading -->
|
||||
<!-- wp:html --><img class="chrnx-podcast-landing__art" src="<?php echo esc_url( $chrnx_podcast_art ); ?>" width="1122" height="1402" loading="lazy" decoding="async" alt="" aria-hidden="true"><!-- /wp:html -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/podcast-show-discovery"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/podcast-latest"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/podcast-archive"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
</section>
|
||||
<!-- /wp:group -->
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Title: Podcast show
|
||||
* Slug: chrnx/podcast-show
|
||||
* Categories: chrnx-podcasts
|
||||
* Description: Editable structure for one approved podcast show.
|
||||
* Inserter: yes
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
?>
|
||||
<!-- wp:group {"tagName":"article","className":"chrnx-podcast-show","layout":{"type":"constrained"}} -->
|
||||
<article class="wp-block-group chrnx-podcast-show">
|
||||
<!-- wp:post-title {"level":1} /-->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/show-cover"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/show-description"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/show-hosts"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/show-latest-episode"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/show-archive"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/show-listening-destinations"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
</article>
|
||||
<!-- /wp:group -->
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* Title: Project detail
|
||||
* Slug: chrnx/project-detail
|
||||
* Categories: chrnx-projects
|
||||
* Description: Editable project fields for status, summary, references, and related work.
|
||||
* Inserter: yes
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
?>
|
||||
<!-- wp:group {"tagName":"article","className":"chrnx-project-detail","layout":{"type":"constrained"}} -->
|
||||
<article class="wp-block-group chrnx-project-detail">
|
||||
<!-- wp:post-title {"level":1} /-->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/project-status"},"layout":{"type":"constrained"}} --><div class="wp-block-group"><!-- wp:paragraph {"metadata":{"name":"chrnx/project-status-value"}} --><p></p><!-- /wp:paragraph --></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/project-summary"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/project-links"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/project-technologies"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/project-publications"},"layout":{"type":"constrained"}} --><div class="wp-block-group"></div><!-- /wp:group -->
|
||||
<!-- wp:group {"metadata":{"name":"chrnx/project-related-posts"},"layout":{"type":"constrained"}} --><div class="wp-block-group"><!-- wp:chrnx/related-posts /--></div><!-- /wp:group -->
|
||||
</article>
|
||||
<!-- /wp:group -->
|
||||
@@ -0,0 +1,14 @@
|
||||
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
|
||||
|
||||
<!-- wp:group {"tagName":"main","anchor":"chrnx-main","className":"chrnx-not-found","layout":{"type":"constrained","contentSize":"70ch"}} -->
|
||||
<main id="chrnx-main" class="wp-block-group chrnx-not-found" tabindex="-1">
|
||||
<!-- wp:heading {"level":1} --><h1 class="wp-block-heading">Page not found</h1><!-- /wp:heading -->
|
||||
<!-- wp:paragraph --><p>This address does not lead to a published page. Search the site or return to a known starting point.</p><!-- /wp:paragraph -->
|
||||
<!-- wp:search {"label":"Search","showLabel":true,"buttonText":"Search"} /-->
|
||||
<!-- wp:navigation {"overlayMenu":"never","className":"chrnx-not-found__recovery"} -->
|
||||
<!-- wp:home-link {"label":"Home"} /-->
|
||||
<!-- /wp:navigation -->
|
||||
</main>
|
||||
<!-- /wp:group -->
|
||||
|
||||
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
|
||||
@@ -0,0 +1,12 @@
|
||||
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
|
||||
|
||||
<!-- wp:group {"tagName":"main","anchor":"chrnx-main","className":"chrnx-archive","layout":{"type":"constrained"}} -->
|
||||
<main id="chrnx-main" class="wp-block-group chrnx-archive" tabindex="-1">
|
||||
<!-- wp:query-title {"type":"archive","level":1,"showPrefix":false} /-->
|
||||
<!-- wp:term-description /-->
|
||||
<!-- wp:chrnx/topic-hero /-->
|
||||
<!-- wp:chrnx/journal-stream /-->
|
||||
</main>
|
||||
<!-- /wp:group -->
|
||||
|
||||
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
|
||||
@@ -0,0 +1,21 @@
|
||||
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
|
||||
|
||||
<!-- wp:group {"tagName":"main","anchor":"chrnx-main","className":"chrnx-home","layout":{"type":"default"}} -->
|
||||
<main id="chrnx-main" class="wp-block-group chrnx-home" tabindex="-1">
|
||||
<!-- wp:pattern {"slug":"chrnx/home-intro"} /-->
|
||||
<!-- wp:chrnx/featured-stories /-->
|
||||
<!-- wp:chrnx/journal-stream /-->
|
||||
<!-- wp:pattern {"slug":"chrnx/home-projects"} /-->
|
||||
<!-- wp:pattern {"slug":"chrnx/home-music"} /-->
|
||||
<!-- wp:chrnx/latest-podcast /-->
|
||||
<!-- wp:group {"className":"chrnx-home-about-preview","layout":{"type":"constrained"}} -->
|
||||
<div class="wp-block-group chrnx-home-about-preview">
|
||||
<!-- wp:heading {"level":2} --><h2 class="wp-block-heading">About</h2><!-- /wp:heading -->
|
||||
<!-- wp:paragraph --><p>Independent research, software, music, games, and the human life around the work.</p><!-- /wp:paragraph -->
|
||||
</div>
|
||||
<!-- /wp:group -->
|
||||
<!-- wp:chrnx/subscribe-cta {"className":"is-style-quiet"} /-->
|
||||
</main>
|
||||
<!-- /wp:group -->
|
||||
|
||||
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
|
||||
@@ -0,0 +1,10 @@
|
||||
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
|
||||
|
||||
<!-- wp:group {"tagName":"main","anchor":"chrnx-main","className":"chrnx-entry chrnx-entry--page","layout":{"type":"constrained","contentSize":"70ch"}} -->
|
||||
<main id="chrnx-main" class="wp-block-group chrnx-entry chrnx-entry--page" tabindex="-1">
|
||||
<!-- wp:post-title {"level":1} /-->
|
||||
<!-- wp:post-content {"layout":{"type":"constrained"}} /-->
|
||||
</main>
|
||||
<!-- /wp:group -->
|
||||
|
||||
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
|
||||
@@ -0,0 +1,14 @@
|
||||
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
|
||||
|
||||
<!-- wp:group {"tagName":"main","anchor":"chrnx-main","className":"chrnx-search-results","layout":{"type":"constrained"}} -->
|
||||
<main id="chrnx-main" class="wp-block-group chrnx-search-results" tabindex="-1">
|
||||
<!-- wp:query-title {"type":"search","level":1} /-->
|
||||
<!-- wp:search {"label":"Search","showLabel":true,"buttonText":"Search"} /-->
|
||||
<!-- wp:chrnx/journal-stream /-->
|
||||
<!-- wp:navigation {"overlayMenu":"never","className":"chrnx-search-results__recovery"} -->
|
||||
<!-- wp:home-link {"label":"Home"} /-->
|
||||
<!-- /wp:navigation -->
|
||||
</main>
|
||||
<!-- /wp:group -->
|
||||
|
||||
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
|
||||
@@ -0,0 +1,21 @@
|
||||
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
|
||||
|
||||
<!-- wp:group {"tagName":"main","anchor":"chrnx-main","className":"chrnx-entry chrnx-entry--single","layout":{"type":"constrained","contentSize":"70ch"}} -->
|
||||
<main id="chrnx-main" class="wp-block-group chrnx-entry chrnx-entry--single" tabindex="-1">
|
||||
<!-- wp:post-title {"level":1} /-->
|
||||
<!-- wp:group {"className":"chrnx-entry__meta","layout":{"type":"flex","flexWrap":"wrap"}} -->
|
||||
<div class="wp-block-group chrnx-entry__meta">
|
||||
<!-- wp:post-terms {"term":"chrnx_topic"} /-->
|
||||
<!-- wp:post-terms {"term":"chrnx_language"} /-->
|
||||
<!-- wp:post-date /-->
|
||||
</div>
|
||||
<!-- /wp:group -->
|
||||
<!-- wp:post-featured-image {"aspectRatio":"3/2"} /-->
|
||||
<!-- wp:post-content {"layout":{"type":"constrained"}} /-->
|
||||
<!-- wp:chrnx/podcast-meta /-->
|
||||
<!-- wp:chrnx/related-posts /-->
|
||||
<!-- wp:chrnx/subscribe-cta {"className":"is-style-quiet"} /-->
|
||||
</main>
|
||||
<!-- /wp:group -->
|
||||
|
||||
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
|
||||
@@ -201,8 +201,8 @@ class BlockRenderingTest extends WP_UnitTestCase {
|
||||
$this->assertStringNotContainsString( '<iframe', $output );
|
||||
}
|
||||
|
||||
/** Topic hero uses a mapped explicit topic and falls back accessibly if art is absent. */
|
||||
public function test_topic_hero_rejects_paths_and_uses_css_fallback_for_missing_art() {
|
||||
/** Topic hero uses approved decorative art for mapped topics and rejects arbitrary paths. */
|
||||
public function test_topic_hero_rejects_paths_and_uses_approved_decorative_art() {
|
||||
$output = render_block(
|
||||
array(
|
||||
'blockName' => 'chrnx/topic-hero',
|
||||
@@ -218,7 +218,12 @@ class BlockRenderingTest extends WP_UnitTestCase {
|
||||
$this->assertStringContainsString( '<h2', $output );
|
||||
$this->assertStringContainsString( 'Research', $output );
|
||||
$this->assertStringContainsString( 'aria-hidden="true"', $output );
|
||||
$this->assertStringNotContainsString( '<img', $output );
|
||||
$this->assertStringContainsString( '<img', $output );
|
||||
$this->assertStringContainsString( 'alt=""', $output );
|
||||
$this->assertStringContainsString( 'width="1122"', $output );
|
||||
$this->assertStringContainsString( 'height="1402"', $output );
|
||||
$this->assertStringContainsString( 'loading="lazy"', $output );
|
||||
$this->assertStringContainsString( 'decoding="async"', $output );
|
||||
|
||||
$unsafe = render_block(
|
||||
array(
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
/**
|
||||
* Tests for editable editorial patterns.
|
||||
*
|
||||
* @package CHRNX
|
||||
*/
|
||||
|
||||
/** Verify pattern metadata, parsing, safety, and approved starter content. */
|
||||
class PatternsTest extends WP_UnitTestCase {
|
||||
/** Required pattern slugs. */
|
||||
const PATTERNS = array(
|
||||
'home-intro',
|
||||
'home-projects',
|
||||
'home-music',
|
||||
'about',
|
||||
'project-detail',
|
||||
'music-landing',
|
||||
'music-release',
|
||||
'podcast-landing',
|
||||
'podcast-show',
|
||||
'podcast-episode',
|
||||
);
|
||||
|
||||
/** Every pattern has valid metadata, parseable content, localization, and no unsafe material. */
|
||||
public function test_all_patterns_are_parseable_localized_and_safe() {
|
||||
foreach ( self::PATTERNS as $name ) {
|
||||
$path = get_theme_file_path( 'patterns/' . $name . '.php' );
|
||||
$this->assertFileExists( $path, $name );
|
||||
$source = file_get_contents( $path ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Local test fixture.
|
||||
$this->assertMatchesRegularExpression( '/^\s*<\?php\s*\/\*\*.*?\*\sTitle:\s*.+$/ms', $source, $name );
|
||||
$this->assertMatchesRegularExpression( '/^\s*\*\sSlug:\s*chrnx\/' . preg_quote( $name, '/' ) . '\s*$/m', $source, $name );
|
||||
$this->assertMatchesRegularExpression( '/^\s*\*\sCategories:\s*\S.+$/m', $source, $name );
|
||||
$this->assertMatchesRegularExpression( '/^\s*\*\sDescription:\s*\S.+$/m', $source, $name );
|
||||
$this->assertMatchesRegularExpression( '/^\s*\*\sInserter:\s*(?:yes|no)\s*$/m', $source, $name );
|
||||
if ( preg_match( '/(?:__|_e)\s*\(/', $source ) ) {
|
||||
$this->assertStringContainsString( "'chrnx'", $source, $name );
|
||||
}
|
||||
|
||||
$content = $this->render_pattern( $path );
|
||||
$blocks = parse_blocks( $content );
|
||||
$this->assertNotEmpty( $blocks, $name );
|
||||
$this->assertSame( trim( $content ), trim( serialize_blocks( $blocks ) ), $name );
|
||||
foreach ( $blocks as $parsed_block ) {
|
||||
if ( null === $parsed_block['blockName'] ) {
|
||||
$this->assertSame( '', trim( $parsed_block['innerHTML'] ), $name . ' has non-block content' );
|
||||
}
|
||||
}
|
||||
$this->assertStringContainsString( '<!-- wp:', $content, $name );
|
||||
$this->assertStringNotContainsString( '<?php', $content, $name );
|
||||
$this->assertDoesNotMatchRegularExpression( '/\b(?:TODO|lorem|example\.com)\b/i', $source . $content, $name );
|
||||
$this->assertDoesNotMatchRegularExpression( '#(?:/Users/|/home/|\bSuno\b|\bstems?\b|voice model|draft lyrics?|prompt directory)#i', $source . $content, $name );
|
||||
$this->assertDoesNotMatchRegularExpression( '#<(?:script|iframe|audio|form)\b|\[/?[a-z][^\]]*\]#i', $content, $name );
|
||||
$this->assertDoesNotMatchRegularExpression( '/(?:Spotify|Apple Music|YouTube Music|Bandcamp)/i', $content, $name );
|
||||
$this->assertDoesNotMatchRegularExpression( '/(?:Silicon Ranch|mailto:)/i', $content, $name );
|
||||
$this->assertDoesNotMatchRegularExpression( '/<p[^>]*>[^<]*(?:add|enter|insert|replace|select|choose|TODO)[^<]*<\/p>/i', $content, $name );
|
||||
}
|
||||
}
|
||||
|
||||
/** Local art is generated through escaped theme URIs with intrinsic dimensions. */
|
||||
public function test_art_patterns_use_only_escaped_local_theme_images() {
|
||||
foreach ( array( 'home-music', 'music-landing', 'podcast-landing' ) as $name ) {
|
||||
$source = file_get_contents( get_theme_file_path( 'patterns/' . $name . '.php' ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Local test fixture.
|
||||
$content = $this->render_pattern( get_theme_file_path( 'patterns/' . $name . '.php' ) );
|
||||
$this->assertStringContainsString( 'get_theme_file_uri(', $source, $name );
|
||||
$this->assertStringContainsString( 'esc_url(', $source, $name );
|
||||
$this->assertMatchesRegularExpression( '/<img\b[^>]*\bwidth="1122"[^>]*\bheight="1402"/i', $content, $name );
|
||||
$this->assertMatchesRegularExpression( '/<img\b[^>]*\bloading="lazy"[^>]*\bdecoding="async"/i', $content, $name );
|
||||
}
|
||||
}
|
||||
|
||||
/** Music copy contains only the exact approved public facts and release statuses. */
|
||||
public function test_music_patterns_use_approved_honest_copy() {
|
||||
$content = $this->render_pattern( get_theme_file_path( 'patterns/music-landing.php' ) );
|
||||
foreach ( array(
|
||||
'Grunge mexicano para cerebros que no se callan.',
|
||||
'grunge en español mexicano desde Sinaloa',
|
||||
'estudio crudo, cero live',
|
||||
'El Hermoso Caos que habita en mi cabeza',
|
||||
'13-track debut album',
|
||||
'Ando Bien Arriba',
|
||||
'six-track bright mirrored EP',
|
||||
'Aquí se Rompió una Jerga',
|
||||
'six-track dark mirrored EP',
|
||||
'draft/in production',
|
||||
'generative AI',
|
||||
'Chrnx',
|
||||
) as $copy ) {
|
||||
$this->assertStringContainsString( $copy, wp_strip_all_tags( $content ), $copy );
|
||||
}
|
||||
$this->assertDoesNotMatchRegularExpression( '/concert|rehearsal|coming live|tour/i', $content );
|
||||
}
|
||||
|
||||
/** About copy is dignified, bounded, and contains the one approved external link. */
|
||||
public function test_about_pattern_uses_approved_profile_copy_and_link() {
|
||||
$source = file_get_contents( get_theme_file_path( 'patterns/about.php' ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Local test fixture.
|
||||
$content = $this->render_pattern( get_theme_file_path( 'patterns/about.php' ) );
|
||||
foreach ( array( 'autistic Level 1', 'independent researcher', 'software developer', 'emotion modeling', 'game AI', 'Lead Developer @Expressive Tea', 'JavaScript', 'Python', 'open source', 'amateur data science', 'father of three wonderful children', 'musician', 'gamer', 'pet-friendly' ) as $copy ) {
|
||||
$this->assertStringContainsString( $copy, wp_strip_all_tags( $content ), $copy );
|
||||
}
|
||||
$this->assertStringContainsString( 'https://arxiv.org/abs/2603.05352', $content );
|
||||
$this->assertStringContainsString( 'esc_url(', $source );
|
||||
$this->assertStringContainsString( 'target="_blank"', $content );
|
||||
$this->assertStringContainsString( 'rel="noopener noreferrer external"', $content );
|
||||
$this->assertDoesNotMatchRegularExpression( '/diagnos|inspir|overcame|despite/i', $content );
|
||||
}
|
||||
|
||||
/** Reusable project/release/show/episode structures do not invent visible starter data. */
|
||||
public function test_structural_patterns_expose_named_editable_regions_without_fake_claims() {
|
||||
$expectations = array(
|
||||
'project-detail' => array( 'chrnx/project-status', 'chrnx/project-summary', 'chrnx/project-links', 'chrnx/project-technologies', 'chrnx/project-publications', 'chrnx/project-related-posts' ),
|
||||
'music-release' => array( 'chrnx/release-title', 'chrnx/release-status', 'chrnx/release-summary', 'chrnx/release-artwork', 'chrnx/release-tracklist' ),
|
||||
'podcast-show' => array( 'chrnx/show-cover', 'chrnx/show-description', 'chrnx/show-hosts', 'chrnx/show-latest-episode', 'chrnx/show-archive', 'chrnx/show-listening-destinations' ),
|
||||
'podcast-episode' => array( 'chrnx/episode-show', 'chrnx/episode-number', 'chrnx/episode-duration', 'chrnx/episode-participants', 'chrnx/episode-canonical-url', 'chrnx/episode-embed', 'chrnx/episode-show-notes' ),
|
||||
);
|
||||
foreach ( $expectations as $name => $labels ) {
|
||||
$content = $this->render_pattern( get_theme_file_path( 'patterns/' . $name . '.php' ) );
|
||||
foreach ( $labels as $label ) {
|
||||
$this->assertStringContainsString( '"metadata":{"name":"' . $label . '"}', $content, $name . ':' . $label );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Render a pattern file exactly as WordPress does. */
|
||||
private function render_pattern( $path ) {
|
||||
ob_start();
|
||||
include $path;
|
||||
return (string) ob_get_clean();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
import test from 'node:test';
|
||||
|
||||
const templates = [ 'home', 'single', 'page', 'archive', 'search', '404' ];
|
||||
const readTemplate = (name) => readFile(new URL(`../../templates/${name}.html`, import.meta.url), 'utf8');
|
||||
|
||||
function assertBalancedBlockMarkup(markup, name) {
|
||||
const stack = [];
|
||||
for (const match of markup.matchAll(/<!--\s+(\/?)wp:([a-z0-9-]+(?:\/[a-z0-9-]+)?)(?:\s+\{.*?\})?\s*(\/?)-->/gs)) {
|
||||
const [, closing, blockName, selfClosing] = match;
|
||||
if (selfClosing) continue;
|
||||
if (!closing) {
|
||||
stack.push(blockName);
|
||||
continue;
|
||||
}
|
||||
assert.equal(stack.pop(), blockName, `${name} must close ${blockName} in order`);
|
||||
}
|
||||
assert.deepEqual(stack, [], `${name} must close every WordPress block`);
|
||||
}
|
||||
|
||||
for (const name of templates) {
|
||||
test(`${name}.html is a complete portable page template`, async () => {
|
||||
const markup = await readTemplate(name);
|
||||
|
||||
assertBalancedBlockMarkup(markup, name);
|
||||
assert.equal((markup.match(/wp:template-part \{"slug":"header","tagName":"header"\}/g) ?? []).length, 1);
|
||||
assert.equal((markup.match(/wp:template-part \{"slug":"footer","tagName":"footer"\}/g) ?? []).length, 1);
|
||||
assert.equal((markup.match(/<main\b/g) ?? []).length, 1);
|
||||
assert.equal((markup.match(/<\/main>/g) ?? []).length, 1);
|
||||
assert.match(markup, /<main\b[^>]*\bid="chrnx-main"[^>]*>/);
|
||||
assert.doesNotMatch(markup, /wp:(?:legacy-widget|widget-group)|<aside\b|sidebar/i);
|
||||
assert.doesNotMatch(markup, /<\?php|https?:\/\//i);
|
||||
});
|
||||
}
|
||||
|
||||
test('home composes editorial sections in the approved order', async () => {
|
||||
const markup = await readTemplate('home');
|
||||
const orderedMarkers = [
|
||||
'"slug":"header"',
|
||||
'wp:pattern {"slug":"chrnx/home-intro"}',
|
||||
'wp:chrnx/featured-stories',
|
||||
'wp:chrnx/journal-stream',
|
||||
'wp:pattern {"slug":"chrnx/home-projects"}',
|
||||
'wp:pattern {"slug":"chrnx/home-music"}',
|
||||
'wp:chrnx/latest-podcast',
|
||||
'chrnx-home-about-preview',
|
||||
'wp:chrnx/subscribe-cta',
|
||||
'"slug":"footer"',
|
||||
];
|
||||
let previous = -1;
|
||||
for (const marker of orderedMarkers) {
|
||||
const index = markup.indexOf(marker);
|
||||
assert.ok(index > previous, `${marker} must appear in the approved home order`);
|
||||
previous = index;
|
||||
}
|
||||
});
|
||||
|
||||
test('single provides readable content, neutral metadata, and post-only components', async () => {
|
||||
const markup = await readTemplate('single');
|
||||
assert.match(markup, /chrnx-entry--single/);
|
||||
assert.match(markup, /wp:post-title/);
|
||||
assert.match(markup, /wp:post-terms \{"term":"chrnx_topic"/);
|
||||
assert.match(markup, /wp:post-terms \{"term":"chrnx_language"/);
|
||||
assert.match(markup, /wp:post-date/);
|
||||
assert.match(markup, /wp:post-featured-image/);
|
||||
assert.match(markup, /wp:post-content/);
|
||||
assert.match(markup, /wp:chrnx\/podcast-meta/);
|
||||
assert.match(markup, /wp:chrnx\/related-posts/);
|
||||
assert.match(markup, /wp:chrnx\/subscribe-cta/);
|
||||
});
|
||||
|
||||
test('page remains a readable title and content shell without post metadata', async () => {
|
||||
const markup = await readTemplate('page');
|
||||
assert.match(markup, /chrnx-entry--page/);
|
||||
assert.match(markup, /wp:post-title/);
|
||||
assert.match(markup, /wp:post-content/);
|
||||
assert.doesNotMatch(markup, /wp:post-(?:date|terms|featured-image)|wp:chrnx\/(?:podcast-meta|related-posts)/);
|
||||
});
|
||||
|
||||
test('archive offers context, safe filters, stream, and a useful empty state', async () => {
|
||||
const markup = await readTemplate('archive');
|
||||
assert.match(markup, /wp:query-title/);
|
||||
assert.match(markup, /wp:term-description/);
|
||||
assert.match(markup, /wp:chrnx\/topic-hero/);
|
||||
assert.match(markup, /wp:chrnx\/journal-stream/);
|
||||
});
|
||||
|
||||
test('search offers search context, filters, and a Journal recovery path', async () => {
|
||||
const markup = await readTemplate('search');
|
||||
assert.match(markup, /wp:query-title \{"type":"search"/);
|
||||
assert.match(markup, /wp:search/);
|
||||
assert.match(markup, /wp:chrnx\/journal-stream/);
|
||||
assert.match(markup, /wp:home-link/);
|
||||
assert.doesNotMatch(markup, /"url":"\//);
|
||||
});
|
||||
|
||||
test('404 offers concise recovery with search, Journal, and home links', async () => {
|
||||
const markup = await readTemplate('404');
|
||||
assert.match(markup, /Page not found/);
|
||||
assert.match(markup, /wp:search/);
|
||||
assert.match(markup, /wp:home-link/);
|
||||
assert.doesNotMatch(markup, /"url":"\//);
|
||||
});
|
||||
Reference in new issue
Block a user