Skip to content

[Sync to prerelease] Replace prerelease-link-subdomain with version-aware shortcode#1943

Merged
cderv merged 1 commit intoprereleasefrom
sync-1939-to-prerelease
Mar 6, 2026
Merged

[Sync to prerelease] Replace prerelease-link-subdomain with version-aware shortcode#1943
cderv merged 1 commit intoprereleasefrom
sync-1939-to-prerelease

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 6, 2026

Description

Sync of #1939 to prerelease.

Original PR

Replace prerelease-link-subdomain with version-aware shortcode

prerelease-link-subdomain is phase-aware but not version-aware. On the next RC cycle (e.g. v1.10), old blog posts about v1.9 features would incorrectly flip back to prerelease.quarto.org even though those docs already moved to quarto.org.

Fix

Replace the variable with a prerelease-docs-url shortcode extension that takes a version argument:

[PDF Accessibility](https://{{< prerelease-docs-url 1.9 >}}quarto.org/docs/output-formats/pdf-accessibility.html)

The shortcode uses two rules:

  1. On the prerelease site (prerelease-docs profile active): always return prerelease.
  2. On quarto.org: compare the arg to the version key in _quarto.yml using pandoc.types.Version. If arg <= version, docs are on quarto.org (return ""). If arg > version, docs are still only on prerelease (return prerelease.).

A new version key in _quarto.yml tracks the current stable release ('1.8' on main today). The _quarto-prerelease-docs.yml overrides it to '1.9' but the shortcode never reaches the comparison on the prerelease site (rule 1 short-circuits). The version drops the v prefix for clean comparison; the announcement banner adds it back inline.

Lifecycle of a blog post

A blog post on main announces a v1.9 feature using {{< prerelease-docs-url 1.9 >}}. The blog post itself never changes — the links flip automatically as releases happen:

On quarto.org (version comparison):

Phase version in _quarto.yml Arg Comparison Link
v1.9 in development 1.8 1.9 1.9 > 1.8 prerelease.quarto.org
v1.9 RC 1.8 1.9 1.9 > 1.8 prerelease.quarto.org
v1.9 released (version bumped) 1.9 1.9 1.9 <= 1.9 quarto.org
v1.10 in development 1.9 1.9 1.9 <= 1.9 quarto.org

On prerelease.quarto.org (prerelease-docs profile short-circuits):

All links always go to prerelease.quarto.org regardless of version, since the prerelease site hosts its own copy of the docs.

Testing

Verified each lifecycle row by rendering a test blog post and checking output links. For rows requiring a specific version value, _quarto.yml was temporarily edited.

Phase Command version Result
v1.9 dev quarto render <post> 1.8 prerelease.quarto.org
v1.9 RC quarto render <post> --profile rc 1.8 prerelease.quarto.org
v1.9 released quarto render <post> 1.9 quarto.org
v1.10 dev quarto render <post> --profile prerelease 1.9 quarto.org
Prerelease site quarto render <post> --profile "prerelease,prerelease-docs" 1.9 prerelease.quarto.org

Both quoted ("1.9") and unquoted (1.9) argument forms work correctly.

Follow-up to #1932, relates to #1934 and #1938.

* Replace prerelease-link-subdomain with version-aware shortcode

The `prerelease-link-subdomain` variable is phase-aware but not
version-aware — on the next RC cycle, old blog posts would incorrectly
point to prerelease.quarto.org even though those docs already moved
to quarto.org.

Add a `prerelease-docs-url` shortcode extension that compares a
version argument against the `version` key in `_quarto.yml` to decide
whether docs live on quarto.org or prerelease.quarto.org. On the
prerelease site (prerelease-docs profile), it always returns
"prerelease." regardless of version.

Follow-up to #1932, relates to #1934.

* Update PDF accessibility blog post to use prerelease-docs-url shortcode

(cherry picked from commit 63a21f0)
@cderv
Copy link
Collaborator

cderv commented Mar 6, 2026

/deploy-preview

@github-actions
Copy link
Contributor Author

github-actions bot commented Mar 6, 2026

📝 Preview Deployment

🔍 Full site preview: https://deploy-preview-1943.quarto.org

🔄 Modified Documents

@cderv cderv merged commit 6faf61d into prerelease Mar 6, 2026
@cderv cderv deleted the sync-1939-to-prerelease branch March 6, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant