Compare commits

..
34 Commits
Author SHA1 Message Date
chrnx 76917decd0 feat(editorial): widen sections and add local track pages
Unify the editorial canvas across section pages, keep release tracks out of Journal, and give each song a listening surface with audio, metadata, platform links, sharing, and optional featured art. Document and seed the local The No Names fixture without changing production data.
2026-08-27 20:24:39 -05:00
chrnx 135b462bd2 docs: define local music release card redesign 2026-08-27 14:26:52 -05:00
chrnxandClaude Opus 5 5c5f385bc0 Merge branch 'feature/projects-as-entities'
Projects become their own editorial taxonomy, modelled on releases and shows:
term meta for repository, package, site, status and cover; a list block and an
archive header block; archive templates for projects and podcast shows; a
landing pattern; and the retirement of the featured-project picker.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 16:25:09 -05:00
chrnxandClaude Opus 5 7b3298070d chore: release 0.4.5
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 16:25:09 -05:00
chrnxandClaude Opus 5 a28d4cbec0 test: describe the projects section as it is after the retirement
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 16:19:25 -05:00
chrnxandClaude Opus 5 6f418f1a51 fix: fall back to placeholder art when a cover attachment is gone
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 15:34:37 -05:00
chrnxandClaude Opus 5 77dc2ee33b refactor: drop the featured-project picker in favour of the project list
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:58:19 -05:00
chrnxandClaude Opus 5 7c0eb51dcc docs: the version bump is what makes a new pattern register
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:53:38 -05:00
chrnxandClaude Opus 5 1c076ffe2f feat: give projects a landing of their own
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:52:14 -05:00
chrnxandClaude Opus 5 2e43e89795 test: guard taxonomy archive templates' key blocks by content
Only the generic structural loop test covered
taxonomy-chrnx_{project,show,release}.html; nothing asserted their
block content, so the journal-stream regression fixed last round
would have gone uncaught if it recurred. Add content tests for the
project and show templates mirroring the existing archive/search idiom.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:42:26 -05:00
chrnxandClaude Opus 5 d0b928eba4 docs: name the real retirement surface, including four live assertions
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:40:16 -05:00
chrnxandClaude Opus 5 0e6a40223e fix: restore episode listing on show archives
taxonomy-chrnx_show.html replaced the generic archive fallback (which
listed episodes via journal-stream) with show-links alone, which
renders nothing for shows without platform-link meta. Add
journal-stream and subscribe-cta back so show archives keep listing
their episodes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:38:42 -05:00
chrnxandClaude Opus 5 c2f6ba7752 docs: a dedicated template must not render less than the fallback it replaces
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:37:24 -05:00
chrnxandClaude Opus 5 847f399886 fix: correct hardcoded generated-image counts after Task 3 regression
Task 3 raised assets/images/generated/ from 76 to 81 files and updated
build-responsive-images.sh's count guard, but missed four other
hardcoded 76/62/14 references in the smoke suite and README.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:33:32 -05:00
chrnxandClaude Opus 5 9860e69728 feat: give project and show archives their own templates
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:30:09 -05:00
chrnxandClaude Opus 5 1fda796812 docs: task 7 must style the detail block too, not only the card
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:25:33 -05:00
chrnxandClaude Opus 5 1e9e5cb07d fix: stop accepting chrnx_project as a journal query param
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:25:04 -05:00
chrnxandClaude Opus 5 7b69f2e519 docs: keep projects out of the journal request-parameter list
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:24:44 -05:00
chrnxandClaude Opus 5 aea2c6754b feat: give each project its own page header and post stream
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:19:58 -05:00
chrnxandClaude Opus 5 51532118bc docs: drop an attribute the project detail render never reads
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:17:55 -05:00
chrnxandClaude Opus 5 77b7e8f658 test: cover project link rendering in project-list block
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:16:49 -05:00
chrnxandClaude Opus 5 cf3d4e0729 docs: a project archive must filter the journal, not clone a tracklist
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:15:20 -05:00
chrnxandClaude Opus 5 54e3e8ccc0 feat: list every project with its status and links
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:12:38 -05:00
chrnxandClaude Opus 5 873842b2a0 feat: add shared placeholder art for projects without a cover
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:08:52 -05:00
chrnxandClaude Opus 5 69c57ea73c docs: block directories need explicit registration, not just files
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:07:58 -05:00
chrnxandClaude Opus 5 6fc35bafd8 docs: widen task 8 to the full retired-feature surface
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:06:05 -05:00
chrnxandClaude Opus 5 062c3951fa feat: give projects a repository, package and status
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:04:03 -05:00
chrnxandClaude Opus 5 7895e4e927 docs: correct the project link markup call and resolve two open questions
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 14:01:43 -05:00
chrnxandClaude Opus 5 036f9eeb3c feat: model projects as their own editorial taxonomy
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 13:59:37 -05:00
chrnxandClaude Opus 5 5e1fcf0315 docs: design and plan projects as first-class entities
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-15 13:55:37 -05:00
chrnxandClaude Opus 5 9fed24c09a Merge branch 'fix/document-language'
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 19:06:02 -05:00
chrnxandClaude Opus 5 32dc1c3e86 chore: release 0.4.4
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 19:05:58 -05:00
chrnxandClaude Opus 5 0a90e78783 fix: declare the language each post is actually written in
Half the journal is Spanish, but every route declared en-US, so screen
readers pronounced Spanish posts with English phonetics and crawlers
indexed them as English. The chrnx_language taxonomy already recorded the
answer per post and nothing read it.

Map its terms onto the html lang attribute for single posts and for the
language archives, replacing only the language so dir and any plugin
attribute survive. Posts with no language term keep the site default.

Also stop advertising a comments feed. Comments are unsupported theme-wide,
yet the head still linked one, because feed_links_extra also fires for old
posts carrying a non-zero comment_count. The core filter covers both that
and the site-wide link while leaving topic, author and search feeds alone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 19:05:55 -05:00
chrnxandClaude Opus 5 a4c68e3c56 chore: run the local environment on WordPress 7.0.4
Production upgraded to 7.0.4, so the development and test containers now
match it instead of trailing on 6.9.6. The full suite passes unchanged
against the new core, and the pinned assertion moves with it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-14 19:05:48 -05:00
81 changed files with 2864 additions and 497 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"$schema": "https://schemas.wp.org/trunk/wp-env.json", "$schema": "https://schemas.wp.org/trunk/wp-env.json",
"core": "https://wordpress.org/wordpress-6.9.6.zip", "core": "https://wordpress.org/wordpress-7.0.4.zip",
"phpVersion": "8.3", "phpVersion": "8.3",
"autoPort": false, "autoPort": false,
"port": 8888, "port": 8888,
+16 -2
View File
@@ -66,6 +66,17 @@ discard the pre-fixture snapshot. Run `restore` explicitly to reinstate the
captured option values and owned Subscribe status byte-for-byte and remove the captured option values and owned Subscribe status byte-for-byte and remove the
snapshot. Fixture pages/posts remain local and reusable. snapshot. Fixture pages/posts remain local and reusable.
For the local The No Names Music review, mount the source tree from
`/Users/chrnx/projects/suno` and load the four releases, covers, lyrics, and
local-only placeholder platform URLs:
```sh
./scripts/seed-the-no-names-local.sh
```
The placeholder Suno, Spotify, and Apple Music links are intentionally fake and
must be removed or replaced before any production migration.
Rebuild the responsive portrait derivatives on macOS with `sips`, `cwebp`, and Rebuild the responsive portrait derivatives on macOS with `sips`, `cwebp`, and
`avifenc`: `avifenc`:
@@ -83,7 +94,7 @@ responsive_output=$(mktemp -d "${TMPDIR:-/tmp}/chrnx-responsive.XXXXXX")
The rebuild rejects symlinks, nested paths, nonexistent paths, and destinations The rebuild rejects symlinks, nested paths, nonexistent paths, and destinations
outside the canonical system temporary directory. The automated smoke test outside the canonical system temporary directory. The automated smoke test
byte-compares all 76 generated files: 62 binary derivatives and 14 manifests. byte-compares all 81 generated files: 66 binary derivatives and 15 manifests.
The inventory has eleven portrait families at 384 px and 768 px, plus three The inventory has eleven portrait families at 384 px and 768 px, plus three
landscape background families (Podcast, About, and Projects) at 384 px, 768 px, landscape background families (Podcast, About, and Projects) at 384 px, 768 px,
and 1536 px. Every 384/768 derivative is and 1536 px. Every 384/768 derivative is
@@ -107,7 +118,10 @@ isolated from the root environment:
```json ```json
{ {
"port": 8908, "port": 8908,
"testsPort": 8909 "testsPort": 8909,
"mappings": {
"wp-content/suno-source": "/Users/chrnx/projects/suno/bands/the-no-names"
}
} }
``` ```
+265 -55
View File
@@ -263,11 +263,16 @@ footer a {
margin-top: 2rem; margin-top: 2rem;
} }
.chrnx-home .chrnx-featured-stories__grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chrnx-featured-story, .chrnx-featured-story,
.chrnx-journal-card, .chrnx-journal-card,
.chrnx-podcast-card, .chrnx-podcast-card,
.chrnx-related-card, .chrnx-related-card,
.chrnx-release-card { .chrnx-release-card,
.chrnx-project-card {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
border: 1px solid var(--chrnx-line); border: 1px solid var(--chrnx-line);
@@ -342,7 +347,9 @@ footer a {
.chrnx-podcast-card__link > .chrnx-responsive-portrait, .chrnx-podcast-card__link > .chrnx-responsive-portrait,
.chrnx-related-card__link > .chrnx-responsive-portrait, .chrnx-related-card__link > .chrnx-responsive-portrait,
.chrnx-release-card__art > .chrnx-responsive-portrait, .chrnx-release-card__art > .chrnx-responsive-portrait,
.chrnx-release-detail__art > .chrnx-responsive-portrait { .chrnx-release-detail__art > .chrnx-responsive-portrait,
.chrnx-project-card__art > .chrnx-responsive-portrait,
.chrnx-project-detail__art > .chrnx-responsive-portrait {
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
@@ -496,6 +503,22 @@ footer a {
margin: 0; margin: 0;
} }
/* WordPress constrained layouts cap direct children at content-size by
* default. */
.chrnx-archive > .chrnx-journal-stream,
.chrnx-entry--page:has(.chrnx-journal-stream) > .chrnx-journal-stream,
.chrnx-entry--page:has(.chrnx-journal-stream) > .entry-content > .chrnx-journal-stream {
width: 100%;
max-width: none;
margin-inline: 0 !important;
}
.chrnx-entry--page > .entry-content.wp-block-post-content {
width: 100%;
max-width: none !important;
margin-inline: 0 !important;
}
.chrnx-journal-stream__list > li { .chrnx-journal-stream__list > li {
min-width: 0; min-width: 0;
} }
@@ -538,40 +561,6 @@ footer a {
position: relative; position: relative;
} }
.chrnx-selected-work__list {
display: grid;
gap: 0;
grid-template-columns: 1fr;
margin: 0;
padding: 0;
border-top: 1px solid var(--chrnx-line);
list-style: none;
}
.chrnx-selected-work__item {
padding-block: 1.25rem;
border-bottom: 1px solid var(--chrnx-line);
}
.chrnx-selected-work__title {
margin: 0;
overflow-wrap: anywhere;
}
.chrnx-selected-work__title a {
color: inherit;
text-decoration: none;
}
.chrnx-selected-work__title a:hover {
text-decoration: underline;
}
.chrnx-selected-work__empty {
margin: 0;
color: var(--chrnx-muted);
}
.chrnx-responsive-portrait { .chrnx-responsive-portrait {
display: block; display: block;
} }
@@ -745,9 +734,23 @@ html[data-theme="light"] .chrnx-home-music p {
.chrnx-archive, .chrnx-archive,
.chrnx-search, .chrnx-search,
.chrnx-not-found { .chrnx-not-found {
width: min(calc(100vw - 2rem), 1200px);
max-width: none;
margin-inline: auto;
padding-block: clamp(3.5rem, 7vw, 7rem); padding-block: clamp(3.5rem, 7vw, 7rem);
} }
/* The block layout adds its content-size cap with !important on direct
* children. */
.wp-site-blocks > .chrnx-entry,
.wp-site-blocks > .chrnx-archive,
.wp-site-blocks > .chrnx-search,
.wp-site-blocks > .chrnx-not-found {
width: min(calc(100vw - 2rem), 1200px);
max-width: 1200px !important;
margin-inline: auto !important;
}
.chrnx-entry > h1, .chrnx-entry > h1,
.chrnx-archive > h1, .chrnx-archive > h1,
.chrnx-search > h1, .chrnx-search > h1,
@@ -876,14 +879,30 @@ html[data-theme="light"] .chrnx-home-music p {
pointer-events: none; pointer-events: none;
} }
.chrnx-release-list { .chrnx-release-list,
.chrnx-project-list {
display: grid; display: grid;
gap: 1rem; gap: 1rem;
grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-columns: repeat(3, minmax(0, 1fr));
} }
.chrnx-entry--page > .entry-content > .chrnx-project-list,
.chrnx-archive > .chrnx-project-list {
width: 100%;
max-width: none;
margin-inline: 0 !important;
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chrnx-entry--page > .entry-content > .chrnx-about {
width: 100%;
max-width: none;
margin-inline: 0 !important;
}
/* Grunge release cards: torn light, heavy rule, dirt in the corners. */ /* Grunge release cards: torn light, heavy rule, dirt in the corners. */
.chrnx-release-card { .chrnx-release-card,
.chrnx-project-card {
position: relative; position: relative;
isolation: isolate; isolation: isolate;
overflow: hidden; overflow: hidden;
@@ -899,7 +918,8 @@ html[data-theme="light"] .chrnx-home-music p {
transition: transform 160ms ease, border-color 160ms ease; transition: transform 160ms ease, border-color 160ms ease;
} }
.chrnx-release-card::after { .chrnx-release-card::after,
.chrnx-project-card::after {
position: absolute; position: absolute;
z-index: -1; z-index: -1;
inset: 0; inset: 0;
@@ -909,18 +929,21 @@ html[data-theme="light"] .chrnx-home-music p {
pointer-events: none; pointer-events: none;
} }
.chrnx-release-card:hover { .chrnx-release-card:hover,
.chrnx-project-card:hover {
border-top-color: var(--chrnx-green); border-top-color: var(--chrnx-green);
transform: translateY(-3px); transform: translateY(-3px);
} }
.chrnx-release-card__link { .chrnx-release-card__link,
.chrnx-project-card__link {
display: block; display: block;
color: inherit; color: inherit;
text-decoration: none; text-decoration: none;
} }
.chrnx-release-card__art { .chrnx-release-card__art,
.chrnx-project-card__art {
display: block; display: block;
overflow: hidden; overflow: hidden;
margin-bottom: 1rem; margin-bottom: 1rem;
@@ -930,7 +953,9 @@ html[data-theme="light"] .chrnx-home-music p {
} }
.chrnx-release-card__cover, .chrnx-release-card__cover,
.chrnx-release-card__fallback { .chrnx-release-card__fallback,
.chrnx-project-card__cover,
.chrnx-project-card__fallback {
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
@@ -938,7 +963,9 @@ html[data-theme="light"] .chrnx-home-music p {
} }
.chrnx-release-card__fallback, .chrnx-release-card__fallback,
.chrnx-release-detail__fallback { .chrnx-release-detail__fallback,
.chrnx-project-card__fallback,
.chrnx-project-detail__fallback {
background-color: var(--chrnx-surface); background-color: var(--chrnx-surface);
background-image: background-image:
linear-gradient(132deg, transparent 0 46%, color-mix(in srgb, var(--chrnx-accent) 42%, transparent) 47% 50%, transparent 51%), linear-gradient(132deg, transparent 0 46%, color-mix(in srgb, var(--chrnx-accent) 42%, transparent) 47% 50%, transparent 51%),
@@ -946,17 +973,21 @@ html[data-theme="light"] .chrnx-home-music p {
radial-gradient(circle at 70% 28%, color-mix(in srgb, var(--chrnx-accent) 34%, transparent), transparent 52%); radial-gradient(circle at 70% 28%, color-mix(in srgb, var(--chrnx-accent) 34%, transparent), transparent 52%);
} }
.chrnx-release-card__title { .chrnx-release-card__title,
.chrnx-project-card__title {
margin: 0 0 0.4rem; margin: 0 0 0.4rem;
text-wrap: balance; text-wrap: balance;
} }
.chrnx-release-card__link:hover .chrnx-release-card__title { .chrnx-release-card__link:hover .chrnx-release-card__title,
.chrnx-project-card__link:hover .chrnx-project-card__title {
color: var(--chrnx-green); color: var(--chrnx-green);
} }
.chrnx-release-card__status, .chrnx-release-card__status,
.chrnx-release-detail__status { .chrnx-release-detail__status,
.chrnx-project-card__status,
.chrnx-project-detail__status {
margin: 0; margin: 0;
color: var(--chrnx-muted); color: var(--chrnx-muted);
font-family: var(--wp--preset--font-family--metadata); font-family: var(--wp--preset--font-family--metadata);
@@ -991,8 +1022,131 @@ html[data-theme="light"] .chrnx-home-music p {
color: var(--chrnx-text); color: var(--chrnx-text);
} }
/* Music release cards use the available page width. */
.chrnx-music-landing > .chrnx-release-list {
width: min(100%, 1200px);
max-width: 1200px;
margin-inline: auto;
grid-template-columns: 1fr;
}
.chrnx-music-landing {
position: relative;
width: min(calc(100vw - 2rem), 1200px);
max-width: none;
left: 50%;
margin-inline: 0;
transform: translateX(-50%);
}
.chrnx-music-landing .chrnx-character-stage,
.chrnx-music-landing .chrnx-music-note {
width: 100%;
max-width: none;
}
.chrnx-music-landing .chrnx-release-card__main {
display: grid;
grid-template-columns: minmax(0, min(32%, 22rem)) minmax(0, 1fr);
gap: clamp(1.25rem, 3vw, 2.5rem);
align-items: start;
}
.chrnx-music-landing .chrnx-release-card__art {
margin: 0;
}
.chrnx-music-landing .chrnx-release-card__content {
min-width: 0;
padding-block: 0.35rem;
}
.chrnx-release-card__title-link {
color: inherit;
text-decoration: none;
}
.chrnx-release-card__title-link:hover .chrnx-release-card__title,
.chrnx-release-card__title-link:focus-visible .chrnx-release-card__title {
color: var(--chrnx-green);
}
.chrnx-music-landing .chrnx-release-card__title {
font-size: clamp(1.65rem, 1.2rem + 1.4vw, 2.5rem);
}
.chrnx-platform-links__label {
font-family: var(--wp--preset--font-family--metadata);
font-size: var(--wp--preset--font-size--small);
}
.chrnx-release-card__description {
margin-block: 1rem;
border-block: 1px solid var(--chrnx-line);
}
.chrnx-release-card__description summary {
padding: 0.85rem 0;
color: var(--chrnx-green);
cursor: pointer;
font-family: var(--wp--preset--font-family--metadata);
letter-spacing: 0.04em;
}
.chrnx-release-card__description summary:focus-visible {
outline: 2px solid var(--chrnx-green);
outline-offset: 4px;
}
.chrnx-release-card__description p {
max-width: 70ch;
margin: 0 0 1rem;
color: var(--chrnx-muted);
}
.chrnx-release-card__tracks {
display: grid;
gap: 0.45rem;
margin: 0;
padding: 0;
list-style: none;
}
.chrnx-release-card__tracks li {
display: flex;
gap: 0.75rem;
min-width: 0;
font-family: var(--wp--preset--font-family--metadata);
}
.chrnx-release-card__tracks li > span {
color: var(--chrnx-green);
}
.chrnx-release-card__tracks a,
.chrnx-release-card__lyrics {
color: inherit;
text-decoration: none;
}
.chrnx-release-card__tracks a:hover,
.chrnx-release-card__tracks a:focus-visible,
.chrnx-release-card__lyrics:hover,
.chrnx-release-card__lyrics:focus-visible {
color: var(--chrnx-green);
text-decoration: underline;
}
.chrnx-release-card__lyrics {
display: inline-block;
margin-top: 1rem;
color: var(--chrnx-accent);
font-family: var(--wp--preset--font-family--metadata);
}
/* Album page. */ /* Album page. */
.chrnx-release-detail__head { .chrnx-release-detail__head,
.chrnx-project-detail__head {
display: grid; display: grid;
gap: clamp(1.5rem, 4vw, 3rem); gap: clamp(1.5rem, 4vw, 3rem);
grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
@@ -1000,11 +1154,13 @@ html[data-theme="light"] .chrnx-home-music p {
margin-bottom: clamp(2rem, 5vw, 3.5rem); margin-bottom: clamp(2rem, 5vw, 3.5rem);
} }
.chrnx-release-detail__head.is-bare { .chrnx-release-detail__head.is-bare,
.chrnx-project-detail__head.is-bare {
grid-template-columns: minmax(0, 22rem); grid-template-columns: minmax(0, 22rem);
} }
.chrnx-release-detail__art { .chrnx-release-detail__art,
.chrnx-project-detail__art {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
border: 1px solid color-mix(in srgb, var(--chrnx-accent) 34%, var(--chrnx-line)); border: 1px solid color-mix(in srgb, var(--chrnx-accent) 34%, var(--chrnx-line));
@@ -1014,14 +1170,22 @@ html[data-theme="light"] .chrnx-home-music p {
} }
.chrnx-release-detail__cover, .chrnx-release-detail__cover,
.chrnx-release-detail__fallback { .chrnx-release-detail__fallback,
.chrnx-project-detail__cover,
.chrnx-project-detail__fallback {
display: block; display: block;
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
} }
.chrnx-release-detail__description { .chrnx-release-detail__intro,
.chrnx-project-detail__intro {
min-width: 0;
}
.chrnx-release-detail__description,
.chrnx-project-detail__description {
margin: 0.75rem 0 0; margin: 0.75rem 0 0;
color: var(--chrnx-text); color: var(--chrnx-text);
} }
@@ -1134,6 +1298,7 @@ html[data-theme="light"] .chrnx-home-music p {
@media (max-width: 720px) { @media (max-width: 720px) {
.chrnx-release-detail__head, .chrnx-release-detail__head,
.chrnx-project-detail__head,
.chrnx-track-meta { .chrnx-track-meta {
grid-template-columns: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
} }
@@ -1215,7 +1380,14 @@ html[data-theme="light"] .chrnx-home-music p {
@media (max-width: 900px) { @media (max-width: 900px) {
.chrnx-journal-stream__list, .chrnx-journal-stream__list,
.chrnx-release-list { .chrnx-home .chrnx-featured-stories__grid,
.chrnx-release-list,
.chrnx-project-list {
grid-template-columns: 1fr;
}
.chrnx-entry--page > .entry-content > .chrnx-project-list,
.chrnx-archive > .chrnx-project-list {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
@@ -1632,9 +1804,12 @@ html[data-theme="light"] .chrnx-music-landing .chrnx-character-stage {
} }
.chrnx-podcast-landing { .chrnx-podcast-landing {
width: min(calc(100vw - 2rem), var(--wp--style--global--wide-size)); position: relative;
max-width: none; max-width: none;
margin-inline: calc((100% - min(calc(100vw - 2rem), var(--wp--style--global--wide-size))) / 2); left: 50%;
width: min(calc(100vw - 2rem), 1200px);
margin-inline: 0;
transform: translateX(-50%);
} }
.chrnx-entry--page:has(.chrnx-music-landing) > .wp-block-post-title, .chrnx-entry--page:has(.chrnx-music-landing) > .wp-block-post-title,
@@ -1642,6 +1817,37 @@ html[data-theme="light"] .chrnx-music-landing .chrnx-character-stage {
text-align: center; text-align: center;
} }
.chrnx-podcast-landing .chrnx-character-stage,
.chrnx-podcast-landing > .wp-block-chrnx-latest-podcast {
width: 100%;
max-width: none;
}
.chrnx-track-meta__description {
grid-column: 1 / -1;
max-width: 70ch;
margin: 0;
color: var(--chrnx-muted);
}
.chrnx-track-meta__share {
justify-self: start;
min-height: 2.5rem;
padding-inline: 0.9rem;
border: 1px solid color-mix(in srgb, var(--chrnx-accent) 45%, var(--chrnx-line));
border-radius: 0.35rem;
background: transparent;
color: inherit;
font: inherit;
cursor: pointer;
}
.chrnx-track-meta__share:hover,
.chrnx-track-meta__share:focus-visible {
background: color-mix(in srgb, var(--chrnx-accent) 18%, transparent);
color: var(--chrnx-text);
}
/* Landscape backdrops sit behind everything and stay quiet under the copy. */ /* Landscape backdrops sit behind everything and stay quiet under the copy. */
.chrnx-character-stage__atmosphere > .chrnx-responsive-atmosphere { .chrnx-character-stage__atmosphere > .chrnx-responsive-atmosphere {
position: absolute; position: absolute;
@@ -1755,6 +1961,10 @@ html[data-theme="light"] .chrnx-music-landing .chrnx-character-stage {
@media (max-width: 780px) { @media (max-width: 780px) {
.chrnx-music-landing .chrnx-release-card__main {
grid-template-columns: 1fr;
}
.chrnx-topic-hero { .chrnx-topic-hero {
min-height: 0; min-height: 0;
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@@ -0,0 +1,5 @@
{
"source": "placeholder-project.png",
"formats": [ "avif", "webp" ],
"widths": [ 384, 768 ]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

-111
View File
@@ -1,111 +0,0 @@
( function ( factory ) {
if ( typeof module === 'object' && module.exports ) {
module.exports = factory();
} else {
factory().initialize( window.wp );
}
} )( function () {
'use strict';
function getTranslator( wp ) {
return wp.i18n && typeof wp.i18n.__ === 'function'
? wp.i18n.__
: function ( text ) {
return text;
};
}
function updateMeta( editPost, currentMeta, key, value ) {
if ( typeof editPost !== 'function' ) {
return;
}
editPost( { meta: { ...( currentMeta || {} ), [ key ]: value } } );
}
function hasRequiredGlobals( wp ) {
return Boolean(
wp &&
wp.components &&
wp.components.ToggleControl &&
wp.data &&
typeof wp.data.useDispatch === 'function' &&
typeof wp.data.useSelect === 'function' &&
wp.editPost &&
wp.editPost.PluginDocumentSettingPanel &&
wp.element &&
typeof wp.element.createElement === 'function' &&
wp.plugins &&
typeof wp.plugins.registerPlugin === 'function',
);
}
function initialize( wp ) {
if ( ! hasRequiredGlobals( wp ) ) {
return false;
}
const __ = getTranslator( wp );
function ProjectPanel() {
const editorState = wp.data.useSelect( function ( select ) {
if ( typeof select !== 'function' ) {
return null;
}
const currentEditor = select( 'core/editor' );
const core = select( 'core' );
if (
! currentEditor ||
typeof currentEditor.getCurrentPostType !== 'function' ||
typeof currentEditor.getEditedPostAttribute !== 'function' ||
! core ||
typeof core.getEntityRecord !== 'function'
) {
return null;
}
const topicIds = currentEditor.getEditedPostAttribute( 'topic' );
return {
meta: currentEditor.getEditedPostAttribute( 'meta' ) || {},
postType: currentEditor.getCurrentPostType(),
topic:
Array.isArray( topicIds ) && topicIds.length === 1
? core.getEntityRecord( 'taxonomy', 'chrnx_topic', topicIds[ 0 ] )
: null,
};
}, [] );
const editorDispatch = wp.data.useDispatch( 'core/editor' );
if ( ! editorState || editorState.postType !== 'post' || ! editorDispatch?.editPost ) {
return null;
}
if ( ! editorState.topic || editorState.topic.slug !== 'projects' ) {
return null;
}
const meta = editorState.meta;
return wp.element.createElement(
wp.editPost.PluginDocumentSettingPanel,
{ name: 'chrnx-project', title: __( 'Project', 'chrnx' ) },
wp.element.createElement( wp.components.ToggleControl, {
label: __( 'Show in Selected work', 'chrnx' ),
help: __(
'Selected work lists these first, then fills the rest with the most recent projects.',
'chrnx',
),
checked: Boolean( meta.chrnx_project_featured ),
onChange( value ) {
updateMeta( editorDispatch.editPost, meta, 'chrnx_project_featured', Boolean( value ) );
},
} ),
);
}
wp.plugins.registerPlugin( 'chrnx-project-meta', { render: ProjectPanel } );
return true;
}
return { initialize, updateMeta };
} );
+7
View File
@@ -104,6 +104,13 @@
return el( return el(
wp.editPost.PluginDocumentSettingPanel, wp.editPost.PluginDocumentSettingPanel,
{ name: 'chrnx-track', title: __( 'Track', 'chrnx' ) }, { name: 'chrnx-track', title: __( 'Track', 'chrnx' ) },
el( wp.components.TextareaControl, {
label: __( 'Track description', 'chrnx' ),
value: meta.chrnx_track_description || '',
onChange( value ) {
setMeta( 'chrnx_track_description', value );
},
} ),
el( wp.components.TextControl, { el( wp.components.TextControl, {
label: __( 'Track number', 'chrnx' ), label: __( 'Track number', 'chrnx' ),
type: 'number', type: 'number',
+32
View File
@@ -0,0 +1,32 @@
( function () {
'use strict';
document.addEventListener( 'click', function ( event ) {
const button = event.target.closest( '[data-chrnx-share]' );
if ( ! button ) {
return;
}
const title = button.dataset.shareTitle || document.title;
const url = button.dataset.shareUrl || window.location.href;
const done = function () {
const original = button.dataset.originalLabel || button.textContent;
button.dataset.originalLabel = original;
button.textContent = 'Enlace copiado';
window.setTimeout( function () {
button.textContent = original;
}, 1800 );
};
if ( navigator.share ) {
navigator.share( { title, url } ).catch( function () {} );
return;
}
if ( navigator.clipboard && navigator.clipboard.writeText ) {
navigator.clipboard
.writeText( url )
.then( done )
.catch( function () {} );
}
} );
} )();
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/featured-stories", "name": "chrnx/featured-stories",
"version": "0.4.3", "version": "0.4.5",
"title": "Featured Stories", "title": "Featured Stories",
"category": "theme", "category": "theme",
"description": "A sticky-led selection of topic-diverse stories.", "description": "A sticky-led selection of topic-diverse stories.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/footer-content", "name": "chrnx/footer-content",
"version": "0.4.3", "version": "0.4.5",
"title": "CHRNX Footer Content", "title": "CHRNX Footer Content",
"category": "theme", "category": "theme",
"description": "Display translated internal footer navigation and site credit.", "description": "Display translated internal footer navigation and site credit.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/header-tools", "name": "chrnx/header-tools",
"version": "0.4.3", "version": "0.4.5",
"title": "CHRNX Header Tools", "title": "CHRNX Header Tools",
"category": "theme", "category": "theme",
"description": "Display translated primary navigation and progressive site search.", "description": "Display translated primary navigation and progressive site search.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/journal-link", "name": "chrnx/journal-link",
"version": "0.4.3", "version": "0.4.5",
"title": "Journal Link", "title": "Journal Link",
"category": "theme", "category": "theme",
"description": "Display a translated portable link to the full Journal.", "description": "Display a translated portable link to the full Journal.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/journal-stream", "name": "chrnx/journal-stream",
"version": "0.4.3", "version": "0.4.5",
"title": "Journal Stream", "title": "Journal Stream",
"category": "theme", "category": "theme",
"description": "The filterable chronological journal.", "description": "The filterable chronological journal.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/latest-podcast", "name": "chrnx/latest-podcast",
"version": "0.4.3", "version": "0.4.5",
"title": "Latest Podcast", "title": "Latest Podcast",
"category": "theme", "category": "theme",
"description": "A linked card for the latest podcast episode.", "description": "A linked card for the latest podcast episode.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/mobile-menu-toggle", "name": "chrnx/mobile-menu-toggle",
"version": "0.4.3", "version": "0.4.5",
"title": "CHRNX Mobile Menu Toggle", "title": "CHRNX Mobile Menu Toggle",
"category": "theme", "category": "theme",
"description": "Progressively reveal the primary navigation on small screens.", "description": "Progressively reveal the primary navigation on small screens.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/podcast-meta", "name": "chrnx/podcast-meta",
"version": "0.4.3", "version": "0.4.5",
"title": "Podcast Metadata", "title": "Podcast Metadata",
"category": "theme", "category": "theme",
"description": "Safe episode details for the current post.", "description": "Safe episode details for the current post.",
+13
View File
@@ -0,0 +1,13 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/project-detail",
"version": "0.4.5",
"title": "Project Detail",
"category": "theme",
"description": "Cover, status, description and links for the queried project.",
"textdomain": "chrnx",
"attributes": {},
"supports": { "html": false },
"render": "file:./render.php"
}
+40
View File
@@ -0,0 +1,40 @@
<?php
/**
* Project Detail block render.
*
* @package CHRNX
*/
$chrnx_term = get_queried_object();
if ( ! $chrnx_term instanceof WP_Term || 'chrnx_project' !== $chrnx_term->taxonomy ) {
return;
}
$chrnx_status = (string) get_term_meta( $chrnx_term->term_id, 'chrnx_project_status', true );
$chrnx_cover = absint( get_term_meta( $chrnx_term->term_id, 'chrnx_project_cover', true ) );
$chrnx_links = chrnx_get_project_links( $chrnx_term->term_id );
$chrnx_cover_markup = $chrnx_cover > 0 ? wp_get_attachment_image( $chrnx_cover, 'large', false, array( 'class' => 'chrnx-project-detail__cover' ) ) : '';
// Without status, description or links there is no second column to fill.
$chrnx_has_intro = '' !== $chrnx_status || '' !== $chrnx_term->description || ! empty( $chrnx_links );
$chrnx_head_class = 'chrnx-project-detail__head' . ( $chrnx_has_intro ? '' : ' is-bare' );
?>
<section <?php echo get_block_wrapper_attributes( array( 'class' => 'chrnx-project-detail' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="<?php echo esc_attr( $chrnx_head_class ); ?>">
<div class="chrnx-project-detail__art">
<?php if ( '' !== $chrnx_cover_markup ) : ?>
<?php echo $chrnx_cover_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?>
<?php echo chrnx_get_topic_portrait_markup( 'placeholder-project', '', 'chrnx-project-detail__fallback' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?>
<?php endif; ?>
</div>
<div class="chrnx-project-detail__intro">
<?php if ( '' !== $chrnx_status ) : ?>
<p class="chrnx-project-detail__status"><?php echo esc_html( $chrnx_status ); ?></p>
<?php endif; ?>
<?php if ( '' !== $chrnx_term->description ) : ?>
<p class="chrnx-project-detail__description"><?php echo esc_html( $chrnx_term->description ); ?></p>
<?php endif; ?>
<?php echo chrnx_get_platform_links_markup( $chrnx_links, 'chrnx-platform-links', chrnx_get_project_link_slots() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
</div>
</section>
+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/project-list",
"version": "0.4.5",
"title": "Project List",
"category": "theme",
"description": "Every project, each linking to its own page.",
"textdomain": "chrnx",
"attributes": {
"headingLevel": { "type": "integer", "default": 4, "enum": [2, 3, 4, 5, 6] }
},
"supports": { "html": false },
"render": "file:./render.php"
}
+51
View File
@@ -0,0 +1,51 @@
<?php
/**
* Project List block render.
*
* @package CHRNX
*/
$chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 4, 4 );
$chrnx_terms = get_terms(
array(
'taxonomy' => 'chrnx_project',
'hide_empty' => false,
)
);
if ( is_wp_error( $chrnx_terms ) || empty( $chrnx_terms ) ) {
return;
}
?>
<div <?php echo get_block_wrapper_attributes( array( 'class' => 'chrnx-project-list' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php
foreach ( $chrnx_terms as $chrnx_term ) :
$chrnx_link = get_term_link( $chrnx_term );
$chrnx_status = (string) get_term_meta( $chrnx_term->term_id, 'chrnx_project_status', true );
$chrnx_cover = absint( get_term_meta( $chrnx_term->term_id, 'chrnx_project_cover', true ) );
$chrnx_links = chrnx_get_project_links( $chrnx_term->term_id );
?>
<article class="chrnx-project-card">
<?php if ( ! is_wp_error( $chrnx_link ) ) : ?>
<a class="chrnx-project-card__link" href="<?php echo esc_url( $chrnx_link ); ?>">
<?php endif; ?>
<span class="chrnx-project-card__art">
<?php
$chrnx_cover_markup = $chrnx_cover > 0 ? wp_get_attachment_image( $chrnx_cover, 'chrnx-card', false, array( 'class' => 'chrnx-project-card__cover' ) ) : '';
?>
<?php if ( '' !== $chrnx_cover_markup ) : ?>
<?php echo $chrnx_cover_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?>
<?php echo chrnx_get_topic_portrait_markup( 'placeholder-project', '', 'chrnx-project-card__fallback' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?>
<?php endif; ?>
</span>
<h<?php echo esc_attr( $chrnx_heading ); ?> class="chrnx-project-card__title"><?php echo esc_html( $chrnx_term->name ); ?></h<?php echo esc_attr( $chrnx_heading ); ?>>
<?php if ( '' !== $chrnx_status ) : ?>
<p class="chrnx-project-card__status"><?php echo esc_html( $chrnx_status ); ?></p>
<?php endif; ?>
<?php if ( ! is_wp_error( $chrnx_link ) ) : ?>
</a>
<?php endif; ?>
<?php echo chrnx_get_platform_links_markup( $chrnx_links, 'chrnx-platform-links', chrnx_get_project_link_slots() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</article>
<?php endforeach; ?>
</div>
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/reading-time", "name": "chrnx/reading-time",
"version": "0.4.3", "version": "0.4.5",
"title": "Reading Time", "title": "Reading Time",
"category": "theme", "category": "theme",
"description": "Display a localized estimate based on the current post content.", "description": "Display a localized estimate based on the current post content.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/related-posts", "name": "chrnx/related-posts",
"version": "0.4.3", "version": "0.4.5",
"title": "Related Posts", "title": "Related Posts",
"category": "theme", "category": "theme",
"description": "Related stories selected by topic, tags, and recency.", "description": "Related stories selected by topic, tags, and recency.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/release-detail", "name": "chrnx/release-detail",
"version": "0.4.3", "version": "0.4.5",
"title": "Release Detail", "title": "Release Detail",
"category": "theme", "category": "theme",
"description": "Album cover, listening links, and the ordered tracklist.", "description": "Album cover, listening links, and the ordered tracklist.",
+9 -8
View File
@@ -10,12 +10,13 @@ if ( ! $chrnx_term instanceof WP_Term || 'chrnx_release' !== $chrnx_term->taxono
return; return;
} }
$chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 2, 2 ); $chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 2, 2 );
$chrnx_status = (string) get_term_meta( $chrnx_term->term_id, 'chrnx_release_status', true ); $chrnx_status = (string) get_term_meta( $chrnx_term->term_id, 'chrnx_release_status', true );
$chrnx_cover = absint( get_term_meta( $chrnx_term->term_id, 'chrnx_release_cover', true ) ); $chrnx_cover = absint( get_term_meta( $chrnx_term->term_id, 'chrnx_release_cover', true ) );
$chrnx_links = chrnx_get_release_links( $chrnx_term->term_id ); $chrnx_links = chrnx_get_release_links( $chrnx_term->term_id );
$chrnx_tracks = chrnx_get_release_track_ids( $chrnx_term->slug ); $chrnx_cover_markup = $chrnx_cover > 0 ? wp_get_attachment_image( $chrnx_cover, 'large', false, array( 'class' => 'chrnx-release-detail__cover' ) ) : '';
$chrnx_track_h = min( 6, $chrnx_heading + 1 ); $chrnx_tracks = chrnx_get_release_track_ids( $chrnx_term->slug );
$chrnx_track_h = min( 6, $chrnx_heading + 1 );
// Without status, description or links there is no second column to fill. // Without status, description or links there is no second column to fill.
$chrnx_has_intro = '' !== $chrnx_status || '' !== $chrnx_term->description || ! empty( $chrnx_links ); $chrnx_has_intro = '' !== $chrnx_status || '' !== $chrnx_term->description || ! empty( $chrnx_links );
$chrnx_head_class = 'chrnx-release-detail__head' . ( $chrnx_has_intro ? '' : ' is-bare' ); $chrnx_head_class = 'chrnx-release-detail__head' . ( $chrnx_has_intro ? '' : ' is-bare' );
@@ -23,8 +24,8 @@ $chrnx_head_class = 'chrnx-release-detail__head' . ( $chrnx_has_intro ? '' : ' i
<section <?php echo get_block_wrapper_attributes( array( 'class' => 'chrnx-release-detail' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> <section <?php echo get_block_wrapper_attributes( array( 'class' => 'chrnx-release-detail' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="<?php echo esc_attr( $chrnx_head_class ); ?>"> <div class="<?php echo esc_attr( $chrnx_head_class ); ?>">
<div class="chrnx-release-detail__art"> <div class="chrnx-release-detail__art">
<?php if ( $chrnx_cover > 0 ) : ?> <?php if ( '' !== $chrnx_cover_markup ) : ?>
<?php echo wp_get_attachment_image( $chrnx_cover, 'large', false, array( 'class' => 'chrnx-release-detail__cover' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php echo $chrnx_cover_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?> <?php else : ?>
<?php echo chrnx_get_topic_portrait_markup( 'placeholder-release', '', 'chrnx-release-detail__fallback' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?> <?php echo chrnx_get_topic_portrait_markup( 'placeholder-release', '', 'chrnx-release-detail__fallback' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?>
<?php endif; ?> <?php endif; ?>
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/release-list", "name": "chrnx/release-list",
"version": "0.4.3", "version": "0.4.5",
"title": "Release List", "title": "Release List",
"category": "theme", "category": "theme",
"description": "The No Names releases, each linking to its album page.", "description": "The No Names releases, each linking to its album page.",
+46 -17
View File
@@ -5,13 +5,15 @@
* @package CHRNX * @package CHRNX
*/ */
$chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 4, 4 ); $chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 4, 4 );
$chrnx_terms = get_terms( $chrnx_release_order = array( 'el-hermoso-caos', 'ando-bien-arriba', 'aqui-se-rompio-una-jerga', 'side-b' );
array( $chrnx_terms = array();
'taxonomy' => 'chrnx_release', foreach ( $chrnx_release_order as $chrnx_release_slug ) {
'hide_empty' => false, $chrnx_release_term = get_term_by( 'slug', $chrnx_release_slug, 'chrnx_release' );
) if ( $chrnx_release_term instanceof WP_Term ) {
); $chrnx_terms[] = $chrnx_release_term;
}
}
if ( is_wp_error( $chrnx_terms ) || empty( $chrnx_terms ) ) { if ( is_wp_error( $chrnx_terms ) || empty( $chrnx_terms ) ) {
return; return;
} }
@@ -25,24 +27,51 @@ if ( is_wp_error( $chrnx_terms ) || empty( $chrnx_terms ) ) {
$chrnx_links = chrnx_get_release_links( $chrnx_term->term_id ); $chrnx_links = chrnx_get_release_links( $chrnx_term->term_id );
?> ?>
<article class="chrnx-release-card"> <article class="chrnx-release-card">
<?php if ( ! is_wp_error( $chrnx_link ) ) : ?> <div class="chrnx-release-card__main">
<a class="chrnx-release-card__link" href="<?php echo esc_url( $chrnx_link ); ?>">
<?php endif; ?>
<span class="chrnx-release-card__art"> <span class="chrnx-release-card__art">
<?php if ( $chrnx_cover > 0 ) : ?> <?php
<?php echo wp_get_attachment_image( $chrnx_cover, 'chrnx-card', false, array( 'class' => 'chrnx-release-card__cover' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> $chrnx_cover_markup = $chrnx_cover > 0 ? wp_get_attachment_image( $chrnx_cover, 'chrnx-card', false, array( 'class' => 'chrnx-release-card__cover' ) ) : '';
?>
<?php if ( '' !== $chrnx_cover_markup ) : ?>
<?php echo $chrnx_cover_markup; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?> <?php else : ?>
<?php echo chrnx_get_topic_portrait_markup( 'placeholder-release', '', 'chrnx-release-card__fallback' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?> <?php echo chrnx_get_topic_portrait_markup( 'placeholder-release', '', 'chrnx-release-card__fallback' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?>
<?php endif; ?> <?php endif; ?>
</span> </span>
<h<?php echo esc_attr( $chrnx_heading ); ?> class="chrnx-release-card__title"><?php echo esc_html( $chrnx_term->name ); ?></h<?php echo esc_attr( $chrnx_heading ); ?>> <div class="chrnx-release-card__content">
<?php if ( ! is_wp_error( $chrnx_link ) ) : ?>
<a class="chrnx-release-card__title-link" href="<?php echo esc_url( $chrnx_link ); ?>">
<?php endif; ?>
<h<?php echo esc_attr( $chrnx_heading ); ?> class="chrnx-release-card__title"><?php echo esc_html( $chrnx_term->name ); ?></h<?php echo esc_attr( $chrnx_heading ); ?>>
<?php
if ( ! is_wp_error( $chrnx_link ) ) :
?>
</a><?php endif; ?>
<?php if ( '' !== $chrnx_status ) : ?> <?php if ( '' !== $chrnx_status ) : ?>
<p class="chrnx-release-card__status"><?php echo esc_html( $chrnx_status ); ?></p> <p class="chrnx-release-card__status"><?php echo esc_html( $chrnx_status ); ?></p>
<?php endif; ?> <?php endif; ?>
<?php if ( ! is_wp_error( $chrnx_link ) ) : ?> <?php echo chrnx_get_platform_links_markup( $chrnx_links, 'chrnx-platform-links' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</a> <details class="chrnx-release-card__description">
<?php endif; ?> <summary><?php echo esc_html__( 'Sobre el disco', 'chrnx' ); ?></summary>
<?php echo chrnx_get_platform_links_markup( $chrnx_links, 'chrnx-platform-links' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php if ( '' !== trim( $chrnx_term->description ) ) : ?>
<p><?php echo esc_html( $chrnx_term->description ); ?></p>
<?php else : ?>
<p><?php echo esc_html__( 'Descripción pendiente.', 'chrnx' ); ?></p>
<?php endif; ?>
</details>
<?php $chrnx_preview_tracks = chrnx_get_release_track_ids( $chrnx_term->slug, 3 ); ?>
<?php if ( ! empty( $chrnx_preview_tracks ) ) : ?>
<ol class="chrnx-release-card__tracks">
<?php foreach ( $chrnx_preview_tracks as $chrnx_track_index => $chrnx_track_id ) : ?>
<li><span><?php echo esc_html( str_pad( (string) ( $chrnx_track_index + 1 ), 2, '0', STR_PAD_LEFT ) ); ?></span><a href="<?php echo esc_url( get_permalink( $chrnx_track_id ) ); ?>"><?php echo esc_html( get_the_title( $chrnx_track_id ) ); ?></a></li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
<?php if ( ! is_wp_error( $chrnx_link ) ) : ?>
<a class="chrnx-release-card__lyrics" href="<?php echo esc_url( $chrnx_link ); ?>"><?php echo esc_html__( 'Ver letras', 'chrnx' ); ?> <span aria-hidden="true">↗</span></a>
<?php endif; ?>
</div>
</div>
</article> </article>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
-16
View File
@@ -1,16 +0,0 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/selected-work",
"version": "0.4.3",
"title": "Selected Work",
"category": "theme",
"description": "Hand-picked projects first, then the most recent ones.",
"textdomain": "chrnx",
"attributes": {
"limit": { "type": "integer", "default": 3, "minimum": 1, "maximum": 12 },
"headingLevel": { "type": "integer", "default": 3, "enum": [2, 3, 4, 5, 6] }
},
"supports": { "html": false },
"render": "file:./render.php"
}
-26
View File
@@ -1,26 +0,0 @@
<?php
/**
* Selected Work block render.
*
* @package CHRNX
*/
$chrnx_limit = isset( $attributes['limit'] ) ? min( 12, max( 1, absint( $attributes['limit'] ) ) ) : 3;
$chrnx_heading = chrnx_get_heading_level( $attributes['headingLevel'] ?? 3, 3 );
$chrnx_ids = chrnx_get_selected_project_ids( $chrnx_limit );
?>
<div <?php echo get_block_wrapper_attributes( array( 'class' => 'chrnx-selected-work' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<?php if ( empty( $chrnx_ids ) ) : ?>
<p class="chrnx-selected-work__empty"><?php echo esc_html__( 'No projects published yet.', 'chrnx' ); ?></p>
<?php else : ?>
<ul class="chrnx-selected-work__list">
<?php foreach ( $chrnx_ids as $chrnx_project_id ) : ?>
<li class="chrnx-selected-work__item">
<h<?php echo esc_attr( $chrnx_heading ); ?> class="chrnx-selected-work__title">
<a href="<?php echo esc_url( get_permalink( $chrnx_project_id ) ); ?>"><?php echo esc_html( get_the_title( $chrnx_project_id ) ); ?></a>
</h<?php echo esc_attr( $chrnx_heading ); ?>>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
</div>
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/show-links", "name": "chrnx/show-links",
"version": "0.4.3", "version": "0.4.5",
"title": "Show Links", "title": "Show Links",
"category": "theme", "category": "theme",
"description": "Where a podcast show can be listened to, rendered only when a URL exists.", "description": "Where a podcast show can be listened to, rendered only when a URL exists.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/site-brand", "name": "chrnx/site-brand",
"version": "0.4.3", "version": "0.4.5",
"title": "CHRNX Site Brand", "title": "CHRNX Site Brand",
"category": "theme", "category": "theme",
"description": "Display the local CHRNX wordmark linked to the site home.", "description": "Display the local CHRNX wordmark linked to the site home.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/subscribe-cta", "name": "chrnx/subscribe-cta",
"version": "0.4.3", "version": "0.4.5",
"title": "Subscribe CTA", "title": "Subscribe CTA",
"category": "theme", "category": "theme",
"description": "A call to action linked to the configured subscribe page.", "description": "A call to action linked to the configured subscribe page.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/subscribe-form", "name": "chrnx/subscribe-form",
"version": "0.4.3", "version": "0.4.5",
"title": "Subscribe Form", "title": "Subscribe Form",
"category": "theme", "category": "theme",
"description": "The email subscription form, rendered only when a provider endpoint is configured.", "description": "The email subscription form, rendered only when a provider endpoint is configured.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/theme-toggle", "name": "chrnx/theme-toggle",
"version": "0.4.3", "version": "0.4.5",
"title": "Theme Toggle", "title": "Theme Toggle",
"category": "theme", "category": "theme",
"description": "Choose a light, dark, or system color theme.", "description": "Choose a light, dark, or system color theme.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/topic-hero", "name": "chrnx/topic-hero",
"version": "0.4.3", "version": "0.4.5",
"title": "Topic Hero", "title": "Topic Hero",
"category": "theme", "category": "theme",
"description": "A fixed-art hero for an editorial topic.", "description": "A fixed-art hero for an editorial topic.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json", "$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3, "apiVersion": 3,
"name": "chrnx/track-meta", "name": "chrnx/track-meta",
"version": "0.4.3", "version": "0.4.5",
"title": "Track Meta", "title": "Track Meta",
"category": "theme", "category": "theme",
"description": "Player, listening links, and album for one song.", "description": "Player, listening links, and album for one song.",
+9 -4
View File
@@ -10,10 +10,11 @@ if ( ! chrnx_is_eligible_editorial_post( $chrnx_post_id ) ) {
return; return;
} }
$chrnx_release = chrnx_get_track_release( $chrnx_post_id ); $chrnx_release = chrnx_get_track_release( $chrnx_post_id );
$chrnx_player = chrnx_get_track_player_markup( $chrnx_post_id ); $chrnx_player = chrnx_get_track_player_markup( $chrnx_post_id );
$chrnx_links = chrnx_get_track_links( $chrnx_post_id ); $chrnx_links = chrnx_get_track_links( $chrnx_post_id );
$chrnx_number = absint( get_post_meta( $chrnx_post_id, 'chrnx_track_number', true ) ); $chrnx_number = absint( get_post_meta( $chrnx_post_id, 'chrnx_track_number', true ) );
$chrnx_description = (string) get_post_meta( $chrnx_post_id, 'chrnx_track_description', true );
// Nothing invented: without any track data this block stays silent. // Nothing invented: without any track data this block stays silent.
if ( null === $chrnx_release && '' === $chrnx_player && empty( $chrnx_links ) ) { if ( null === $chrnx_release && '' === $chrnx_player && empty( $chrnx_links ) ) {
@@ -42,5 +43,9 @@ $chrnx_release_link = null !== $chrnx_release ? get_term_link( $chrnx_release )
</p> </p>
<?php endif; ?> <?php endif; ?>
<?php echo chrnx_get_platform_links_markup( $chrnx_links, 'chrnx-platform-links' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> <?php echo chrnx_get_platform_links_markup( $chrnx_links, 'chrnx-platform-links' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php if ( '' !== trim( $chrnx_description ) ) : ?>
<p class="chrnx-track-meta__description"><?php echo esc_html( $chrnx_description ); ?></p>
<?php endif; ?>
<button class="chrnx-track-meta__share" type="button" data-chrnx-share data-share-title="<?php echo esc_attr( get_the_title( $chrnx_post_id ) ); ?>" data-share-url="<?php echo esc_url( get_permalink( $chrnx_post_id ) ); ?>"><?php echo esc_html__( 'Compartir', 'chrnx' ); ?></button>
</div> </div>
</section> </section>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,65 @@
# Editorial Widths and Track Pages Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Unify editorial widths, keep release tracks out of Journal, and add a complete local-first track page.
**Architecture:** Keep tracks as posts with existing release taxonomy and metadata. Add only the missing description/share/audio fixture behavior, scope the Journal query exclusion to release-assigned posts, and use shared width tokens/classes in the theme CSS.
**Tech Stack:** WordPress block theme, PHP render blocks, native HTML audio/share APIs, CSS, Playwright, PHPUnit.
---
### Task 1: Define track-page metadata and Journal eligibility
**Files:**
- Modify: `inc/track-meta.php`
- Modify: `inc/queries.php`
- Test: `tests/php/PatternsTest.php`
- [ ] Add sanitized `chrnx_track_description` post meta and a helper for release-track detection.
- [ ] Exclude posts assigned to `chrnx_release` from unfiltered Journal queries while preserving explicit release queries.
- [ ] Add regression assertions for direct track eligibility and Journal exclusion.
- [ ] Run PHPUnit and fix failures.
### Task 2: Render the track page controls
**Files:**
- Modify: `blocks/track-meta/render.php`
- Modify: `templates/single.html`
- Modify: `assets/js/track-share.js` (create)
- Modify: `inc/blocks.php`
- Test: `tests/e2e/music-podcast-stages.spec.mjs`
- [ ] Render description, player, release, platform links, and share control in a single track metadata surface.
- [ ] Load the share enhancement progressively; use native share when available and clipboard fallback otherwise.
- [ ] Keep lyrics in the existing post content and preserve non-track single-post behavior.
- [ ] Add browser assertions for player/metadata/share and no Journal leakage.
### Task 3: Make the editorial shell consistently wide
**Files:**
- Modify: `assets/css/components.css`
- Test: `tests/e2e/music-podcast-stages.spec.mjs`
- [ ] Apply the centered 1200px editorial width to Journal, Projects, Podcasts, About, release archives, and track pages.
- [ ] Correct Podcast hero centering and preserve mobile stacking/no overflow.
- [ ] Style the track surface with the existing dark/grunge tokens and readable lyric text.
- [ ] Verify both themes and 375/768/1440px captures.
### Task 4: Populate local audio and metadata
**Files:**
- Modify: `scripts/seed-the-no-names-local.php`
- Modify: `README.md`
- [ ] Import available local MP3s from the mounted Suno source as fixture-owned attachments.
- [ ] Populate track descriptions from song metadata when present and keep fake platform URLs local-only.
- [ ] Document the seed command and production cleanup boundary.
### Task 5: Verify and capture
- [ ] Run `npm run lint:css`, `npm run lint:js`, `npm run test:php`, and the focused E2E suite against port 8908.
- [ ] Run `npm run test:smoke`.
- [ ] Capture Music, Podcasts, Journal, Projects, About, and a track page in dark/light desktop/mobile states.
- [ ] Open the final Music and track screenshots in macOS Preview.
@@ -0,0 +1,69 @@
# Music release cards Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Redesign the local Music release area into wide, expandable The No Names release cards and seed all four local releases from the Suno project.
**Architecture:** Keep the existing dynamic release-list block and taxonomy model. Extend its markup/data boundary for descriptions, track previews, lyrics links, and Side B; use focused CSS for the wider landing layout and responsive card geometry. Add an idempotent local-only seed path rather than coupling production rendering to filesystem paths.
**Tech Stack:** WordPress PHP blocks, CSS, wp-env/Colima, Node smoke and Playwright tests.
---
### Task 1: Lock the local data contract
**Files:**
- Modify: `inc/taxonomies.php`
- Modify: `patterns/music-landing.php`
- Modify: `inc/release-meta.php`
- Modify: `blocks/release-list/render.php`
- Test: `tests/php/PatternsTest.php`
- Test: `tests/smoke/visual-integration.test.mjs`
- [ ] Add Side B as the `side-b` release term after the three existing terms; preserve the existing public slug `el-hermoso-caos` while documenting its longer source-directory mapping.
- [ ] Replace the introductory quote with the approved exact Spanish copy while keeping its existing block position.
- [ ] Extend release list rendering with safe description, status, platform links, track preview, and lyrics destination data.
- [ ] Add semantic disclosure markup and empty-state handling.
- [ ] Add an explicit renderer order array and regression assertions for exactly four releases in order, 13/6/6/19 seeded counts, required release-card structure, and exact quote placement/copy.
- [ ] Run the focused smoke test and confirm it fails before implementation where appropriate.
### Task 2: Implement the release-card presentation
**Files:**
- Modify: `assets/css/components.css`
- Modify: `patterns/music-landing.php`
- Modify: `blocks/release-list/render.php`
- Test: `tests/e2e/music-podcast-stages.spec.mjs`
- Test: `tests/php/BlockRenderingTest.php`
- [ ] Widen only the Music landing content container to a 1200px cap while retaining the existing hero layers and unchanged global 1120px wide size.
- [ ] Build wide release cards with `min(32%, 22rem)` cover width, readable title/status, conditional platform links in Suno/Spotify/Apple order, closed native disclosure, first-three-track preview, per-track links, and release archive lyrics link.
- [ ] Add responsive stacking and keyboard/focus states.
- [ ] Apply grunge texture through existing visual language and restrained metadata treatment, not unreadable body typography.
- [ ] Capture `/music/` with `CHRNX_REVIEW_URL=http://localhost:8908 node scripts/capture-visual-review.mjs` in local light/dark desktop and mobile states.
### Task 3: Seed local The No Names content
**Files:**
- Create: `tests/fixtures/the-no-names-releases.json`
- Modify: `scripts/seed-test-content.php`
- Modify: `scripts/seed-test-content.sh`
- Modify: `README.md`
- Test: `tests/smoke/theme-contract.test.mjs`
- [ ] Add an idempotent `the-no-names` scenario to the existing localhost-guarded seed workflow, reading only `tests/fixtures/the-no-names-releases.json`; include an explicit local generator command that reads the Suno source tree and cannot run against a public host.
- [ ] Include all 13 main-album directories, six tracks from each EP, and 19 Side B tracks; ignore alternate `song-*.md` files.
- [ ] Import source covers into the local media library with `_chrnx_fixture_key` attachments, `_chrnx_fixture_key` terms/posts, term descriptions/status, and clean only prior The No Names fixture records on rerun/restore; switching to default must preserve unrelated content.
- [ ] Keep absent streaming URLs empty and never infer public links.
- [ ] Document startup, seed, preview, and restore boundaries.
- [ ] Run the seed against the isolated wp-env database.
### Task 4: Verify and hand off
**Files:**
- Modify: relevant tests only if evidence requires it.
- [ ] Run `npm run test:smoke`, `npm run lint:js`, `npm run lint:css`, `npm run phpcs`, `npm run test:php`, and `npx playwright test tests/e2e/music-podcast-stages.spec.mjs`.
- [ ] Start Colima/wp-env on the configured local port and capture the rendered page.
- [ ] Inspect screenshots at 375, 768, and 1440 widths in both themes.
- [ ] Run `git diff --check` and report local-only status; do not publish or touch production.
@@ -0,0 +1,119 @@
# CHRNX Projects as First-Class Entities — Design
<!-- markdownlint-disable MD013 -->
**Status:** Approved 2026-08-15
**Supersedes:** the `projects` topic term as a grouping mechanism
## Problem
`projects` is a topic term, so it cannot separate the thing from the writing about it.
Green Tea is a project with a repository, a published package, and a release status.
The posts about Green Tea are a different kind of object. Today both collapse into one
term, and the term cannot hold a repository URL or a cover.
That collapse already produced an inconsistency. Announcement posts landed in
`projects` while deep dives on the same product landed in `code`:
| Product | Announcement | Deep dive |
|---|---|---|
| Expressive Tea | 692 (`projects`) | 695 (`code`) |
| Ailed | 678 (`projects`) | 716 (`code`) |
| Green Tea | 838 (`projects`) | 730 (`code`) |
A reader browsing Green Tea finds half its material. The split exists only because one
term was doing two jobs.
Music and podcasts already solved this. `chrnx_release` is the album, `chrnx_show` is the
programme, and posts reference them. Projects never got the same treatment.
## Solution
Promote projects to an entity taxonomy modelled on `chrnx_release`, and return `code`
to being a general topic about writing code.
### Content model
New taxonomy `chrnx_project`, registered through the existing
`chrnx_register_editorial_taxonomy` contract with `rest_base` `project`.
Seeded terms: `green-tea` (Green Tea), `ailed` (Ailed).
Term meta, mirroring `chrnx_release`:
| Meta key | Type | Sanitizer | Purpose |
|---|---|---|---|
| `chrnx_project_cover` | integer | `absint` | Attachment ID for the project cover |
| `chrnx_project_status` | string | `sanitize_text_field` | Free text, e.g. `Beta`, `Activo`, `Archivado` |
| `chrnx_project_repo` | string | `chrnx_sanitize_https_url` | Source repository |
| `chrnx_project_site` | string | `chrnx_sanitize_https_url` | Documentation or product site |
| `chrnx_project_package` | string | `chrnx_sanitize_https_url` | Where the package lives |
`chrnx_project_package` is deliberately one generic URL rather than an npm-specific
field. Green Tea publishes to npm, a Rust project would publish to crates.io, a Python
one to PyPI. One URL covers all three; a per-registry field list would need editing
every time a new language shows up.
Cover falls back to shared placeholder art when unset, exactly as
`chrnx_release_cover` falls back to `placeholder-release`.
### Retired
`chrnx_project_featured` (post meta), `chrnx_get_selected_project_ids()`, and the
`chrnx/selected-work` block are removed.
Music proves they are unnecessary. `music-landing` lists every release through
`chrnx/release-list` with no notion of a featured release, and `home-music` carries no
list at all. With two or three projects, picking a favourite is ceremony, not curation.
The `projects` topic term is retired. Posts that carried it move to `code`, and grouping
moves to their project term.
### Surfaces
| Surface | Today | After |
|---|---|---|
| `/projects/` page (740) | `chrnx/home-projects` pattern + `journal-stream {"topic":"projects"}` | `chrnx/projects-landing` pattern |
| Project archive | none | `templates/taxonomy-chrnx_project.html` |
| Home section | `chrnx/selected-work` inside `home-projects` | banner copy only, mirroring `home-music` |
The landing gets a character-stage banner in the established three-layer shape
(atmosphere, content, art), followed by `chrnx/project-list`.
Landing copy, in the author's voice:
> **Proyectos**
> Aquí va lo que mi cerebro tira en formato de código.
> Una noche me agarra la loquera y sale código. A veces sirve, a veces nomás me deja
> dormir. Lo que sobrevive lo dejo aquí, con su repo y su estado real, sin adornos.
### Debt repaid alongside
`chrnx_show` has no `taxonomy-chrnx_show.html` and falls through to the generic archive,
so a podcast programme page never renders its own detail block. Adding
`templates/taxonomy-chrnx_show.html` alongside the project template closes that gap
while the same shape is fresh.
## Migration
Pages store pattern references rather than expanded markup, so theme changes propagate
without touching stored content. Verified on production:
```text
740 /projects/ <!-- wp:pattern {"slug":"chrnx/home-projects"} /-->
<!-- wp:chrnx/journal-stream {"topic":"projects"} /-->
743 /music/ <!-- wp:pattern {"slug":"chrnx/music-landing"} /-->
```
One stored block breaks: `journal-stream {"topic":"projects"}` on page 740, because its
topic disappears. Page 740 becomes a single `chrnx/projects-landing` pattern reference.
Six published posts need project terms assigned and their topic corrected. The exact
post-to-project mapping is supplied by the author, not inferred.
## Non-goals
- No custom post type. Projects are terms, like releases and shows.
- No per-registry package fields.
- No project-level prose page beyond the term description.
- No changes to `chrnx_release`, `chrnx_show`, Related Stories, or theme preference.
@@ -0,0 +1,29 @@
# Editorial Widths and Track Pages Design
## Goal
Make the editorial pages feel like one site-wide system while giving The No
Names tracks a proper listening page instead of treating every song as a
Journal entry.
## Approved behavior
- Journal, Projects, Podcasts, About, release archives, and track pages share a
centered desktop content width of approximately 1200px and responsive side
gutters.
- Podcast hero and its latest-conversation section use the same centered width
without changing the existing visual language.
- Posts assigned to `chrnx_release` are excluded from the general Journal
stream, but remain directly accessible and appear in release tracklists.
- A track page renders its native MP3 player when audio is attached, track
description, release/platform metadata, a share control with copy fallback,
and the existing lyric content.
- Platform URLs and audio attachments are optional; absent data leaves no empty
controls. Local fixtures may use fake URLs and sample MP3s, but production
migration must not copy them.
## Boundaries
The work changes the existing post-based track model rather than introducing a
new post type. No production data or public URLs are changed. The existing
Journal remains the home for non-track editorial posts.
@@ -0,0 +1,29 @@
# Music release cards design
## Goal
Preserve the existing Music landing composition while making its release area wider, more useful, and specific to The No Names.
## Approved design
The Music hero, collage, musician, AI quote area, and visual language remain intact. The introductory quote changes to the exact copy below and remains in the existing quote block, below the hero and above the releases:
> Miren, miren: esto es, virtualmente, lo que la voz de Kurt Cobain le hizo a mi cabeza, pasado por una IA generativa. Si vienes con AI SLOP, déjame decirte que me vale veinte mil hectáreas de verga. La letra, la voz y la producción vienen de una tormenta que vive permanentemente en mi cabeza. Si no te gusta, ahí está la puerta. Yo nomás aviso: no habrá conciertos. Así nomás.
The main content width uses a Music-only 1200px desktop cap (the existing theme wide size remains unchanged elsewhere) and full-width with 1rem gutters on mobile, without changing the hero's layered composition. The `Releases in progress` area renders four independent release cards in this order: public slug `el-hermoso-caos` mapped to source directory `el-hermoso-caos-que-habita-en-mi-cerebro` (13 tracks), `ando-bien-arriba` (6), `aqui-se-rompio-una-jerga` (6), and `side-b` (19 experimental tracks). Each card uses a square cover constrained to `min(32%, 22rem)` on desktop, a title/status/platform-link column, a native `<details><summary>` description disclosure closed by default, the first three ordered tracks (or all available tracks when fewer than three exist), and a `Ver letras` link to `/release/<slug>/`. On mobile the cover stacks above the content. Platform links appear in the fixed order Suno, Spotify, Apple Music, only when a valid HTTPS URL exists; local fixtures leave all three empty.
## Data and local boundary
The local fixture is the named `the-no-names` scenario in `scripts/seed-test-content.sh`, guarded to `localhost`/`127.0.0.1` and reading only the checked-in generated snapshot `tests/fixtures/the-no-names-releases.json`; generation from `/Users/chrnx/projects/suno/bands/the-no-names` is a separate local command and never runs from a public host. The snapshot maps each `disc.md`, each numbered `song.md` (alternate `song-*.md` files are ignored), and approved 1200px cover file to a release record. Side B is an independent `chrnx_release` term. Descriptions come from the first Concept paragraphs; release statuses use the disc `status` value with unknown/empty values rendered as `En proceso`; track posts use the song title and status. Seed-owned terms use `_chrnx_fixture_key`, posts use `_chrnx_fixture_key`, and attachments use `_chrnx_fixture_key`; rerun replaces only those records and `restore` removes only those records. Missing audio and platform URLs remain empty. Production is not contacted or mutated.
## Typography
Keep body and lyric text readable. Use distressed/grunge treatment on release labels, headings, borders, and background texture rather than applying an extreme decorative font to long lyrics. Any font addition must be local or explicitly approved; no runtime third-party font dependency is required for this increment.
## Interaction and accessibility
Descriptions use native `<details><summary>` semantics, closed by default, with keyboard support, visible focus states, and readable contrast. `Ver letras` links to the release archive URL and each visible track title links to its individual post when present. Each external link uses `target="_blank" rel="noopener noreferrer external"` and an accessible platform name. Missing artwork, links, status, and descriptions render gracefully; the release card still renders with its title and track preview.
## Verification
Run `npm run test:smoke`, `npm run lint:js`, `npm run lint:css`, `npm run phpcs`, `npm run test:php`, and `npx playwright test tests/e2e/music-podcast-stages.spec.mjs` against `http://localhost:8908` (the isolated override). Capture `/music/` locally in dark and light themes at 375px, 768px, and 1440px. Acceptance requires exactly four cards in the declared order, seeded counts 13/6/6/19, native disclosures closed by default, valid conditional platform links, lyrics/archive links, no horizontal overflow, and no public-host access from the seed command.
+1 -1
View File
@@ -1,5 +1,5 @@
<?php <?php
define( 'CHRNX_VERSION', '0.4.3' ); define( 'CHRNX_VERSION', '0.4.5' );
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
foreach ( array( 'setup', 'assets', 'taxonomies', 'editor', 'podcast-meta', 'project-meta', 'release-meta', 'show-meta', 'track-meta', 'settings', 'queries', 'media', 'blocks', 'theme-preference' ) as $module ) { foreach ( array( 'setup', 'assets', 'taxonomies', 'editor', 'podcast-meta', 'project-meta', 'release-meta', 'show-meta', 'track-meta', 'settings', 'queries', 'media', 'blocks', 'theme-preference' ) as $module ) {
+9
View File
@@ -27,5 +27,14 @@ function chrnx_enqueue_assets() {
array( 'chrnx-layout' ), array( 'chrnx-layout' ),
CHRNX_VERSION CHRNX_VERSION
); );
if ( is_singular( 'post' ) ) {
wp_enqueue_script(
'chrnx-track-share',
get_theme_file_uri( 'assets/js/track-share.js' ),
array(),
CHRNX_VERSION,
true
);
}
} }
add_action( 'wp_enqueue_scripts', 'chrnx_enqueue_assets' ); add_action( 'wp_enqueue_scripts', 'chrnx_enqueue_assets' );
+2 -2
View File
@@ -29,7 +29,7 @@ function chrnx_get_current_navigation_destination() {
return ''; return '';
} }
if ( is_home() || is_search() || is_singular( 'post' ) || is_tax( array( 'chrnx_topic', 'chrnx_language', 'chrnx_show' ) ) ) { if ( is_home() || is_search() || is_singular( 'post' ) || is_tax( array( 'chrnx_topic', 'chrnx_language', 'chrnx_show', 'chrnx_project' ) ) ) {
return $journal_url; return $journal_url;
} }
@@ -232,7 +232,7 @@ function chrnx_get_editorial_card_markup( $post_id, $heading_level = 3, $class_n
/** Register all block metadata directories that exist. */ /** Register all block metadata directories that exist. */
function chrnx_register_editorial_blocks() { function chrnx_register_editorial_blocks() {
$blocks = array( 'featured-stories', 'journal-stream', 'latest-podcast', 'podcast-meta', 'topic-hero', 'related-posts', 'subscribe-cta', 'theme-toggle', 'site-brand', 'mobile-menu-toggle', 'footer-content', 'header-tools', 'reading-time', 'journal-link', 'selected-work', 'release-list', 'release-detail', 'track-meta', 'subscribe-form', 'show-links' ); $blocks = array( 'featured-stories', 'journal-stream', 'latest-podcast', 'podcast-meta', 'topic-hero', 'related-posts', 'subscribe-cta', 'theme-toggle', 'site-brand', 'mobile-menu-toggle', 'footer-content', 'header-tools', 'reading-time', 'journal-link', 'release-list', 'release-detail', 'track-meta', 'subscribe-form', 'show-links', 'project-list', 'project-detail' );
foreach ( $blocks as $block ) { foreach ( $blocks as $block ) {
$name = 'chrnx/' . $block; $name = 'chrnx/' . $block;
if ( WP_Block_Type_Registry::get_instance()->is_registered( $name ) ) { if ( WP_Block_Type_Registry::get_instance()->is_registered( $name ) ) {
-9
View File
@@ -45,14 +45,6 @@ function chrnx_enqueue_editor_assets() {
true true
); );
wp_enqueue_script(
'chrnx-editor-project',
get_theme_file_uri( 'assets/js/editor-project.js' ),
array( 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins' ),
CHRNX_VERSION,
true
);
wp_enqueue_script( wp_enqueue_script(
'chrnx-editor-track', 'chrnx-editor-track',
get_theme_file_uri( 'assets/js/editor-track.js' ), get_theme_file_uri( 'assets/js/editor-track.js' ),
@@ -63,7 +55,6 @@ function chrnx_enqueue_editor_assets() {
wp_set_script_translations( 'chrnx-editor-taxonomies', 'chrnx', get_theme_file_path( 'languages' ) ); wp_set_script_translations( 'chrnx-editor-taxonomies', 'chrnx', get_theme_file_path( 'languages' ) );
wp_set_script_translations( 'chrnx-editor-podcast', 'chrnx', get_theme_file_path( 'languages' ) ); wp_set_script_translations( 'chrnx-editor-podcast', 'chrnx', get_theme_file_path( 'languages' ) );
wp_set_script_translations( 'chrnx-editor-project', 'chrnx', get_theme_file_path( 'languages' ) );
wp_set_script_translations( 'chrnx-editor-track', 'chrnx', get_theme_file_path( 'languages' ) ); wp_set_script_translations( 'chrnx-editor-track', 'chrnx', get_theme_file_path( 'languages' ) );
} }
add_action( 'enqueue_block_editor_assets', 'chrnx_enqueue_editor_assets' ); add_action( 'enqueue_block_editor_assets', 'chrnx_enqueue_editor_assets' );
+133 -21
View File
@@ -1,37 +1,149 @@
<?php <?php
/** /**
* Project post metadata. * Project term metadata.
* *
* @package CHRNX * @package CHRNX
*/ */
/** /**
* Require permission to edit the post owning project metadata. * Return the outbound link slots a project can carry.
* *
* @param bool $allowed Previously calculated permission. * One generic package slot rather than one field per registry: Green Tea ships
* @param string $meta_key Metadata key. * to npm, a Rust project would ship to crates.io, a Python one to PyPI. A
* @param int $post_id Post ID. * per-registry list would need editing every time a new language shows up.
* @return bool Whether the current user can edit the post. *
* @return array<string,array<string,string>> Slot key to label and icon.
*/ */
function chrnx_auth_project_meta( $allowed, $meta_key, $post_id ) { function chrnx_get_project_link_slots() {
return current_user_can( 'edit_post', $post_id ); return array(
'repo' => array(
'label' => __( 'Repository', 'chrnx' ),
'icon' => '<path d="M9 19c-5 1.5-5-2.5-7-3"/><path d="M15 22v-4a3.4 3.4 0 0 0-1-2.6c3-.3 6-1.5 6-6.6a5 5 0 0 0-1.4-3.5 4.6 4.6 0 0 0-.1-3.5s-1.1-.3-3.5 1.3a12 12 0 0 0-6 0C6.6 1.5 5.5 1.8 5.5 1.8a4.6 4.6 0 0 0-.1 3.5A5 5 0 0 0 4 8.8c0 5.1 3 6.3 6 6.6a3.4 3.4 0 0 0-1 2.6v4"/>',
),
'package' => array(
'label' => __( 'Package', 'chrnx' ),
'icon' => '<path d="m7.5 4.3 9 5.2"/><path d="M21 16V8a2 2 0 0 0-1-1.7l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.7l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16"/><path d="M3.3 7 12 12l8.7-5"/><path d="M12 22V12"/>',
),
'site' => array(
'label' => __( 'Website', 'chrnx' ),
'icon' => '<circle cx="12" cy="12" r="10"/><path d="M12 2a15 15 0 0 1 0 20"/><path d="M12 2a15 15 0 0 0 0 20"/><path d="M2 12h20"/>',
),
);
} }
/** /**
* Register project metadata for posts. * Return the project term meta keys and their sanitizers.
*
* @return array<string,string> Meta key to sanitize callback.
*/
function chrnx_get_project_meta_definitions() {
$definitions = array(
'chrnx_project_cover' => 'absint',
'chrnx_project_status' => 'sanitize_text_field',
);
foreach ( array_keys( chrnx_get_project_link_slots() ) as $slot ) {
$definitions[ 'chrnx_project_' . $slot ] = 'chrnx_sanitize_https_url';
}
return $definitions;
}
/**
* Register project term metadata.
*/ */
function chrnx_register_project_meta() { function chrnx_register_project_meta() {
register_post_meta( foreach ( chrnx_get_project_meta_definitions() as $meta_key => $sanitize ) {
'post', register_term_meta(
'chrnx_project_featured', 'chrnx_project',
array( $meta_key,
'type' => 'boolean', array(
'single' => true, 'type' => 'chrnx_project_cover' === $meta_key ? 'integer' : 'string',
'default' => false, 'single' => true,
'show_in_rest' => array( 'schema' => array( 'type' => 'boolean' ) ), 'show_in_rest' => true,
'sanitize_callback' => 'rest_sanitize_boolean', 'sanitize_callback' => $sanitize,
'auth_callback' => 'chrnx_auth_project_meta', 'auth_callback' => 'chrnx_auth_release_meta',
) )
); );
}
} }
add_action( 'init', 'chrnx_register_project_meta' ); add_action( 'init', 'chrnx_register_project_meta' );
/**
* Return the stored outbound links for one project.
*
* @param int $term_id Project term ID.
* @return array<string,string> Slot key to URL, omitting empty ones.
*/
function chrnx_get_project_links( $term_id ) {
$links = array();
foreach ( array_keys( chrnx_get_project_link_slots() ) as $slot ) {
$url = chrnx_sanitize_https_url( get_term_meta( $term_id, 'chrnx_project_' . $slot, true ) );
if ( '' !== $url ) {
$links[ $slot ] = $url;
}
}
return $links;
}
/**
* Render the project metadata fields on the term edit screen.
*
* @param WP_Term $term Project term.
*/
function chrnx_render_project_edit_fields( $term ) {
chrnx_print_release_field(
'chrnx_project_status',
__( 'Status', 'chrnx' ),
(string) get_term_meta( $term->term_id, 'chrnx_project_status', true ),
'text',
__( 'Short and honest, for example Beta, Activo or Archivado.', 'chrnx' )
);
foreach ( chrnx_get_project_link_slots() as $slot => $definition ) {
chrnx_print_release_field(
'chrnx_project_' . $slot,
$definition['label'],
(string) get_term_meta( $term->term_id, 'chrnx_project_' . $slot, true ),
'url',
__( 'HTTPS only. Leave empty to hide this icon.', 'chrnx' )
);
}
chrnx_print_release_field(
'chrnx_project_cover',
__( 'Cover attachment ID', 'chrnx' ),
(string) absint( get_term_meta( $term->term_id, 'chrnx_project_cover', true ) ),
'text',
__( 'Leave empty to use the shared placeholder art.', 'chrnx' )
);
}
add_action( 'chrnx_project_edit_form_fields', 'chrnx_render_project_edit_fields' );
/**
* Persist project term metadata from the term edit screen.
*
* @param int $term_id Project term ID.
*/
function chrnx_save_project_meta( $term_id ) {
if ( ! chrnx_auth_release_meta() ) {
return;
}
// Core supplies and verifies the add/update term nonce on these screens.
$nonce = isset( $_POST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ) : '';
if ( ! wp_verify_nonce( $nonce, 'update-tag_' . $term_id ) && ! wp_verify_nonce( $nonce, 'add-tag' ) ) {
return;
}
foreach ( chrnx_get_project_meta_definitions() as $meta_key => $sanitize ) {
if ( ! isset( $_POST[ $meta_key ] ) ) {
continue;
}
$value = call_user_func( $sanitize, wp_unslash( $_POST[ $meta_key ] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Sanitized by the mapped callback.
if ( '' === $value || 0 === $value ) {
delete_term_meta( $term_id, $meta_key );
continue;
}
update_term_meta( $term_id, $meta_key, $value );
}
}
add_action( 'edited_chrnx_project', 'chrnx_save_project_meta' );
add_action( 'created_chrnx_project', 'chrnx_save_project_meta' );
+22 -57
View File
@@ -124,6 +124,12 @@ function chrnx_get_eligible_editorial_post_ids( $extra_args = array() ) {
'cache_results' => false, 'cache_results' => false,
'suppress_filters' => false, 'suppress_filters' => false,
'chrnx_require_nonempty_title' => true, 'chrnx_require_nonempty_title' => true,
'tax_query' => array(
array(
'taxonomy' => 'chrnx_release',
'operator' => 'NOT EXISTS',
),
),
), ),
$extra_args, $extra_args,
array( 'posts_per_page' => $limit ) array( 'posts_per_page' => $limit )
@@ -262,59 +268,6 @@ function chrnx_get_featured_story_ids( int $limit = 3 ): array {
return $selected; return $selected;
} }
/**
* Select projects for the Selected work stage: hand-picked first, then recent.
*
* Sticky already belongs to the home featured stories, so the editorial choice
* lives in its own per-post flag instead of competing for the same signal.
*
* @param int $limit Maximum projects, bounded to 12.
* @return int[] Selected project post IDs.
*/
function chrnx_get_selected_project_ids( int $limit = 3 ): array {
$limit = min( 12, max( 0, $limit ) );
if ( 0 === $limit ) {
return array();
}
$topic_query = array(
array(
'taxonomy' => 'chrnx_topic',
'field' => 'slug',
'terms' => 'projects',
),
);
$selected = chrnx_get_eligible_editorial_post_ids(
array(
'posts_per_page' => $limit,
'tax_query' => $topic_query,
'meta_query' => array(
array(
'key' => 'chrnx_project_featured',
'value' => '1',
),
),
)
);
$remaining = $limit - count( $selected );
if ( $remaining > 0 ) {
$selected = array_merge(
$selected,
chrnx_get_eligible_editorial_post_ids(
array(
'posts_per_page' => $remaining,
'post__not_in' => $selected,
'tax_query' => $topic_query,
)
)
);
}
return $selected;
}
/** /**
* Validate a request taxonomy slug against an existing editorial term. * Validate a request taxonomy slug against an existing editorial term.
* *
@@ -374,7 +327,7 @@ function chrnx_sanitize_journal_search( $value ) {
*/ */
function chrnx_get_journal_archive_filter( $queried_object = null ): array { function chrnx_get_journal_archive_filter( $queried_object = null ): array {
$queried_object = null === $queried_object ? get_queried_object() : $queried_object; $queried_object = null === $queried_object ? get_queried_object() : $queried_object;
if ( ! $queried_object instanceof WP_Term || ! in_array( $queried_object->taxonomy, array( 'chrnx_topic', 'chrnx_language', 'chrnx_show' ), true ) ) { if ( ! $queried_object instanceof WP_Term || ! in_array( $queried_object->taxonomy, array( 'chrnx_topic', 'chrnx_language', 'chrnx_show', 'chrnx_project' ), true ) ) {
return array(); return array();
} }
@@ -431,7 +384,7 @@ function chrnx_get_journal_base_url() {
$url = get_permalink( $queried ); $url = get_permalink( $queried );
return is_string( $url ) ? $url : ''; return is_string( $url ) ? $url : '';
} }
if ( $queried instanceof WP_Term && in_array( $queried->taxonomy, array( 'chrnx_topic', 'chrnx_language', 'chrnx_show' ), true ) ) { if ( $queried instanceof WP_Term && in_array( $queried->taxonomy, array( 'chrnx_topic', 'chrnx_language', 'chrnx_show', 'chrnx_project' ), true ) ) {
$url = get_term_link( $queried ); $url = get_term_link( $queried );
return is_wp_error( $url ) ? '' : $url; return is_wp_error( $url ) ? '' : $url;
} }
@@ -486,7 +439,7 @@ function chrnx_get_full_journal_url() {
function chrnx_get_journal_page_url( int $page, array $filters ) { function chrnx_get_journal_page_url( int $page, array $filters ) {
$base_url = chrnx_get_journal_base_url(); $base_url = chrnx_get_journal_base_url();
$args = array(); $args = array();
foreach ( array( 'chrnx_topic', 'chrnx_language', 'chrnx_show' ) as $taxonomy ) { foreach ( array( 'chrnx_topic', 'chrnx_language', 'chrnx_show', 'chrnx_project' ) as $taxonomy ) {
$slug = chrnx_validate_editorial_term_slug( $filters[ $taxonomy ] ?? '', $taxonomy ); $slug = chrnx_validate_editorial_term_slug( $filters[ $taxonomy ] ?? '', $taxonomy );
if ( '' !== $slug ) { if ( '' !== $slug ) {
$args[ $taxonomy ] = $slug; $args[ $taxonomy ] = $slug;
@@ -526,7 +479,7 @@ function chrnx_get_journal_query_args( array $request ): array {
); );
$tax_query = array(); $tax_query = array();
foreach ( array( 'chrnx_topic', 'chrnx_language', 'chrnx_show' ) as $taxonomy ) { foreach ( array( 'chrnx_topic', 'chrnx_language', 'chrnx_show', 'chrnx_project' ) as $taxonomy ) {
$value = $request[ $taxonomy ] ?? ''; $value = $request[ $taxonomy ] ?? '';
$slug = chrnx_validate_editorial_term_slug( $value, $taxonomy ); $slug = chrnx_validate_editorial_term_slug( $value, $taxonomy );
if ( '' !== $slug ) { if ( '' !== $slug ) {
@@ -540,6 +493,13 @@ function chrnx_get_journal_query_args( array $request ): array {
if ( ! empty( $tax_query ) ) { if ( ! empty( $tax_query ) ) {
$args['tax_query'] = $tax_query; $args['tax_query'] = $tax_query;
} }
$args['tax_query'][] = array(
'taxonomy' => 'chrnx_release',
'operator' => 'NOT EXISTS',
);
if ( 1 < count( $args['tax_query'] ) ) {
$args['tax_query']['relation'] = 'AND';
}
$search = chrnx_sanitize_journal_search( $request['s'] ?? '' ); $search = chrnx_sanitize_journal_search( $request['s'] ?? '' );
if ( '' !== $search ) { if ( '' !== $search ) {
@@ -687,6 +647,7 @@ function chrnx_get_topic_art_asset( string $topic_slug ): string {
'about-grunge' => 'about-grunge.png', 'about-grunge' => 'about-grunge.png',
'placeholder-post' => 'placeholder-post.png', 'placeholder-post' => 'placeholder-post.png',
'placeholder-release' => 'placeholder-release.png', 'placeholder-release' => 'placeholder-release.png',
'placeholder-project' => 'placeholder-project.png',
'projects-grunge' => 'projects-grunge.png', 'projects-grunge' => 'projects-grunge.png',
'podcasts' => 'alter-ego-podcasts.png', 'podcasts' => 'alter-ego-podcasts.png',
'life' => 'alter-ego-life.png', 'life' => 'alter-ego-life.png',
@@ -719,5 +680,9 @@ function chrnx_get_topic_art_dimensions( string $topic_slug ): array {
return array( 1536, 1536 ); return array( 1536, 1536 );
} }
if ( 'placeholder-project' === $topic_slug ) {
return array( 1534, 1025 );
}
return 'gaming' === $topic_slug ? array( 1024, 1536 ) : array( 1122, 1402 ); return 'gaming' === $topic_slug ? array( 1024, 1536 ) : array( 1122, 1402 );
} }
+1 -1
View File
@@ -127,7 +127,7 @@ function chrnx_get_platform_links_markup( array $links, $class_name = 'chrnx-pla
} }
$items .= sprintf( $items .= sprintf(
// The icon path data is a fixed literal, never user input. // The icon path data is a fixed literal, never user input.
'<li><a class="%1$s__link" href="%2$s" target="_blank" rel="noopener noreferrer external"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">%3$s</svg><span class="chrnx-screen-reader-text">%4$s</span></a></li>', '<li><a class="%1$s__link" href="%2$s" target="_blank" rel="noopener noreferrer external"><svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">%3$s</svg><span class="%1$s__label">%4$s</span></a></li>',
esc_attr( $class_name ), esc_attr( $class_name ),
esc_url( $url ), esc_url( $url ),
$platforms[ $platform ]['icon'], // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped $platforms[ $platform ]['icon'], // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
+56
View File
@@ -32,6 +32,62 @@ function chrnx_setup() {
add_action( 'after_setup_theme', 'chrnx_setup' ); add_action( 'after_setup_theme', 'chrnx_setup' );
add_filter( 'comments_open', '__return_false' ); add_filter( 'comments_open', '__return_false' );
/*
* Nothing collects comments, so the head must not advertise a feed for them.
* This one filter covers both the site-wide feed printed by feed_links() and
* the per-post one from feed_links_extra(), which still fired on old posts
* carrying a non-zero comment_count. Topic, author and search feeds stay.
*/
add_filter( 'feed_links_show_comments_feed', '__return_false' );
/**
* Resolve the document language from the editorial language taxonomy.
*
* Roughly half the journal is written in Spanish while every route declared
* en-US, so screen readers read Spanish with English phonetics and crawlers
* indexed those posts as English. chrnx_language already records the answer.
*
* @return string BCP 47 tag, or an empty string to keep the site language.
*/
function chrnx_get_document_locale(): string {
// ponytail: explicit map, a third language is one more line here.
$locales = array(
'en' => 'en-US',
'es' => 'es-MX',
);
$slug = '';
if ( is_singular( 'post' ) ) {
// A post carries one language; extra terms are an editing mistake.
$terms = get_the_terms( get_queried_object_id(), 'chrnx_language' );
$slug = ( is_array( $terms ) && isset( $terms[0]->slug ) ) ? $terms[0]->slug : '';
} elseif ( is_tax( 'chrnx_language' ) ) {
$term = get_queried_object();
$slug = $term instanceof WP_Term ? $term->slug : '';
}
return $locales[ $slug ] ?? '';
}
/**
* Apply the editorial language to the html element.
*
* @param string $output Attribute string built by core.
* @return string Attribute string carrying the editorial language.
*/
function chrnx_filter_language_attributes( $output ) {
$locale = chrnx_get_document_locale();
if ( '' === $locale ) {
return $output;
}
// Replace only the language, so dir and any plugin attribute survive.
return preg_replace( '/lang="[^"]*"/', 'lang="' . esc_attr( $locale ) . '"', (string) $output, 1 );
}
add_filter( 'language_attributes', 'chrnx_filter_language_attributes' );
/** /**
* Print Open Graph and Twitter card tags only when nothing else does. * Print Open Graph and Twitter card tags only when nothing else does.
* *
+10
View File
@@ -52,6 +52,16 @@ function chrnx_get_editorial_taxonomies() {
'el-hermoso-caos' => __( 'El Hermoso Caos que habita en mi cabeza', 'chrnx' ), 'el-hermoso-caos' => __( 'El Hermoso Caos que habita en mi cabeza', 'chrnx' ),
'ando-bien-arriba' => __( 'Ando Bien Arriba', 'chrnx' ), 'ando-bien-arriba' => __( 'Ando Bien Arriba', 'chrnx' ),
'aqui-se-rompio-una-jerga' => __( 'Aquí se Rompió una Jerga', 'chrnx' ), 'aqui-se-rompio-una-jerga' => __( 'Aquí se Rompió una Jerga', 'chrnx' ),
'side-b' => __( 'Side B', 'chrnx' ),
),
),
'chrnx_project' => array(
'singular' => __( 'Project', 'chrnx' ),
'plural' => __( 'Projects', 'chrnx' ),
'rest_base' => 'project',
'terms' => array(
'green-tea' => __( 'Green Tea', 'chrnx' ),
'ailed' => __( 'Ailed', 'chrnx' ),
), ),
), ),
); );
+3 -2
View File
@@ -24,8 +24,9 @@ function chrnx_auth_track_meta( $allowed, $meta_key, $post_id ) {
*/ */
function chrnx_get_track_meta_definitions() { function chrnx_get_track_meta_definitions() {
$definitions = array( $definitions = array(
'chrnx_track_number' => 'absint', 'chrnx_track_number' => 'absint',
'chrnx_track_audio' => 'absint', 'chrnx_track_audio' => 'absint',
'chrnx_track_description' => 'sanitize_textarea_field',
); );
foreach ( array_keys( chrnx_get_release_platforms() ) as $platform ) { foreach ( array_keys( chrnx_get_release_platforms() ) as $platform ) {
+2 -2
View File
@@ -16,8 +16,8 @@
<!-- wp:html --><div class="chrnx-character-stage__atmosphere" aria-hidden="true"><?php echo chrnx_get_atmosphere_markup( 'projects-grunge', 'chrnx-character-stage__backdrop' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?><?php echo chrnx_get_topic_portrait_markup( 'research', '', 'chrnx-character-stage__secondary-art' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?></div><!-- /wp:html --> <!-- wp:html --><div class="chrnx-character-stage__atmosphere" aria-hidden="true"><?php echo chrnx_get_atmosphere_markup( 'projects-grunge', 'chrnx-character-stage__backdrop' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?><?php echo chrnx_get_topic_portrait_markup( 'research', '', 'chrnx-character-stage__secondary-art' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?></div><!-- /wp:html -->
<!-- wp:group {"className":"chrnx-character-stage__content","layout":{"type":"constrained"}} --> <!-- wp:group {"className":"chrnx-character-stage__content","layout":{"type":"constrained"}} -->
<div class="wp-block-group chrnx-character-stage__content"> <div class="wp-block-group chrnx-character-stage__content">
<!-- wp:heading --><h2 class="wp-block-heading"><?php echo esc_html__( 'Selected work', 'chrnx' ); ?></h2><!-- /wp:heading --> <!-- wp:heading --><h2 class="wp-block-heading"><?php echo esc_html__( 'Proyectos', 'chrnx' ); ?></h2><!-- /wp:heading -->
<!-- wp:chrnx/selected-work /--> <!-- wp:paragraph --><p><?php echo esc_html__( 'Lo que sobrevive a la loquera nocturna, con su repo y su estado real.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
</div> </div>
<!-- /wp:group --> <!-- /wp:group -->
<!-- wp:html --><div class="chrnx-character-stage__art"><?php echo chrnx_get_topic_portrait_markup( 'code', '', 'chrnx-section-portrait' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?></div><!-- /wp:html --> <!-- wp:html --><div class="chrnx-character-stage__art"><?php echo chrnx_get_topic_portrait_markup( 'code', '', 'chrnx-section-portrait' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?></div><!-- /wp:html -->
+1 -1
View File
@@ -24,7 +24,7 @@
<!-- wp:html --><div class="chrnx-character-stage__art"><?php echo chrnx_get_topic_portrait_markup( 'music', __( 'The No Names musician portrait', 'chrnx' ), 'chrnx-music-landing__portrait' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?></div><!-- /wp:html --> <!-- wp:html --><div class="chrnx-character-stage__art"><?php echo chrnx_get_topic_portrait_markup( 'music', __( 'The No Names musician portrait', 'chrnx' ), 'chrnx-music-landing__portrait' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?></div><!-- /wp:html -->
</div> </div>
<!-- /wp:group --> <!-- /wp:group -->
<!-- wp:paragraph {"className":"chrnx-music-note"} --><p class="chrnx-music-note"><?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:paragraph {"className":"chrnx-music-note"} --><p class="chrnx-music-note"><?php echo esc_html__( 'Miren, miren: esto es, virtualmente, lo que la voz de Kurt Cobain le hizo a mi cabeza, pasado por una IA generativa. Si vienes con AI SLOP, déjame decirte que me vale veinte mil hectáreas de verga. La letra, la voz y la producción vienen de una tormenta que vive permanentemente en mi cabeza. Si no te gusta, ahí está la puerta. Yo nomás aviso: no habrá conciertos. Así nomás.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
<!-- wp:heading {"level":3} --><h3 class="wp-block-heading"><?php echo esc_html__( 'Releases in progress', 'chrnx' ); ?></h3><!-- /wp:heading --> <!-- wp:heading {"level":3} --><h3 class="wp-block-heading"><?php echo esc_html__( 'Releases in progress', 'chrnx' ); ?></h3><!-- /wp:heading -->
<!-- wp:chrnx/release-list /--> <!-- wp:chrnx/release-list /-->
</section> </section>
+30
View File
@@ -0,0 +1,30 @@
<?php
/**
* Title: Projects landing
* Slug: chrnx/projects-landing
* Categories: chrnx-projects
* Description: Honest introduction to the projects and every one that exists.
* Inserter: yes
*
* @package CHRNX
*/
?>
<!-- wp:group {"tagName":"section","className":"chrnx-projects-landing","layout":{"type":"constrained"}} -->
<section class="wp-block-group chrnx-projects-landing">
<!-- wp:group {"className":"chrnx-character-stage","layout":{"type":"constrained"}} -->
<div class="wp-block-group chrnx-character-stage">
<!-- wp:html --><div class="chrnx-character-stage__atmosphere" aria-hidden="true"><?php echo chrnx_get_atmosphere_markup( 'projects-grunge', 'chrnx-character-stage__backdrop' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?></div><!-- /wp:html -->
<!-- wp:group {"className":"chrnx-character-stage__content","layout":{"type":"constrained"}} -->
<div class="wp-block-group chrnx-character-stage__content">
<!-- wp:heading {"level":2} --><h2 class="wp-block-heading"><?php echo esc_html__( 'Proyectos', 'chrnx' ); ?></h2><!-- /wp:heading -->
<!-- wp:paragraph --><p><?php echo esc_html__( 'Aquí va lo que mi cerebro tira en formato de código.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
<!-- wp:paragraph --><p><?php echo esc_html__( 'Una noche me agarra la loquera y sale código. A veces sirve, a veces nomás me deja dormir. Lo que sobrevive lo dejo aquí, con su repo y su estado real, sin adornos.', 'chrnx' ); ?></p><!-- /wp:paragraph -->
</div>
<!-- /wp:group -->
<!-- wp:html --><div class="chrnx-character-stage__art"><?php echo chrnx_get_topic_portrait_markup( 'code', '', 'chrnx-projects-landing__portrait' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Helper returns escaped, allowlisted markup. ?></div><!-- /wp:html -->
</div>
<!-- /wp:group -->
<!-- wp:heading {"level":3} --><h3 class="wp-block-heading"><?php echo esc_html__( 'Lo que existe', 'chrnx' ); ?></h3><!-- /wp:heading -->
<!-- wp:chrnx/project-list /-->
</section>
<!-- /wp:group -->
+4 -3
View File
@@ -178,7 +178,7 @@ done
chrnx_build_responsive_image "alter-ego-gaming-half-body" "alter-ego-gaming-half-body.png" chrnx_build_responsive_image "alter-ego-gaming-half-body" "alter-ego-gaming-half-body.png"
printf '{\n\t"source": "alter-ego-gaming-half-body.png",\n\t"formats": [ "avif", "webp" ],\n\t"widths": [ 384, 768 ]\n}\n' > "$chrnx_image_build_output/alter-ego-gaming-half-body.json" printf '{\n\t"source": "alter-ego-gaming-half-body.png",\n\t"formats": [ "avif", "webp" ],\n\t"widths": [ 384, 768 ]\n}\n' > "$chrnx_image_build_output/alter-ego-gaming-half-body.json"
for chrnx_image_placeholder in placeholder-post placeholder-release; do for chrnx_image_placeholder in placeholder-post placeholder-release placeholder-project; do
# Placeholders sit at half opacity behind text; they do not need full quality. # Placeholders sit at half opacity behind text; they do not need full quality.
chrnx_build_responsive_image "$chrnx_image_placeholder" "$chrnx_image_placeholder.png" 48 40 chrnx_build_responsive_image "$chrnx_image_placeholder" "$chrnx_image_placeholder.png" 48 40
printf '{\n\t"source": "%s.png",\n\t"formats": [ "avif", "webp" ],\n\t"widths": [ 384, 768 ]\n}\n' "$chrnx_image_placeholder" > "$chrnx_image_build_output/$chrnx_image_placeholder.json" printf '{\n\t"source": "%s.png",\n\t"formats": [ "avif", "webp" ],\n\t"widths": [ 384, 768 ]\n}\n' "$chrnx_image_placeholder" > "$chrnx_image_build_output/$chrnx_image_placeholder.json"
@@ -228,14 +228,15 @@ chrnx_validate_staged_family "alter-ego-gaming-half-body" 384 768
chrnx_validate_staged_family "the-no-names-musician-cutout" 384 768 chrnx_validate_staged_family "the-no-names-musician-cutout" 384 768
chrnx_validate_staged_family "placeholder-post" 384 768 chrnx_validate_staged_family "placeholder-post" 384 768
chrnx_validate_staged_family "placeholder-release" 384 768 chrnx_validate_staged_family "placeholder-release" 384 768
chrnx_validate_staged_family "placeholder-project" 384 768
chrnx_validate_staged_family "the-no-names-collage" 384 768 chrnx_validate_staged_family "the-no-names-collage" 384 768
chrnx_validate_staged_family "podcast-frequency-grunge" 384 768 1536 chrnx_validate_staged_family "podcast-frequency-grunge" 384 768 1536
chrnx_validate_staged_family "about-grunge" 384 768 1536 chrnx_validate_staged_family "about-grunge" 384 768 1536
chrnx_validate_staged_family "projects-grunge" 384 768 1536 chrnx_validate_staged_family "projects-grunge" 384 768 1536
set -- "$chrnx_image_stage"/* set -- "$chrnx_image_stage"/*
if [ "$#" -ne 76 ]; then if [ "$#" -ne 81 ]; then
echo "Responsive image staging expected 76 files, got $#." >&2 echo "Responsive image staging expected 81 files, got $#." >&2
exit 1 exit 1
fi fi
for chrnx_image_staged in "$@"; do for chrnx_image_staged in "$@"; do
+1 -4
View File
@@ -140,12 +140,9 @@ foreach ( $chrnx_seed_posts as $chrnx_seed_index => $chrnx_seed_post ) {
wp_set_object_terms( $chrnx_seed_post_id, array(), 'chrnx_release', false ); wp_set_object_terms( $chrnx_seed_post_id, array(), 'chrnx_release', false );
} }
foreach ( array( 'chrnx_episode_number', 'chrnx_episode_duration', 'canonical_episode_url', 'chrnx_project_featured' ) as $chrnx_seed_meta_key ) { foreach ( array( 'chrnx_episode_number', 'chrnx_episode_duration', 'canonical_episode_url' ) as $chrnx_seed_meta_key ) {
delete_post_meta( $chrnx_seed_post_id, $chrnx_seed_meta_key ); delete_post_meta( $chrnx_seed_post_id, $chrnx_seed_meta_key );
} }
if ( ! empty( $chrnx_seed_post['projectFeatured'] ) ) {
update_post_meta( $chrnx_seed_post_id, 'chrnx_project_featured', true );
}
delete_post_meta( $chrnx_seed_post_id, 'chrnx_track_number' ); delete_post_meta( $chrnx_seed_post_id, 'chrnx_track_number' );
if ( isset( $chrnx_seed_post['trackNumber'] ) ) { if ( isset( $chrnx_seed_post['trackNumber'] ) ) {
update_post_meta( $chrnx_seed_post_id, 'chrnx_track_number', absint( $chrnx_seed_post['trackNumber'] ) ); update_post_meta( $chrnx_seed_post_id, 'chrnx_track_number', absint( $chrnx_seed_post['trackNumber'] ) );
+274
View File
@@ -0,0 +1,274 @@
<?php
/** Local-only The No Names importer. Never run against a public host. */
// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals, WordPress.WP.GlobalVariablesOverride.Prohibited, WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents, WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents
$host = wp_parse_url( home_url( '/' ), PHP_URL_HOST );
if ( ! in_array( $host, array( 'localhost', '127.0.0.1' ), true ) ) {
WP_CLI::error( 'Refusing to seed a non-local WordPress site.' );
}
$source_root = '/var/www/html/wp-content/suno-source/discs';
$releases = array(
'el-hermoso-caos' => array(
'name' => 'El Hermoso Caos que habita en mi cabeza',
'source' => 'el-hermoso-caos-que-habita-en-mi-cerebro',
'cover' => 'cover-3000.jpg',
'track_count' => 13,
),
'ando-bien-arriba' => array(
'name' => 'Ando Bien Arriba',
'source' => 'ando-bien-arriba',
'cover' => 'cover-art-v1-1200.jpg',
'track_count' => 6,
),
'aqui-se-rompio-una-jerga' => array(
'name' => 'Aquí se Rompió una Jerga',
'source' => 'aqui-se-rompio-una-jerga',
'cover' => 'cover-art-v1-1200.jpg',
'track_count' => 6,
),
'side-b' => array(
'name' => 'Side B',
'source' => 'el-hermoso-caos-que-habita-en-mi-cerebro/side-b',
'cover' => 'cover-art-v1-1200.jpg',
'track_count' => 19,
),
);
function chrnx_local_frontmatter( string $path ): array {
$text = (string) file_get_contents( $path );
if ( ! preg_match( '/\A---\s*\R(.*?)\R---/s', $text, $match ) ) {
return array();
}
$data = array();
foreach ( preg_split( '/\R/', $match[1] ) as $line ) {
if ( preg_match( '/^([a-z_]+):\s*(.*)$/', $line, $field ) ) {
$data[ $field[1] ] = trim( trim( $field[2] ), "\"'" );
}
}
return $data;
}
function chrnx_local_concept( string $path ): string {
$text = (string) file_get_contents( $path );
if ( preg_match( '/^## Concept\s*\R(.*?)(?=^## |\z)/ms', $text, $match ) ) {
$paragraphs = preg_split( '/\R\s*\R/', trim( $match[1] ) );
return trim( preg_replace( '/[`*_]/', '', (string) reset( $paragraphs ) ) );
}
return '';
}
function chrnx_local_lyrics( string $path ): string {
$text = (string) file_get_contents( $path );
if ( preg_match( '/^## Lyrics\s*\R(.*?)(?=^## |\z)/ms', $text, $match ) ) {
return trim( $match[1] );
}
return '';
}
function chrnx_local_cover( string $path, string $key ): int {
$existing = get_posts(
array(
'post_type' => 'attachment',
'post_status' => 'inherit',
'posts_per_page' => 1,
'fields' => 'ids',
'meta_key' => '_chrnx_fixture_key',
'meta_value' => $key,
)
);
if ( ! empty( $existing ) ) {
return absint( $existing[0] );
}
$uploads = wp_upload_dir();
$name = sanitize_file_name( basename( $path ) );
$target = trailingslashit( $uploads['path'] ) . $name;
wp_mkdir_p( dirname( $target ) );
file_put_contents( $target, file_get_contents( $path ) );
$type = wp_check_filetype( $name );
$id = wp_insert_attachment(
array(
'post_mime_type' => $type['type'] ?? 'image/jpeg',
'post_title' => sanitize_text_field( pathinfo( $name, PATHINFO_FILENAME ) ),
'post_status' => 'inherit',
),
$target
);
update_post_meta( $id, '_chrnx_fixture_key', $key );
return absint( $id );
}
function chrnx_local_attachment( string $path, string $key ): int {
$existing = get_posts(
array(
'post_type' => 'attachment',
'post_status' => 'inherit',
'posts_per_page' => 1,
'fields' => 'ids',
'meta_key' => '_chrnx_fixture_key',
'meta_value' => $key,
)
);
if ( ! empty( $existing ) ) {
return absint( $existing[0] );
}
$uploads = wp_upload_dir();
$name = sanitize_file_name( basename( $path ) );
$target = trailingslashit( $uploads['path'] ) . $key . '-' . $name;
wp_mkdir_p( dirname( $target ) );
file_put_contents( $target, file_get_contents( $path ) );
$type = wp_check_filetype( $name );
$id = wp_insert_attachment(
array(
'post_mime_type' => $type['type'] ?? 'audio/mp4',
'post_title' => sanitize_text_field( pathinfo( $name, PATHINFO_FILENAME ) ),
'post_status' => 'inherit',
),
$target
);
update_post_meta( $id, '_chrnx_fixture_key', $key );
return absint( $id );
}
foreach ( get_posts(
array(
'post_type' => 'post',
'post_status' => 'any',
'posts_per_page' => -1,
'fields' => 'ids',
'meta_key' => '_chrnx_fixture_key',
'meta_value' => 'the-no-names-',
'meta_compare' => 'LIKE',
)
) as $old_id ) {
wp_delete_post( $old_id, true );
}
$old_release_posts = get_posts(
array(
'post_type' => 'post',
'post_status' => 'any',
'posts_per_page' => -1,
'fields' => 'ids',
'tax_query' => array(
array(
'taxonomy' => 'chrnx_release',
'field' => 'slug',
'terms' => array_keys( $releases ),
),
),
)
);
foreach ( $old_release_posts as $old_id ) {
wp_delete_post( $old_id, true );
}
foreach ( $releases as $slug => $release ) {
$source_dir = trailingslashit( $source_root ) . $release['source'];
$disc_path = trailingslashit( $source_dir ) . 'disc.md';
$term = get_term_by( 'slug', $slug, 'chrnx_release' );
if ( ! $term instanceof WP_Term ) {
$insert = wp_insert_term( $release['name'], 'chrnx_release', array( 'slug' => $slug ) );
$term = get_term( $insert['term_id'] );
}
$description = is_readable( $disc_path ) ? chrnx_local_concept( $disc_path ) : 'Material experimental y alterno de The No Names: pruebas, desvíos y canciones que todavía están buscando dónde caer.';
$cover_id = 0;
wp_update_term(
$term->term_id,
'chrnx_release',
array(
'name' => $release['name'],
'description' => $description,
)
);
update_term_meta( $term->term_id, 'chrnx_release_status', 'in production' );
foreach ( array(
'suno' => 'https://suno.com/playlist/local-the-no-names',
'spotify' => 'https://open.spotify.com/album/local-the-no-names',
'apple' => 'https://music.apple.com/us/album/local-the-no-names',
) as $platform => $url ) {
update_term_meta( $term->term_id, 'chrnx_release_url_' . $platform, $url );
}
$cover_path = trailingslashit( $source_dir ) . $release['cover'];
if ( is_readable( $cover_path ) ) {
$cover_id = chrnx_local_cover( $cover_path, 'the-no-names-cover-' . $slug );
update_term_meta( $term->term_id, 'chrnx_release_cover', $cover_id );
}
$track_dirs = glob( trailingslashit( $source_dir ) . '[0-9][0-9]-*', GLOB_ONLYDIR );
if ( 'side-b' === $slug ) {
$track_dirs = glob( trailingslashit( $source_dir ) . '[0-9][0-9]-*', GLOB_ONLYDIR );
}
foreach ( $track_dirs as $track_dir ) {
$song_path = trailingslashit( $track_dir ) . 'song.md';
if ( ! is_readable( $song_path ) ) {
$alternate_song = trailingslashit( $track_dir ) . 'song-hibrido.md';
if ( is_readable( $alternate_song ) ) {
$song_path = $alternate_song;
}
}
if ( ! is_readable( $song_path ) ) {
continue;
}
$meta = chrnx_local_frontmatter( $song_path );
$num = 0;
if ( preg_match( '/\A(\d+)-/', basename( $track_dir ), $number_match ) ) {
$num = absint( $number_match[1] );
}
if ( 0 === $num ) {
continue;
}
$key = 'the-no-names-' . $slug . '-' . str_pad( (string) $num, 2, '0', STR_PAD_LEFT );
$posts = get_posts(
array(
'post_type' => 'post',
'post_status' => 'any',
'posts_per_page' => 1,
'fields' => 'ids',
'meta_key' => '_chrnx_fixture_key',
'meta_value' => $key,
)
);
$post = array(
'post_title' => sanitize_text_field( $meta['name'] ?? basename( $track_dir ) ),
'post_name' => sanitize_title( $slug . '-' . $num . '-' . ( $meta['name'] ?? basename( $track_dir ) ) ),
'post_status' => 'publish',
'post_type' => 'post',
'post_content' => wp_kses_post( chrnx_local_lyrics( $song_path ) ),
);
if ( ! empty( $posts ) ) {
$post['ID'] = absint( $posts[0] );
}
$post_id = wp_insert_post( $post, true );
update_post_meta( $post_id, '_chrnx_fixture_key', $key );
update_post_meta( $post_id, 'chrnx_track_number', $num );
wp_set_object_terms( $post_id, $slug, 'chrnx_release', false );
wp_set_object_terms( $post_id, 'music', 'chrnx_topic', false );
wp_set_object_terms( $post_id, 'es', 'chrnx_language', false );
$description = chrnx_local_concept( $song_path );
if ( '' !== $description ) {
update_post_meta( $post_id, 'chrnx_track_description', $description );
}
foreach ( array(
'suno' => 'https://suno.com/song/local-' . $key,
'spotify' => 'https://open.spotify.com/track/local-' . $key,
'apple' => 'https://music.apple.com/us/song/local-' . $key,
) as $platform => $url ) {
update_post_meta( $post_id, 'chrnx_track_url_' . $platform, $url );
}
$audio_path = trailingslashit( $track_dir ) . 'song.mp3';
if ( ! is_readable( $audio_path ) ) {
$audio_path = trailingslashit( $track_dir ) . 'song.m4a';
}
if ( is_readable( $audio_path ) ) {
$audio_id = chrnx_local_attachment( $audio_path, $key . '-audio' );
update_post_meta( $post_id, 'chrnx_track_audio', $audio_id );
}
if ( ! empty( $cover_id ) ) {
set_post_thumbnail( $post_id, $cover_id );
}
}
}
flush_rewrite_rules( false );
WP_CLI::success( 'The No Names local fixture loaded: 4 releases with local test platform URLs.' );
// phpcs:enable
+20
View File
@@ -0,0 +1,20 @@
#!/bin/sh
set -eu
chrnx_script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
chrnx_project_dir=$(dirname -- "$chrnx_script_dir")
chrnx_docker_cli_dir=${CHRNX_DOCKER_CLI_DIR:-/opt/homebrew/opt/docker/bin}
cd -- "$chrnx_project_dir"
if [ ! -x "$chrnx_docker_cli_dir/docker" ]; then
echo "Docker CLI not found at the approved Colima path: $chrnx_docker_cli_dir/docker" >&2
exit 1
fi
chrnx_host=$(PATH="$chrnx_docker_cli_dir:$PATH" npm exec -- wp-env run cli wp eval 'echo wp_parse_url( home_url( "/" ), PHP_URL_HOST );')
case "$chrnx_host" in
localhost|127.0.0.1) ;;
*) echo "Refusing to seed a non-local WordPress site." >&2; exit 1 ;;
esac
PATH="$chrnx_docker_cli_dir:$PATH" npm exec -- wp-env run cli wp eval-file wp-content/themes/chrnx/scripts/seed-the-no-names-local.php
+1 -1
View File
@@ -3,6 +3,6 @@ Theme Name: CHRNX
Description: A native block theme for chrnx.dev. Description: A native block theme for chrnx.dev.
Requires at least: 6.9 Requires at least: 6.9
Requires PHP: 8.1 Requires PHP: 8.1
Version: 0.4.3 Version: 0.4.5
Text Domain: chrnx Text Domain: chrnx
*/ */
+1 -1
View File
@@ -12,9 +12,9 @@
</div> </div>
<!-- /wp:group --> <!-- /wp:group -->
<!-- wp:post-featured-image {"aspectRatio":"3/2"} /--> <!-- wp:post-featured-image {"aspectRatio":"3/2"} /-->
<!-- wp:post-content {"layout":{"type":"constrained"}} /-->
<!-- wp:chrnx/podcast-meta /--> <!-- wp:chrnx/podcast-meta /-->
<!-- wp:chrnx/track-meta /--> <!-- wp:chrnx/track-meta /-->
<!-- wp:post-content {"layout":{"type":"constrained"}} /-->
<!-- wp:chrnx/related-posts /--> <!-- wp:chrnx/related-posts /-->
<!-- wp:chrnx/subscribe-cta {"className":"is-style-quiet"} /--> <!-- wp:chrnx/subscribe-cta {"className":"is-style-quiet"} /-->
</main> </main>
+12
View File
@@ -0,0 +1,12 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:group {"tagName":"main","anchor":"chrnx-main","className":"chrnx-archive chrnx-project-archive","layout":{"type":"constrained"}} -->
<main id="chrnx-main" class="wp-block-group chrnx-archive chrnx-project-archive" tabindex="-1">
<!-- wp:query-title {"type":"archive","level":1,"showPrefix":false} /-->
<!-- wp:chrnx/project-detail /-->
<!-- wp:chrnx/journal-stream /-->
<!-- wp:chrnx/subscribe-cta {"className":"is-style-quiet"} /-->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
+12
View File
@@ -0,0 +1,12 @@
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->
<!-- wp:group {"tagName":"main","anchor":"chrnx-main","className":"chrnx-archive chrnx-show-archive","layout":{"type":"constrained"}} -->
<main id="chrnx-main" class="wp-block-group chrnx-archive chrnx-show-archive" tabindex="-1">
<!-- wp:query-title {"type":"archive","level":1,"showPrefix":false} /-->
<!-- wp:chrnx/show-links /-->
<!-- wp:chrnx/journal-stream /-->
<!-- wp:chrnx/subscribe-cta {"className":"is-style-quiet"} /-->
</main>
<!-- /wp:group -->
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /-->
-2
View File
@@ -47,6 +47,4 @@ test( 'editorial and podcast controls initialize in the real post editor', async
await openPanel( 'Topic' ); await openPanel( 'Topic' );
await page.getByRole( 'radio', { name: 'Projects', exact: true } ).check(); await page.getByRole( 'radio', { name: 'Projects', exact: true } ).check();
await expect( page.getByLabel( 'Episode number', { exact: true } ) ).toBeHidden(); await expect( page.getByLabel( 'Episode number', { exact: true } ) ).toBeHidden();
await openPanel( 'Project' );
await expect( page.getByLabel( 'Show in Selected work', { exact: true } ) ).toBeVisible();
} ); } );
+4 -6
View File
@@ -9,7 +9,7 @@ const landings = [
atmosphere: '.chrnx-character-stage__collage', atmosphere: '.chrnx-character-stage__collage',
art: 'img[src*="the-no-names-musician-cutout-768.webp"]', art: 'img[src*="the-no-names-musician-cutout-768.webp"]',
internalHeadings: ':scope > h3, .chrnx-release-card h4', internalHeadings: ':scope > h3, .chrnx-release-card h4',
internalHeadingCount: 4, internalHeadingCount: 5,
next: ':scope > p', next: ':scope > p',
}, },
{ {
@@ -557,11 +557,9 @@ const immutableSurfaces = [
'alter-ego-research-768.webp', 'alter-ego-research-768.webp',
'alter-ego-code-768.webp', 'alter-ego-code-768.webp',
], ],
// Project names come from chrnx/selected-work: picked projects newest-first, headings: [ 'Proyectos' ],
// then the most recent ones. This is the seeded order, not a frozen string. paragraphs: [ 'Lo que sobrevive a la loquera nocturna, con su repo y su estado real.' ],
headings: [ 'Selected work', 'Ailed', 'Expressive Tea', 'Published research' ], contentText: 'Proyectos Lo que sobrevive a la loquera nocturna, con su repo y su estado real.',
paragraphs: [],
contentText: 'Selected work Ailed Expressive Tea Published research',
}, },
{ {
name: 'About', name: 'About',
+3 -2
View File
@@ -193,7 +193,7 @@ test( 'home remains coherent at all approved review viewports', async ( { page }
await expect( page.locator( 'main#chrnx-main' ) ).toBeVisible(); await expect( page.locator( 'main#chrnx-main' ) ).toBeVisible();
await expect( page.getByRole( 'contentinfo' ) ).toBeVisible(); await expect( page.getByRole( 'contentinfo' ) ).toBeVisible();
await expect( page.getByRole( 'heading', { level: 1 } ) ).toHaveCount( 1 ); await expect( page.getByRole( 'heading', { level: 1 } ) ).toHaveCount( 1 );
await expect( page.getByText( 'Selected work', { exact: true } ) ).toBeVisible(); await expect( page.getByText( 'Proyectos', { exact: true } ) ).toBeVisible();
await expect( page.getByText( 'The No Names', { exact: true } ).first() ).toBeVisible(); await expect( page.getByText( 'The No Names', { exact: true } ).first() ).toBeVisible();
await expect( page.locator( 'picture source[type="image/avif"]' ).first() ).toHaveAttribute( await expect( page.locator( 'picture source[type="image/avif"]' ).first() ).toHaveAttribute(
'srcset', 'srcset',
@@ -516,7 +516,8 @@ test( 'lower home panels survive missing media and reduced motion', async ( { pa
expect( musicFallback.stageOverflow ).toBeLessThanOrEqual( 1 ); expect( musicFallback.stageOverflow ).toBeLessThanOrEqual( 1 );
await expect( page.locator( '.chrnx-home-music h2' ) ).toContainText( 'The No Names' ); await expect( page.locator( '.chrnx-home-music h2' ) ).toContainText( 'The No Names' );
await expect( page.locator( '.chrnx-home-music p' ) ).toHaveCount( 2 ); await expect( page.locator( '.chrnx-home-music p' ) ).toHaveCount( 2 );
await expect( page.locator( '.chrnx-home-projects h3' ) ).toHaveCount( 3 ); await expect( page.locator( '.chrnx-home-projects h2' ) ).toHaveText( 'Proyectos' );
await expect( page.locator( '.chrnx-home-projects p' ) ).toHaveCount( 1 );
await expect( page.locator( '.chrnx-home-about-preview p' ) ).not.toBeEmpty(); await expect( page.locator( '.chrnx-home-about-preview p' ) ).not.toBeEmpty();
await expect( page.locator( '.chrnx-subscribe-cta__link' ) ).toBeVisible(); await expect( page.locator( '.chrnx-subscribe-cta__link' ) ).toBeVisible();
-102
View File
@@ -1,102 +0,0 @@
const modulePath = '../../assets/js/editor-project.js';
function flatten( node ) {
if ( ! node || typeof node !== 'object' ) {
return [];
}
return [ node ].concat( ( node.children || [] ).flatMap( flatten ) );
}
function createWp( topicSlug = 'projects', meta = { unrelated: 'keep' } ) {
const editPost = jest.fn();
const registerPlugin = jest.fn();
const state = { meta, topic: [ 12 ] };
const wp = {
components: { ToggleControl: 'ToggleControl' },
i18n: { __: jest.fn( ( text ) => text ) },
data: {
select: ( store ) => {
if ( store === 'core/editor' ) {
return {
getCurrentPostType: () => 'post',
getEditedPostAttribute: ( key ) => state[ key ],
};
}
return {
getEntityRecord: () => ( topicSlug ? { id: 12, slug: topicSlug } : undefined ),
};
},
dispatch: () => ( { editPost } ),
useDispatch: ( store ) => wp.data.dispatch( store ),
useSelect: ( mapper ) => mapper( wp.data.select ),
},
editPost: { PluginDocumentSettingPanel: 'PluginDocumentSettingPanel' },
element: {
createElement: ( type, props, ...children ) => ( { type, props: props || {}, children } ),
},
plugins: { registerPlugin },
};
return { wp, editPost, registerPlugin };
}
function renderPanel( context ) {
const { initialize } = require( modulePath );
expect( initialize( context.wp ) ).toBe( true );
const [ , plugin ] = context.registerPlugin.mock.calls[ 0 ];
return plugin.render();
}
describe( 'project editor panel', () => {
beforeEach( () => {
jest.resetModules();
} );
test( 'refuses to initialize without the required editor globals', () => {
const { initialize } = require( modulePath );
expect( initialize( undefined ) ).toBe( false );
expect( initialize( {} ) ).toBe( false );
} );
test( 'renders the Selected work toggle only for the projects topic', () => {
const context = createWp( 'projects' );
const toggles = flatten( renderPanel( context ) ).filter(
( node ) => node.type === 'ToggleControl',
);
expect( toggles ).toHaveLength( 1 );
expect( toggles[ 0 ].props.checked ).toBe( false );
} );
test.each( [ 'podcasts', 'code', null ] )( 'renders nothing for the %s topic', ( slug ) => {
expect( renderPanel( createWp( slug ) ) ).toBeNull();
} );
test( 'reflects an existing flag and preserves unrelated meta when toggling', () => {
const context = createWp( 'projects', { unrelated: 'keep', chrnx_project_featured: true } );
const toggle = flatten( renderPanel( context ) ).find(
( node ) => node.type === 'ToggleControl',
);
expect( toggle.props.checked ).toBe( true );
toggle.props.onChange( false );
expect( context.editPost ).toHaveBeenCalledWith( {
meta: { unrelated: 'keep', chrnx_project_featured: false },
} );
} );
test( 'coerces the toggle value to a boolean', () => {
const context = createWp( 'projects' );
const toggle = flatten( renderPanel( context ) ).find(
( node ) => node.type === 'ToggleControl',
);
toggle.props.onChange( 'yes' );
expect( context.editPost ).toHaveBeenCalledWith( {
meta: { unrelated: 'keep', chrnx_project_featured: true },
} );
} );
test( 'updateMeta ignores a missing dispatcher', () => {
const { updateMeta } = require( modulePath );
expect( () => updateMeta( undefined, {}, 'chrnx_project_featured', true ) ).not.toThrow();
} );
} );
+2 -4
View File
@@ -45,7 +45,7 @@ class EditorAssetsTest extends WP_UnitTestCase {
* Clear only the CHRNX editor script state. * Clear only the CHRNX editor script state.
*/ */
private function reset_editor_scripts() { private function reset_editor_scripts() {
foreach ( array( 'chrnx-editor-taxonomies', 'chrnx-editor-podcast', 'chrnx-editor-project', 'chrnx-editor-track' ) as $handle ) { foreach ( array( 'chrnx-editor-taxonomies', 'chrnx-editor-podcast', 'chrnx-editor-track' ) as $handle ) {
wp_dequeue_script( $handle ); wp_dequeue_script( $handle );
wp_deregister_script( $handle ); wp_deregister_script( $handle );
} }
@@ -83,14 +83,13 @@ class EditorAssetsTest extends WP_UnitTestCase {
) )
); );
$this->assertSame( array( 'chrnx-editor-taxonomies', 'chrnx-editor-podcast', 'chrnx-editor-project', 'chrnx-editor-track' ), $handles ); $this->assertSame( array( 'chrnx-editor-taxonomies', 'chrnx-editor-podcast', 'chrnx-editor-track' ), $handles );
$expected_dependencies = array( 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins' ); $expected_dependencies = array( 'wp-components', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins' );
foreach ( foreach (
array( array(
'chrnx-editor-taxonomies' => 'assets/js/editor-taxonomies.js', 'chrnx-editor-taxonomies' => 'assets/js/editor-taxonomies.js',
'chrnx-editor-podcast' => 'assets/js/editor-podcast.js', 'chrnx-editor-podcast' => 'assets/js/editor-podcast.js',
'chrnx-editor-project' => 'assets/js/editor-project.js',
) as $handle => $asset ) as $handle => $asset
) { ) {
$this->assertArrayHasKey( $handle, $scripts->registered ); $this->assertArrayHasKey( $handle, $scripts->registered );
@@ -123,7 +122,6 @@ class EditorAssetsTest extends WP_UnitTestCase {
do_action( 'enqueue_block_editor_assets' ); do_action( 'enqueue_block_editor_assets' );
$this->assertFalse( wp_script_is( 'chrnx-editor-taxonomies', 'enqueued' ) ); $this->assertFalse( wp_script_is( 'chrnx-editor-taxonomies', 'enqueued' ) );
$this->assertFalse( wp_script_is( 'chrnx-editor-podcast', 'enqueued' ) ); $this->assertFalse( wp_script_is( 'chrnx-editor-podcast', 'enqueued' ) );
$this->assertFalse( wp_script_is( 'chrnx-editor-project', 'enqueued' ) );
$this->assertFalse( wp_script_is( 'chrnx-editor-track', 'enqueued' ) ); $this->assertFalse( wp_script_is( 'chrnx-editor-track', 'enqueued' ) );
} }
} }
+4 -3
View File
@@ -176,9 +176,10 @@ class EditorialQueriesTest extends WP_UnitTestCase {
); );
$this->assertSame( 3, $args['paged'] ); $this->assertSame( 3, $args['paged'] );
$this->assertSame( 'hello world', $args['s'] ); $this->assertSame( 'hello world', $args['s'] );
$this->assertCount( 2, $args['tax_query'] ); $this->assertCount( 4, $args['tax_query'] );
$this->assertSame( 'code', $args['tax_query'][0]['terms'] ); $this->assertSame( 'code', $args['tax_query'][0]['terms'] );
$this->assertSame( 'es', $args['tax_query'][1]['terms'] ); $this->assertSame( 'es', $args['tax_query'][1]['terms'] );
$this->assertSame( 'NOT EXISTS', $args['tax_query'][2]['operator'] );
} }
/** Real topic archives override conflicting request filters and never mix terms. */ /** Real topic archives override conflicting request filters and never mix terms. */
@@ -248,7 +249,7 @@ class EditorialQueriesTest extends WP_UnitTestCase {
$this->go_to( get_term_link( $tag ) ); $this->go_to( get_term_link( $tag ) );
$unsupported = chrnx_get_journal_request_context( array() ); $unsupported = chrnx_get_journal_request_context( array() );
$this->assertArrayNotHasKey( 'post_tag', $unsupported ); $this->assertArrayNotHasKey( 'post_tag', $unsupported );
$this->assertArrayNotHasKey( 'tax_query', chrnx_get_journal_query_args( $unsupported ) ); $this->assertSame( 'NOT EXISTS', chrnx_get_journal_query_args( $unsupported )['tax_query'][0]['operator'] );
} }
/** Show archives constrain Journal results to actual show membership. */ /** Show archives constrain Journal results to actual show membership. */
@@ -278,7 +279,7 @@ class EditorialQueriesTest extends WP_UnitTestCase {
) )
); );
$this->assertArrayNotHasKey( 'tax_query', $args ); $this->assertSame( 'NOT EXISTS', $args['tax_query'][0]['operator'] );
$this->assertSame( 1, $args['paged'] ); $this->assertSame( 1, $args['paged'] );
$search = $args['s'] ?? ''; $search = $args['s'] ?? '';
$this->assertLessThanOrEqual( 100, mb_strlen( $search, 'UTF-8' ) ); $this->assertLessThanOrEqual( 100, mb_strlen( $search, 'UTF-8' ) );
+8 -6
View File
@@ -103,8 +103,9 @@ class PatternsTest extends WP_UnitTestCase {
'Grunge mexicano para cerebros que no se callan.', 'Grunge mexicano para cerebros que no se callan.',
'grunge en español mexicano desde Sinaloa', 'grunge en español mexicano desde Sinaloa',
'estudio crudo, cero live', 'estudio crudo, cero live',
'generative AI', 'IA generativa',
'Chrnx', 'AI SLOP',
'Kurt Cobain',
) as $copy ) { ) as $copy ) {
$this->assertStringContainsString( $copy, wp_strip_all_tags( $content ), $copy ); $this->assertStringContainsString( $copy, wp_strip_all_tags( $content ), $copy );
} }
@@ -115,6 +116,7 @@ class PatternsTest extends WP_UnitTestCase {
'El Hermoso Caos que habita en mi cabeza', 'El Hermoso Caos que habita en mi cabeza',
'Ando Bien Arriba', 'Ando Bien Arriba',
'Aquí se Rompió una Jerga', 'Aquí se Rompió una Jerga',
'Side B',
) as $release ) { ) as $release ) {
$this->assertContains( $release, $releases, $release ); $this->assertContains( $release, $releases, $release );
} }
@@ -205,9 +207,9 @@ class PatternsTest extends WP_UnitTestCase {
public function test_character_led_patterns_use_the_exact_shared_stage_api() { public function test_character_led_patterns_use_the_exact_shared_stage_api() {
$contracts = array( $contracts = array(
'home-projects' => array( 'home-projects' => array(
'heading' => 'Selected work', 'heading' => 'Proyectos',
// The project names come from chrnx/selected-work now, not the pattern. // The project names come from the project list query now, not the pattern.
'order' => array( 'Selected work' ), 'order' => array( 'Proyectos' ),
'art' => 'alter-ego-code-768.webp', 'art' => 'alter-ego-code-768.webp',
'art_alt' => '', 'art_alt' => '',
'atmosphere' => 'chrnx-character-stage__secondary-art', 'atmosphere' => 'chrnx-character-stage__secondary-art',
@@ -354,7 +356,7 @@ class PatternsTest extends WP_UnitTestCase {
$this->assertSame( 0, $music_xpath->query( './*[2]//img[contains(@class,"chrnx-character-stage__collage")]', $music_stage )->length ); $this->assertSame( 0, $music_xpath->query( './*[2]//img[contains(@class,"chrnx-character-stage__collage")]', $music_stage )->length );
$this->assertSame( 1, $music_xpath->query( './*[3]//img[@alt="The No Names musician portrait"]', $music_stage )->length ); $this->assertSame( 1, $music_xpath->query( './*[3]//img[@alt="The No Names musician portrait"]', $music_stage )->length );
$this->assertSame( 3, $music_xpath->query( './*[2]/*[self::h2 or self::p]', $music_stage )->length ); $this->assertSame( 3, $music_xpath->query( './*[2]/*[self::h2 or self::p]', $music_stage )->length );
$process = $music_xpath->query( './p[contains(.,"El proceso usa generative AI")]', $music_root )->item( 0 ); $process = $music_xpath->query( './p[contains(. ,"Miren, miren: esto es")]', $music_root )->item( 0 );
$releases = $music_xpath->query( './h3[normalize-space()="Releases in progress"]', $music_root )->item( 0 ); $releases = $music_xpath->query( './h3[normalize-space()="Releases in progress"]', $music_root )->item( 0 );
$this->assertInstanceOf( DOMElement::class, $process ); $this->assertInstanceOf( DOMElement::class, $process );
$this->assertInstanceOf( DOMElement::class, $releases ); $this->assertInstanceOf( DOMElement::class, $releases );
+180
View File
@@ -0,0 +1,180 @@
<?php
/**
* Tests for the project blocks.
*
* @package CHRNX
*/
/**
* Verify project block rendering.
*/
class ProjectBlocksTest extends WP_UnitTestCase {
/**
* Register blocks and taxonomies before each test.
*/
public function set_up() {
parent::set_up();
do_action( 'init' );
}
/**
* Ensure the list renders one card per project with its status.
*/
public function test_project_list_renders_a_card_per_project() {
$term_id = self::factory()->term->create(
array(
'taxonomy' => 'chrnx_project',
'name' => 'Green Tea',
'slug' => 'green-tea-test',
)
);
update_term_meta( $term_id, 'chrnx_project_status', 'Beta' );
$markup = do_blocks( '<!-- wp:chrnx/project-list /-->' );
$this->assertStringContainsString( 'chrnx-project-card', $markup );
$this->assertStringContainsString( 'Green Tea', $markup );
$this->assertStringContainsString( 'Beta', $markup );
}
/**
* Ensure stored project links render with their platform icons.
*/
public function test_project_list_renders_stored_links() {
$term_id = self::factory()->term->create(
array(
'taxonomy' => 'chrnx_project',
'name' => 'Matcha CLI',
'slug' => 'matcha-cli-test',
)
);
update_term_meta( $term_id, 'chrnx_project_repo', 'https://example.com/repo' );
update_term_meta( $term_id, 'chrnx_project_package', 'https://example.com/package' );
$markup = do_blocks( '<!-- wp:chrnx/project-list /-->' );
$this->assertStringContainsString( 'chrnx-platform-links', $markup );
$this->assertStringContainsString( 'https://example.com/repo', $markup );
$this->assertStringContainsString( 'https://example.com/package', $markup );
}
/**
* Ensure a project without a cover still renders art.
*/
public function test_project_without_cover_uses_placeholder_art() {
self::factory()->term->create(
array(
'taxonomy' => 'chrnx_project',
'slug' => 'coverless-test',
)
);
$markup = do_blocks( '<!-- wp:chrnx/project-list /-->' );
$this->assertStringContainsString( 'chrnx-project-card__fallback', $markup );
}
/**
* Ensure the detail block renders the queried project header.
*/
public function test_project_detail_renders_the_queried_term() {
$term_id = self::factory()->term->create(
array(
'taxonomy' => 'chrnx_project',
'name' => 'Ailed',
'slug' => 'ailed-test',
'description' => 'A chess engine that feels.',
)
);
update_term_meta( $term_id, 'chrnx_project_repo', 'https://github.com/example/ailed' );
update_term_meta( $term_id, 'chrnx_project_status', 'Activo' );
$this->go_to( get_term_link( $term_id ) );
$markup = do_blocks( '<!-- wp:chrnx/project-detail /-->' );
$this->assertStringContainsString( 'A chess engine that feels.', $markup );
$this->assertStringContainsString( 'https://github.com/example/ailed', $markup );
$this->assertStringContainsString( 'Activo', $markup );
}
/**
* Ensure the detail block renders nothing outside a project archive.
*/
public function test_project_detail_is_silent_off_its_archive() {
$this->go_to( home_url( '/' ) );
$this->assertSame( '', trim( do_blocks( '<!-- wp:chrnx/project-detail /-->' ) ) );
}
/**
* Ensure a list card falls back to placeholder art when the stored cover
* attachment no longer exists, instead of rendering a blank art column.
*/
public function test_project_list_with_deleted_cover_uses_placeholder_art() {
$term_id = self::factory()->term->create(
array(
'taxonomy' => 'chrnx_project',
'slug' => 'deleted-cover-list-test',
)
);
update_term_meta( $term_id, 'chrnx_project_cover', 999999 );
$markup = do_blocks( '<!-- wp:chrnx/project-list /-->' );
// Scope the assertion to this term's own card: the taxonomy query is
// unfiltered, so other projects' cards must not mask a broken one.
$needle = 'chrnx_project=deleted-cover-list-test';
$link_offset = strpos( $markup, $needle );
$this->assertNotFalse( $link_offset, 'Expected a card linking to the test project.' );
$card_start = strrpos( substr( $markup, 0, $link_offset ), '<article' );
$card_end = strpos( $markup, '</article>', $link_offset );
$card = substr( $markup, $card_start, $card_end - $card_start );
$this->assertStringContainsString( 'chrnx-project-card__fallback', $card );
$this->assertStringNotContainsString( 'chrnx-project-card__cover', $card );
}
/**
* Ensure the detail block falls back to placeholder art when the stored
* cover attachment no longer exists, instead of rendering a blank art column.
*/
public function test_project_detail_with_deleted_cover_uses_placeholder_art() {
$term_id = self::factory()->term->create(
array(
'taxonomy' => 'chrnx_project',
'slug' => 'deleted-cover-detail-test',
)
);
update_term_meta( $term_id, 'chrnx_project_cover', 999999 );
$this->go_to( get_term_link( $term_id ) );
$markup = do_blocks( '<!-- wp:chrnx/project-detail /-->' );
$this->assertStringContainsString( 'chrnx-project-detail__fallback', $markup );
$this->assertStringNotContainsString( 'chrnx-project-detail__cover', $markup );
}
/**
* Ensure a project archive filters the journal to that project.
*/
public function test_project_archive_filters_the_journal() {
$term_id = self::factory()->term->create(
array(
'taxonomy' => 'chrnx_project',
'slug' => 'filter-test',
)
);
$mine = self::factory()->post->create( array( 'post_title' => 'Belongs to the project' ) );
self::factory()->post->create( array( 'post_title' => 'Unrelated post' ) );
wp_set_object_terms( $mine, array( $term_id ), 'chrnx_project' );
$this->go_to( get_term_link( $term_id ) );
$markup = do_blocks( '<!-- wp:chrnx/journal-stream /-->' );
$this->assertStringContainsString( 'Belongs to the project', $markup );
$this->assertStringNotContainsString( 'Unrelated post', $markup );
}
}
+55
View File
@@ -0,0 +1,55 @@
<?php
/**
* Tests for project term metadata.
*
* @package CHRNX
*/
/**
* Verify the project term meta contract.
*/
class ProjectMetaTest extends WP_UnitTestCase {
/**
* Register taxonomies and meta before each test.
*/
public function set_up() {
parent::set_up();
do_action( 'init' );
}
/**
* Ensure every project meta key is registered for the taxonomy.
*/
public function test_project_meta_keys_are_registered() {
$registered = get_registered_meta_keys( 'term', 'chrnx_project' );
foreach ( array_keys( chrnx_get_project_meta_definitions() ) as $meta_key ) {
$this->assertArrayHasKey( $meta_key, $registered );
}
}
/**
* Ensure a plain http repository URL is rejected.
*/
public function test_project_links_reject_insecure_urls() {
$term_id = self::factory()->term->create( array( 'taxonomy' => 'chrnx_project' ) );
update_term_meta( $term_id, 'chrnx_project_repo', 'http://example.com/repo' );
$this->assertArrayNotHasKey( 'repo', chrnx_get_project_links( $term_id ) );
}
/**
* Ensure stored https links come back keyed by their slot.
*/
public function test_project_links_return_stored_https_urls() {
$term_id = self::factory()->term->create( array( 'taxonomy' => 'chrnx_project' ) );
update_term_meta( $term_id, 'chrnx_project_repo', 'https://github.com/Expressive-Tea/green-tea' );
update_term_meta( $term_id, 'chrnx_project_package', 'https://www.npmjs.com/package/@green-tea/core' );
$links = chrnx_get_project_links( $term_id );
$this->assertSame( 'https://github.com/Expressive-Tea/green-tea', $links['repo'] );
$this->assertSame( 'https://www.npmjs.com/package/@green-tea/core', $links['package'] );
$this->assertArrayNotHasKey( 'site', $links );
}
}
+7
View File
@@ -50,6 +50,13 @@ class TaxonomiesTest extends WP_UnitTestCase {
'silicon-ranch' => 'Silicon Ranch', 'silicon-ranch' => 'Silicon Ranch',
), ),
), ),
'chrnx_project' => array(
'rest_base' => 'project',
'terms' => array(
'green-tea' => 'Green Tea',
'ailed' => 'Ailed',
),
),
); );
} }
+77
View File
@@ -37,6 +37,83 @@ class ThemeSetupTest extends WP_UnitTestCase {
$this->assertContains( 'assets/css/components.css', $editor_styles ); $this->assertContains( 'assets/css/components.css', $editor_styles );
} }
/**
* Ensure a Spanish post declares a Spanish document language.
*/
public function test_language_attributes_follow_a_spanish_post() {
$post_id = self::factory()->post->create();
wp_set_object_terms( $post_id, 'es', 'chrnx_language' );
$this->go_to( get_permalink( $post_id ) );
$this->assertTrue( is_singular( 'post' ) );
$this->assertSame( 'lang="es-MX"', chrnx_filter_language_attributes( 'lang="en-US"' ) );
}
/**
* Ensure an English post keeps the English document language.
*/
public function test_language_attributes_follow_an_english_post() {
$post_id = self::factory()->post->create();
wp_set_object_terms( $post_id, 'en', 'chrnx_language' );
$this->go_to( get_permalink( $post_id ) );
$this->assertSame( 'lang="en-US"', chrnx_filter_language_attributes( 'lang="en-US"' ) );
}
/**
* Ensure the direction attribute survives the language swap.
*/
public function test_language_attributes_preserve_other_attributes() {
$post_id = self::factory()->post->create();
wp_set_object_terms( $post_id, 'es', 'chrnx_language' );
$this->go_to( get_permalink( $post_id ) );
$this->assertSame( 'lang="es-MX" dir="ltr"', chrnx_filter_language_attributes( 'lang="en-US" dir="ltr"' ) );
}
/**
* Ensure a post without a language term is left untouched.
*/
public function test_language_attributes_ignore_a_post_without_a_language() {
$post_id = self::factory()->post->create();
$this->go_to( get_permalink( $post_id ) );
$this->assertSame( 'lang="en-US"', chrnx_filter_language_attributes( 'lang="en-US"' ) );
}
/**
* Ensure a language archive declares the language it lists.
*/
public function test_language_attributes_follow_a_language_archive() {
$post_id = self::factory()->post->create();
wp_set_object_terms( $post_id, 'es', 'chrnx_language' );
$this->go_to( get_term_link( 'es', 'chrnx_language' ) );
$this->assertTrue( is_tax( 'chrnx_language' ) );
$this->assertSame( 'lang="es-MX"', chrnx_filter_language_attributes( 'lang="en-US"' ) );
}
/**
* Ensure the home page keeps the site language.
*/
public function test_language_attributes_leave_the_home_page_alone() {
$this->go_to( home_url( '/' ) );
$this->assertSame( 'lang="en-US"', chrnx_filter_language_attributes( 'lang="en-US"' ) );
}
/**
* Ensure the head never advertises a comments feed the theme cannot render.
*/
public function test_comments_feed_is_not_advertised() {
$this->assertFalse( apply_filters( 'feed_links_show_comments_feed', true ) );
}
/** /**
* Ensure the local base stylesheet is enqueued with the theme version. * Ensure the local base stylesheet is enqueued with the theme version.
*/ */
+1 -1
View File
@@ -12,7 +12,7 @@ test('tooling is pinned and wp-env maps this repo as chrnx', async () => {
assert.equal(pkg.devDependencies['@wordpress/scripts'], '34.0.0'); assert.equal(pkg.devDependencies['@wordpress/scripts'], '34.0.0');
assert.equal(pkg.devDependencies['@playwright/test'], '1.62.1'); assert.equal(pkg.devDependencies['@playwright/test'], '1.62.1');
assert.equal(pkg.devDependencies.lighthouse, '13.4.1'); assert.equal(pkg.devDependencies.lighthouse, '13.4.1');
assert.equal(env.core, 'https://wordpress.org/wordpress-6.9.6.zip'); assert.equal(env.core, 'https://wordpress.org/wordpress-7.0.4.zip');
assert.equal(env.phpVersion, '8.3'); assert.equal(env.phpVersion, '8.3');
assert.equal(env.autoPort, false); assert.equal(env.autoPort, false);
assert.equal(env.port, 8888); assert.equal(env.port, 8888);
+13 -1
View File
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises'; import { readFile } from 'node:fs/promises';
import test from 'node:test'; import test from 'node:test';
const templates = [ 'home', 'single', 'page', 'archive', 'search', '404' ]; const templates = [ 'home', 'single', 'page', 'archive', 'search', '404', 'taxonomy-chrnx_project', 'taxonomy-chrnx_show', 'taxonomy-chrnx_release' ];
const readTemplate = (name) => readFile(new URL(`../../templates/${name}.html`, import.meta.url), 'utf8'); const readTemplate = (name) => readFile(new URL(`../../templates/${name}.html`, import.meta.url), 'utf8');
function assertBalancedBlockMarkup(markup, name) { function assertBalancedBlockMarkup(markup, name) {
@@ -104,3 +104,15 @@ test('404 offers concise recovery with search, Journal, and home links', async (
assert.match(markup, /wp:chrnx\/journal-link/); assert.match(markup, /wp:chrnx\/journal-link/);
assert.doesNotMatch(markup, /"url":"\//); assert.doesNotMatch(markup, /"url":"\//);
}); });
test('taxonomy-chrnx_project surfaces the project detail and its post stream', async () => {
const markup = await readTemplate('taxonomy-chrnx_project');
assert.match(markup, /wp:chrnx\/project-detail/);
assert.match(markup, /wp:chrnx\/journal-stream/);
});
test('taxonomy-chrnx_show surfaces show links and its episode stream', async () => {
const markup = await readTemplate('taxonomy-chrnx_show');
assert.match(markup, /wp:chrnx\/show-links/);
assert.match(markup, /wp:chrnx\/journal-stream/);
});
+6 -6
View File
@@ -140,7 +140,7 @@ test( 'media and review documentation matches the current inventory and cleanup
const readme = read( 'README.md' ); const readme = read( 'README.md' );
const plan = read( 'docs/superpowers/plans/2026-08-13-music-podcast-grunge-stages.md' ); const plan = read( 'docs/superpowers/plans/2026-08-13-music-podcast-grunge-stages.md' );
assert.match( readme, /76 generated files: 62 binary derivatives and 14 manifests/ ); assert.match( readme, /81 generated files: 66 binary derivatives and 15 manifests/ );
assert.match( readme, /eleven portrait families at 384 px and 768 px/ ); assert.match( readme, /eleven portrait families at 384 px and 768 px/ );
assert.match( readme, /three\s+landscape background families \(Podcast, About, and Projects\) at 384 px, 768 px,\s+and 1536 px/ ); assert.match( readme, /three\s+landscape background families \(Podcast, About, and Projects\) at 384 px, 768 px,\s+and 1536 px/ );
for ( const budget of [ '160 KiB', '260 KiB', '400 KiB', '340 KiB', '620 KiB', '3 MiB' ] ) { for ( const budget of [ '160 KiB', '260 KiB', '400 KiB', '340 KiB', '620 KiB', '3 MiB' ] ) {
@@ -469,7 +469,7 @@ test( 'all approved responsive media rebuild byte-identically within payload bou
assert.deepEqual( readdirSync( external ), [ 'sentinel' ] ); assert.deepEqual( readdirSync( external ), [ 'sentinel' ] );
execFileSync( './scripts/build-responsive-images.sh', [ output ], { cwd: new URL( '../..', import.meta.url ) } ); execFileSync( './scripts/build-responsive-images.sh', [ output ], { cwd: new URL( '../..', import.meta.url ) } );
const names = readdirSync( output ).sort(); const names = readdirSync( output ).sort();
assert.equal( names.length, 76 ); assert.equal( names.length, 81 );
for ( const name of [ for ( const name of [
'alter-ego-gaming-half-body-384.avif', 'alter-ego-gaming-half-body-384.avif',
'alter-ego-gaming-half-body-384.webp', 'alter-ego-gaming-half-body-384.webp',
@@ -684,7 +684,7 @@ printf 'partial-build-%s\n' "$count" > "$output"
} }
} ); } );
test( 'responsive promotion failure restores all 76 prior files', () => { test( 'responsive promotion failure restores all 81 prior files', () => {
const output = mkdtempSync( join( tmpdir(), 'chrnx-promotion-output-' ) ); const output = mkdtempSync( join( tmpdir(), 'chrnx-promotion-output-' ) );
const fakeBin = mkdtempSync( join( tmpdir(), 'chrnx-promotion-bin-' ) ); const fakeBin = mkdtempSync( join( tmpdir(), 'chrnx-promotion-bin-' ) );
const external = mkdtempSync( join( tmpdir(), 'chrnx-promotion-external-' ) ); const external = mkdtempSync( join( tmpdir(), 'chrnx-promotion-external-' ) );
@@ -697,7 +697,7 @@ test( 'responsive promotion failure restores all 76 prior files', () => {
try { try {
execFileSync( './scripts/build-responsive-images.sh', [ output ], { cwd: projectRoot } ); execFileSync( './scripts/build-responsive-images.sh', [ output ], { cwd: projectRoot } );
const published = new Map( readdirSync( output ).map( ( name ) => [ name, sha256( join( output, name ) ) ] ) ); const published = new Map( readdirSync( output ).map( ( name ) => [ name, sha256( join( output, name ) ) ] ) );
assert.equal( published.size, 76 ); assert.equal( published.size, 81 );
writeFileSync( sentinel, 'external-sentinel' ); writeFileSync( sentinel, 'external-sentinel' );
const sentinelHash = sha256( sentinel ); const sentinelHash = sha256( sentinel );
const realMv = execFileSync( '/bin/sh', [ '-c', 'command -v mv' ], { encoding: 'utf8' } ).trim(); const realMv = execFileSync( '/bin/sh', [ '-c', 'command -v mv' ], { encoding: 'utf8' } ).trim();
@@ -853,8 +853,8 @@ test( 'Music and Podcast patterns own one ordered three-layer landing compositio
music.indexOf( 'chrnx-character-stage__content' ), music.indexOf( 'chrnx-character-stage__content' ),
); );
assert.ok( assert.ok(
music.indexOf( 'El proceso usa generative AI' ) > music.indexOf( '<!-- /wp:group -->', music.indexOf( 'chrnx-character-stage__art' ) ) && music.indexOf( 'Miren, miren: esto es' ) > music.indexOf( '<!-- /wp:group -->', music.indexOf( 'chrnx-character-stage__art' ) ) &&
music.indexOf( 'El proceso usa generative AI' ) < music.indexOf( 'Releases in progress' ), music.indexOf( 'Miren, miren: esto es' ) < music.indexOf( 'Releases in progress' ),
); );
assertLayerOrder( podcast, 'Podcast layer order' ); assertLayerOrder( podcast, 'Podcast layer order' );