diff --git a/.gitignore b/.gitignore index 043a0bd5..b0e39ede 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ src/static/* !src/static/bloblang-docs.json !src/static/widget-test.html !src/static/redpanda-properties.json +!src/static/connect.json test-results.* test-results-*.* .playwright-mcp/ diff --git a/gulp.d/tasks/generate-bloblang-grammar.js b/gulp.d/tasks/generate-bloblang-grammar.js index 572a0464..08c02acc 100644 --- a/gulp.d/tasks/generate-bloblang-grammar.js +++ b/gulp.d/tasks/generate-bloblang-grammar.js @@ -6,7 +6,7 @@ const log = require('fancy-log') const https = require('https') const ANTORA_YML_URL = 'https://raw.githubusercontent.com/redpanda-data/rp-connect-docs/main/antora.yml' -const CONNECT_JSON_BASE = 'https://docs.redpanda.com/redpanda-connect/components/_attachments' +const CONNECT_JSON_BASE = 'https://docs.redpanda.com/connect/components/_attachments' const FALLBACK_VERSIONS = ['4.79.0', '4.78.0', '4.77.0', '4.76.0', '4.75.0'] function fetchText (url) { diff --git a/src/css/doc.css b/src/css/doc.css index 95b71421..9d997447 100644 --- a/src/css/doc.css +++ b/src/css/doc.css @@ -946,7 +946,7 @@ html[data-theme="dark"] .doc #preamble > .sectionbody > .paragraph:first-child > gap: 12px; padding: 14px 16px; border-radius: 10px; - font-size: calc(16 / var(--rem-base) * 1rem); + font-size: calc(17.5 / var(--rem-base) * 1rem); line-height: 1.55; } diff --git a/src/helpers/resolve-resource.js b/src/helpers/resolve-resource.js index 3ece3001..96933cfe 100644 --- a/src/helpers/resolve-resource.js +++ b/src/helpers/resolve-resource.js @@ -41,6 +41,7 @@ function logUnresolved (resource, reason, page, context, logger) { module.exports = (resource, { data, hash: context }) => { const { page, logger } = data.root || {} + const fallbackUrl = context?.fallback // Log and return undefined if resource is not provided if (!resource || typeof resource !== 'string') { @@ -48,7 +49,7 @@ module.exports = (resource, { data, hash: context }) => { if (page && resource === undefined) { logUnresolved('undefined', 'attribute not defined (check page attributes)', page, context, logger) } - return undefined + return fallbackUrl || undefined } // External URLs pass through @@ -129,8 +130,11 @@ module.exports = (resource, { data, hash: context }) => { if (file) { result = file.pub.url + } else if (fallbackUrl) { + // Use fallback URL when resource not in content catalog + result = fallbackUrl } else { - // Log warning for unresolved resource + // Log warning for unresolved resource (only if no fallback provided) logUnresolved(resolvedResource, 'target not found in content catalog', page, context, logger) result = resource } diff --git a/src/partials/head-meta.hbs b/src/partials/head-meta.hbs index 68a90fcc..3193ee8d 100644 --- a/src/partials/head-meta.hbs +++ b/src/partials/head-meta.hbs @@ -9,26 +9,57 @@ {{#with (or site.components.streaming site.components.ROOT)}} {{/with}} -{{!-- Properties JSON: use page's version for ROOT component, site latest for others --}} +{{!-- + Properties JSON URL for property tooltips + + Resolution strategy: + 1. Use available-properties-tag (set by extension to highest version with JSON in catalog) + 2. Fall back to latest-redpanda-tag for backwards compatibility + 3. If resource not in catalog, fall back to production URL + + Version context: + - Streaming pages: Use page.version (readers on /25.3/ get 25.3's JSON) + - Non-streaming pages: Use streaming.latest.version (cloud/connect get latest streaming JSON) + + Fallback URLs point to production to ensure tooltips work even when: + - Running preview builds without full content catalog + - JSON hasn't been published yet for the specified version +--}} {{#if page.componentVersion.asciidoc.attributes.latest-redpanda-tag}} -{{!-- ROOT component page: use this version's tag for both meta and URL --}} - - +{{!-- Streaming component: resolve against page's own version --}} +{{#with (or page.componentVersion.asciidoc.attributes.available-properties-tag page.componentVersion.asciidoc.attributes.latest-redpanda-tag)}} + + +{{/with}} {{else}} -{{!-- Non-ROOT component (cloud, connect): use ROOT's latest --}} -{{#with site.components.ROOT}} +{{!-- Non-streaming (cloud, connect): resolve against streaming's latest version --}} +{{#with (or site.components.streaming site.components.ROOT)}} {{#if this.latest.asciidoc.attributes.latest-redpanda-tag}} - - +{{#with (or this.latest.asciidoc.attributes.available-properties-tag this.latest.asciidoc.attributes.latest-redpanda-tag)}} + + +{{/with}} {{/if}} {{/with}} {{/if}} -{{!-- Redpanda Connect JSON for Bloblang tooltips --}} -{{#with (or site.components.redpanda-connect site.components.connect)}} +{{!-- + Connect JSON URL for Bloblang tooltips + + Resolution strategy: + 1. Use available-connect-version (set by extension to highest version with JSON in catalog) + 2. Fall back to latest-connect-version for backwards compatibility + 3. If resource not in catalog, fall back to production URL + + Connect component is versionless, so URLs use /connect/components/... (no version segment) +--}} +{{#with (or site.components.connect site.components.redpanda-connect)}} {{#if this.latest.asciidoc.attributes.latest-connect-version}} - +{{#with (or this.latest.asciidoc.attributes.available-connect-version this.latest.asciidoc.attributes.latest-connect-version)}} + +{{/with}} {{/if}} {{/with}} +{{!-- Opt-out: page authors can set :disable-property-tooltips: to suppress tooltips --}} {{#if page.attributes.disable-property-tooltips}} {{/if}}