Skip to content

Commit 83a56a6

Browse files
Fix profile configuration for prerelease website (#1932) (#1937)
* Move prerelease-subdomain from phase profiles to base/site profiles prerelease-subdomain is a site concern (which domain am I on?), not a phase concern (prerelease vs RC). Previously, the rc profile set it to empty and the prerelease profile set it to 'prerelease.', which caused the main site to link to prerelease.quarto.org during dev phase. Now the base _quarto.yml defines prerelease-subdomain as empty (links to quarto.org) and only _quarto-prerelease-docs.yml overrides it to 'prerelease.' for the prerelease site. * Fix CI to explicitly activate prerelease profile for prerelease site When CI set QUARTO_PROFILE=prerelease-docs, the profile group [rc, prerelease] auto-added rc (the group default), giving the prerelease site RC branding. Adding 'prerelease' explicitly (prerelease,prerelease-docs) satisfies the group so the default is not auto-added. This also makes the prerelease site immune to "flip to RC" commits that reorder the profile group, eliminating empty cherry-picks when those commits are auto-backported to the prerelease branch. * Document profile system in README Explain the two-layer profile architecture (phase profiles vs site profile), what each _quarto-*.yml file does, the release lifecycle, and how to preview locally with different profiles. * Add prerelease-link-subdomain for phase-aware linking to prerelease docs Blog posts on main need to link to prerelease.quarto.org during RC phase (when docs only exist there) and switch to quarto.org after release. Unlike prerelease-subdomain (site identity), this variable is phase-aware: - Default: '' (links to quarto.org) - RC profile: 'prerelease.' (docs still on prerelease site) - prerelease-docs profile: 'prerelease.' (prerelease site links to itself) (cherry picked from commit 8516589) Co-authored-by: Christophe Dervieux <christophe.dervieux@gmail.com>
1 parent c15681d commit 83a56a6

7 files changed

Lines changed: 69 additions & 5 deletions

File tree

.github/workflows/preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
- name: Render
104104
uses: quarto-dev/quarto-actions/render@v2
105105
env:
106-
QUARTO_PROFILE: ${{ steps.prerelease-docs-check.outputs.is_prerelease_docs == 'true' && 'prerelease-docs' || '' }}
106+
QUARTO_PROFILE: ${{ steps.prerelease-docs-check.outputs.is_prerelease_docs == 'true' && 'prerelease,prerelease-docs' || '' }}
107107

108108
- name: Deploy Preview to Netlify as preview
109109
id: netlify-deploy

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Render
4848
uses: quarto-dev/quarto-actions/render@v2
4949
env:
50-
QUARTO_PROFILE: ${{ (inputs.prerelease || (contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/prerelease')) && 'prerelease-docs' || '' }}
50+
QUARTO_PROFILE: ${{ (inputs.prerelease || (contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && github.ref == 'refs/heads/prerelease')) && 'prerelease,prerelease-docs' || '' }}
5151

5252
- name: Publish release website
5353
# Only do this step if

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,65 @@ quarto run tools/reference.ts
105105

106106
This builds the `.json` files in `docs/references` based on the [Quarto CLI schema](https://github.com/quarto-dev/quarto-cli/tree/main/src/resources/schema). The script assumes you have `quarto-cli/` at the same level in your directory structure as `quarto-web/`.
107107

108+
## Profile System
109+
110+
This project uses [Quarto profiles](https://quarto.org/docs/projects/profiles.html) to build two sites from the same source: [quarto.org](https://quarto.org/) and [prerelease.quarto.org](https://prerelease.quarto.org/).
111+
112+
### Two-layer architecture
113+
114+
**Phase profiles** (`rc` / `prerelease`) control release-phase branding. They are declared as a [profile group](https://quarto.org/docs/projects/profiles.html#profile-groups) in `_quarto.yml`:
115+
116+
```yaml
117+
profile:
118+
group:
119+
- [rc, prerelease] # first entry is the default
120+
```
121+
122+
The group order determines which phase is active on **quarto.org** (the main site). Flipping the order (e.g. `[rc, prerelease]` to `[prerelease, rc]`) switches the main site between "Release Candidate" and "Pre-release" branding.
123+
124+
| File | Purpose |
125+
|---|---|
126+
| `_quarto-prerelease.yml` | Phase variables for the pre-release/development phase |
127+
| `_quarto-rc.yml` | Phase variables for the release candidate phase |
128+
129+
**Site profile** (`prerelease-docs`) configures everything specific to prerelease.quarto.org: site URL, announcement banner, search index, theme, and the `prerelease-subdomain` variable.
130+
131+
| File | Purpose |
132+
|---|---|
133+
| `_quarto-prerelease-docs.yml` | Site-specific configuration for prerelease.quarto.org |
134+
135+
### Subdomain variables
136+
137+
Two variables control how links resolve across builds. Both use the same pattern — `https://{{< meta VAR >}}quarto.org/...` — but serve different purposes:
138+
139+
| Variable | Purpose | Default | Set by `rc` | Set by `prerelease-docs` |
140+
|---|---|---|---|---|
141+
| `prerelease-subdomain` | **Site identity** — "am I the prerelease site?" | `''` | — | `prerelease.` |
142+
| `prerelease-link-subdomain` | **Content linking** — "where do prerelease docs live right now?" | `''` | `prerelease.` | `prerelease.` |
143+
144+
Use `prerelease-subdomain` for self-referential links (e.g. RevealJS demo links back to its own site). Use `prerelease-link-subdomain` for content on `main` that references docs only available on prerelease during RC phase (e.g. blog posts announcing upcoming features).
145+
146+
### Release lifecycle
147+
148+
1. **Development phase:** group is `[prerelease, rc]` — main site shows "Pre-release"
149+
2. **RC phase:** flip group to `[rc, prerelease]` — main site shows "Release Candidate"
150+
3. **Release:** flip back to `[prerelease, rc]` for the next development cycle
151+
152+
These flips only affect quarto.org. The prerelease site CI explicitly activates `prerelease,prerelease-docs`, so it always shows "Pre-release" regardless of group order.
153+
154+
### Local preview
155+
156+
```bash
157+
# Main site with RC branding
158+
quarto preview --profile rc
159+
160+
# Main site with pre-release branding (default when prerelease is first in group)
161+
quarto preview
162+
163+
# Prerelease site
164+
quarto preview --profile prerelease,prerelease-docs
165+
```
166+
108167
## GitHub Action Workflows
109168

110169
Our GitHub Action workflows are documented in [`.github/workflows/README.md`](.github/workflows/README.md)

_quarto-prerelease-docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Pre-release version number
22
version: v1.9
33

4+
prerelease-subdomain: prerelease.
5+
prerelease-link-subdomain: prerelease.
6+
47
website:
58
title: "Quarto (Pre-release)"
69
image: "quarto-dark-bg-pre.jpeg"

_quarto-prerelease.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
prerelease-title: Pre-release
22
prerelease-lower: pre-release
3-
prerelease-mode: ""
4-
prerelease-subdomain: prerelease.
3+
prerelease-mode: ""

_quarto-rc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
prerelease-title: Release Candidate
22
prerelease-lower: release candidate
33
prerelease-mode: Release Candidate
4-
prerelease-subdomain: ''
4+
prerelease-link-subdomain: prerelease.

_quarto.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,9 @@ filters:
712712
- at: post-quarto
713713
path: filters/include-dark.lua
714714

715+
prerelease-subdomain: ''
716+
prerelease-link-subdomain: ''
717+
715718
freeze: true
716719

717720
profile:

0 commit comments

Comments
 (0)