@jxsuite/site 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/site",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "What a Jx project's page at a route consists of — routing, layout, context, head and the document that boots it",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "test:coverage": "bun test --isolate --coverage"
32
32
  },
33
33
  "dependencies": {
34
- "@jxsuite/runtime": "^3.0.0",
35
- "@jxsuite/schema": "^2.0.0"
34
+ "@jxsuite/runtime": "^3.1.0",
35
+ "@jxsuite/schema": "^2.1.0"
36
36
  }
37
37
  }
@@ -18,6 +18,7 @@
18
18
  * Cloudflare Worker serving a live preview — assemble the same `<head>` the build does.
19
19
  */
20
20
 
21
+ import { siteAbsoluteUrl } from "@jxsuite/schema/asset-paths";
21
22
  import type { JxHeadEntry } from "@jxsuite/schema/types";
22
23
 
23
24
  /** What a page knows about itself while its `<head>` is being merged. */
@@ -74,7 +75,10 @@ export function mergeHead(
74
75
 
75
76
  // Add canonical URL if provided
76
77
  if (context.pageUrl && context.siteUrl) {
77
- const canonical = new URL(context.pageUrl, context.siteUrl).href;
78
+ /* Resolved as a RELATIVE-path reference so a `siteUrl` with a path keeps it: RFC 3986 §5.2
79
+ replaces the whole path for an absolute-path reference, which would point every canonical
80
+ link and `og:url` on a subpath deployment at a page the origin root does not serve. */
81
+ const canonical = siteAbsoluteUrl(context.pageUrl, context.siteUrl);
78
82
  /*
79
83
  * An author-supplied canonical wins, like every other auto-injected entry (§8.4). This used a
80
84
  * hand-written `link:canonical` key that `headEntryKey` never produces, so the author's entry
package/src/site-style.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * origin, which passes identity because a browser tab IS the viewport.
14
14
  */
15
15
 
16
- import { pureSchemeOf, resolveAtQuery, schemeSelectors, camelToKebab } from "@jxsuite/runtime";
16
+ import { camelToKebab, pureSchemeOf, resolveAtQuery, schemeSelectors } from "@jxsuite/runtime/css";
17
17
 
18
18
  /** Id of the injected site-style tag (replace-in-place, never accumulate). */
19
19
  export const SITE_STYLE_ID = "jx-site-style";