diff --git a/.monorepo-source.json b/.monorepo-source.json index 73a03b3..5b2f84a 100644 --- a/.monorepo-source.json +++ b/.monorepo-source.json @@ -1,7 +1,7 @@ { "productId": "funkycommerce-headless", "repository": "coded-letter/superfunky-theme", - "source": "coded-letter/coded-letter-monorepo@cf26b9dbcecfd5ce323b5007f3916b88198a50f3", + "source": "coded-letter/coded-letter-monorepo@4bd66b81aefe8683e36c4dc7e2106c9ab8b92b7d", "sourcePath": "workspace/backend/wordpress/themes/free/funkycommerce-headless", "installSlug": "funkycommerce-headless", "kind": "theme", diff --git a/functions.php b/functions.php index e4bb6fd..39af708 100644 --- a/functions.php +++ b/functions.php @@ -9,7 +9,7 @@ exit; } -define( 'FUNKYCOMMERCE_HEADLESS_VERSION', '1.2.29' ); +define( 'FUNKYCOMMERCE_HEADLESS_VERSION', '1.2.30' ); /** * Whether Superfunky Pro is active and licensed. diff --git a/inc/artifact-renderer.php b/inc/artifact-renderer.php index e3d9a75..613498b 100644 --- a/inc/artifact-renderer.php +++ b/inc/artifact-renderer.php @@ -310,6 +310,12 @@ private static function resolve_current_singular_route( $path ) { 'types' => array_keys( $post_type_objects ), ), ); + if ( preg_match( '#^(?:[a-z]{2}(?:-[a-z0-9]+)*/)?blog/([^/]+)$#i', $request, $post_match ) ) { + $candidates[] = array( + 'path' => $post_match[1], + 'types' => array( 'post' ), + ); + } foreach ( $post_type_objects as $post_type => $post_type_object ) { $rewrite_slug = is_array( $post_type_object->rewrite ?? null ) ? trim( (string) ( $post_type_object->rewrite['slug'] ?? '' ), '/' ) @@ -334,7 +340,9 @@ private static function resolve_current_singular_route( $path ) { continue; } FunkyCommerce_Artifact_Store::record_worker_trace( $path, 'singular-found', 0 ); - $canonical_path = self::path_from_url( self::frontend_url_for_backend_url( get_permalink( $post ) ) ); + $canonical_path = 'post' === $post->post_type + ? self::frontend_post_path( $post ) + : self::path_from_url( self::frontend_url_for_backend_url( get_permalink( $post ) ) ); if ( $path !== $canonical_path ) { continue; } @@ -1508,11 +1516,6 @@ private static function route_seed_entries( $route, $rendered, $dependencies ) { if ( 'page' === $route['object']->post_type ) { $keys[] = 'page:' . $uri; $keys[] = 'content-page-by-uri:v1:' . $uri; - } elseif ( 'product' === $route['object']->post_type ) { - $keys[] = 'product:' . $uri; - $keys[] = 'product:' . $route['object']->post_name; - } else { - $keys[] = 'post:' . $uri; } } @@ -1527,6 +1530,19 @@ private static function route_seed_entries( $route, $rendered, $dependencies ) { return $entries; } + /** + * Return the canonical storefront path for a WordPress post. + * + * @param WP_Post $post Post. + * @return string|null + */ + private static function frontend_post_path( $post ) { + $language = function_exists( 'pll_get_post_language' ) ? strtolower( (string) pll_get_post_language( $post->ID, 'slug' ) ) : ''; + $default_language = function_exists( 'pll_default_language' ) ? strtolower( (string) pll_default_language( 'slug' ) ) : ''; + $prefix = $language && $default_language && $language !== $default_language ? '/' . $language : ''; + return funkycommerce_normalize_artifact_route( $prefix . '/blog/' . $post->post_name ); + } + /** * Complete route data for cache keys whose frontend shape is stable. * diff --git a/package-lock.json b/package-lock.json index 807d489..983ae7c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "funkycommerce-headless-theme", - "version": "1.2.29", + "version": "1.2.30", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "funkycommerce-headless-theme", - "version": "1.2.29", + "version": "1.2.30", "devDependencies": { "autoprefixer": "^10.4.20", "esbuild": "^0.28.2", diff --git a/package.json b/package.json index c53c136..d776c0d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "funkycommerce-headless-theme", "private": true, - "version": "1.2.29", + "version": "1.2.30", "description": "Tailwind/build tooling for the FunkyCommerce Headless WordPress theme's native frontend assets (block templates, template parts, loader, and Spotify slot).", "scripts": { "build:css": "tailwindcss -i ./assets/css/theme-source.css -o ./assets/dist/theme.css --minify", diff --git a/readme.txt b/readme.txt index 3504bf2..f511b77 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: headless, woocommerce, wpgraphql, full-site-editing Requires at least: 6.7 Tested up to: 6.8 Requires PHP: 7.4 -Stable tag: 1.2.29 +Stable tag: 1.2.30 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -15,6 +15,12 @@ Control Center, the theme also ships a complete native WordPress rendering path "Native frontend theme" below) with accessible header/footer/navigation templates and core front/home/singular/archive/search/404 routes styled to match the storefront. +== 1.2.30 highlights == + +* Resolves canonical storefront blog routes to their published WordPress posts during artifact generation. +* Keeps ready artifact markup visible while richer product, post, author, and taxonomy data hydrates in the background. +* Avoids seeding product and post caches with the artifact renderer's intentionally generic server payload. + == 1.2.29 highlights == * Aligns product artifact hydration keys with the storefront's canonical trailing-slash routes. diff --git a/style.css b/style.css index 8860065..a98f3ba 100644 --- a/style.css +++ b/style.css @@ -7,7 +7,7 @@ Description: A minimal, content-first block theme for polished WordPress preview Requires at least: 6.7 Tested up to: 6.8 Requires PHP: 7.4 -Version: 1.2.29 +Version: 1.2.30 Update URI: https://github.com/coded-letter/superfunky-theme License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html