Skip to content

PR preview doesn't process shared content /version/ links correctly #6674

@jstirnaman

Description

@jstirnaman

Problem

PR preview builds don't correctly process /version/ links in shared content files. The links render as literal /influxdb/version/ or /influxdb3/version/ instead of being replaced with the actual product path (e.g., /influxdb3/cloud-dedicated/).

Expected behavior

In production, the link replacement logic in layouts/partials/article/content.html correctly transforms links like /influxdb/version/query-data/parameterized-queries/ to /influxdb3/cloud-dedicated/query-data/influxql/parameterized-queries/.

Observed behavior in PR preview

Root cause

The PR preview build process may not be using the same Hugo configuration or partial processing as production builds. The relevant code is in layouts/partials/article/content.html:

{{ $linkRegex := print (replaceRE `[0-9]` "" $product) "(?:[0-9])*" "/version" }}
{{ readFile .Params.source | replaceRE $linkRegex (print $product "/" $version) | .RenderString | safeHTML }}

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions