Skip to content

Replace pre-release feature includes with version-aware shortcode#1961

Merged
cderv merged 7 commits intoprereleasefrom
shortcode-callout
Mar 12, 2026
Merged

Replace pre-release feature includes with version-aware shortcode#1961
cderv merged 7 commits intoprereleasefrom
shortcode-callout

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Mar 11, 2026

Each release cycle requires manually editing per-version _pre-release-feature.qmd include files (and corresponding blog post includes) to toggle pre-release callouts on and off. This is error-prone and adds steps to the release checklist.

This replaces all _pre-release-feature.qmd and _quarto-X.Y-feature.qmd includes with a prerelease-callout shortcode that reads the site version from _quarto.yml and automatically determines whether to show a callout:

{{< prerelease-callout 1.5 >}}
{{< prerelease-callout 1.9 type="blog" >}}

The shortcode is added to the existing _extensions/prerelease/ extension (renamed from prerelease-docs-url/) alongside the existing prerelease-docs-url shortcode, sharing version-parsing helpers.

Changes

  • Consolidate _extensions/prerelease-docs-url/ into _extensions/prerelease/ with a single prerelease.lua containing both shortcodes
  • Replace all 14 _pre-release-feature.qmd includes across docs and blog posts
  • Replace all 5 blog post _quarto-X.Y-feature.qmd includes
  • Delete 9 now-unused include files

Version comparison scenarios (feature docs)

Phase Site version ref Unreleased? Output
1.9 in dev main 1.8 1.9 1.9 > 1.8 ✓ Pre-release callout
1.9 in dev prerelease 1.9 1.9 1.9 >= 1.9 ✓ Pre-release callout
1.9 released main 1.9 1.9 1.9 > 1.9 ✗ Nothing
1.9 released prerelease 2.0 1.9 1.9 >= 2.0 ✗ Nothing

Blog posts (type="blog") follow the same version logic, but instead of showing nothing when released, they show a "Quarto X.Y Feature" callout linking to the stable download page.

cderv added 7 commits March 11, 2026 16:49
Rename _extensions/prerelease-docs-url/ to _extensions/prerelease/ and
combine both shortcodes into a single Lua file with shared helpers:

- prerelease-docs-url: existing shortcode for prerelease subdomain links
- prerelease-callout: new shortcode that shows version-aware callouts
  for feature docs (hidden after release) and blog posts (switches from
  pre-release to released text)
Migrate 5 include references across 3 files (all version 1.5, already
released) to use the new version-aware shortcode instead.
Migrate 5 blog posts to use {{< prerelease-callout X.Y type="blog" >}}
instead of including shared _quarto-X.Y-feature.qmd files.
These files are no longer needed now that the prerelease-callout
shortcode generates callout content dynamically based on version.
Documents both shortcodes (prerelease-docs-url and prerelease-callout),
usage examples, and version comparison logic with scenario table.
Migrate 8 additional include references (only present on prerelease
branch) to use the version-aware prerelease-callout shortcode.
@cderv cderv requested a review from cwickham March 11, 2026 20:32
@github-actions github-actions bot temporarily deployed to pull request March 11, 2026 20:39 Inactive
@cderv
Copy link
Collaborator Author

cderv commented Mar 12, 2026

Preview verification — all 16 modified pages checked

Verified the preview at https://deploy-preview-1961.quarto.org against the expected shortcode behavior with site version: '1.8'.

Feature docs with ref=1.5 — no callout (3 pages)

Feature docs with ref=1.9 — "Pre-release Feature" callout (8 pages)

Blog posts with ref=1.3 type="blog" — "Quarto 1.3 Feature" callout (4 pages)

Blog post with ref=1.9 type="blog" — "Pre-release Feature" callout (1 page)

Download links also verified: pre-release callouts link to prerelease.html, released blog callouts link to download/index.html.

cderv added a commit to quarto-dev/quarto-cli that referenced this pull request Mar 12, 2026
quarto-dev/quarto-web#1961 replaces per-version `_pre-release-feature.qmd`
include files with an automatic `prerelease-callout` shortcode. Update
the release checklist to reflect that these files no longer need to be
created, and update the shortcode reference from the old extension name.
@cderv cderv merged commit d1d7e94 into prerelease Mar 12, 2026
4 checks passed
@cderv cderv deleted the shortcode-callout branch March 12, 2026 11:54
cderv added a commit to quarto-dev/quarto-cli that referenced this pull request Mar 12, 2026
quarto-dev/quarto-web#1961 replaces per-version `_pre-release-feature.qmd`
include files with an automatic `prerelease-callout` shortcode. Update
the release checklist to reflect that these files no longer need to be
created, and update the shortcode reference from the old extension name.
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