Skip to content

Commit 0106beb

Browse files
committed
Merge branch 'feature/improve-alias-warn' into bugfix/issue-12598
2 parents 8eb9cc8 + 14e71dc commit 0106beb

File tree

10 files changed

+1984
-1942
lines changed

10 files changed

+1984
-1942
lines changed

CITATION.cff

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ authors:
2020
given-names: "Gordon"
2121
orcid: "https://orcid.org/0009-0005-1809-8936"
2222
title: "Quarto"
23-
version: 1.6
23+
version: 1.7
2424
doi: 10.5281/zenodo.5960048
25-
date-released: 2024-11-27
25+
date-released: 2025-04-28
2626
url: "https://github.com/quarto-dev/quarto-cli"

configuration

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export ALGOLIA_SEARCH_INSIGHTS_JS=2.0.3
6161

6262

6363
# Quarto Info Version
64-
export QUARTO_VERSION=1.7
64+
export QUARTO_VERSION=1.8
6565
export QUARTO_NAME=Quarto
6666

6767
# Folder names. These are not the same as paths (those variable names end in _PATH).

dev-docs/checklist-make-a-new-quarto-release.md

+18-17
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@
22
- [ ] create a branch `v1.x`, where x is the version being released
33
- `git checkout -b v1.4`
44
- `git push origin v1.4`
5-
- [ ] mark the current release as the stable release in the `main` branch
5+
- [ ] mark the current release as the new release in the `main` branch
66
- [ ] edit QUARTO_VERSION line in `/configuration` to be the new version (e.g. `1.5`)
77
- [ ] push the changes to the `main` branch
88
- [ ] kick off a v1.5 build in GHA: https://github.com/quarto-dev/quarto-cli/actions/workflows/create-release.yml
99
- [ ] ensure the build completes successfully
1010
- [ ] mark v1.4 release as stable
11-
- go to https://github.com/quarto-dev/quarto-cli/releases
12-
- find the latest v1.4 release and edit, (eg https://github.com/quarto-dev/quarto-cli/releases/edit/v1.4.549)
13-
- at the bottom of the page, there will be two checkboxes, "Set as pre-release" and "Set as latest release":
14-
- "Set as pre-release" should be unchecked, and
15-
- "Set as latest release" should be checked.
11+
- [ ] go to https://github.com/quarto-dev/quarto-cli/releases
12+
- [ ] find the latest v1.4 release and edit, (eg https://github.com/quarto-dev/quarto-cli/releases/edit/v1.4.549)
13+
- [ ] at the bottom of the page, there will be two checkboxes, "Set as pre-release" and "Set as latest release":
14+
- [ ] "Set as pre-release" should be unchecked, and
15+
- [ ] "Set as latest release" should be checked.
1616
- [ ] once the v1.5 build completes, edit the quarto.org website configuration on https://github.com/quarto-dev/quarto-web to reflect the new version
1717
- this means flipping the profile group configuration in `_quarto.yml` from `[rc,prelease]` to `[prerelease,rc]`
1818
- [ ] push the changes to the `main` branch
1919
- [ ] quarto-dev/quarto-web changes
20-
2120
- wait for the downloads file to be automatically updated by the GitHub Action on https://github.com/quarto-dev/quarto-web
2221
- [ ] wait for https://github.com/quarto-dev/quarto-web/actions/workflows/update-downloads.yml to run (it runs every 15 minutes, or you can manually trigger it)
2322
- This workflow run rendered the website: https://github.com/quarto-dev/quarto-web/actions/runs/12016407762
@@ -30,20 +29,22 @@
3029
- [ ] create `docs/prerelease/1.5/{_highlights, index, _pre-release-feature}.qmd` files based on the ones from the previous release
3130
- [ ] change `docs/prerelease/_highlights.qmd` so its include points to the new version-specific `_highlights.qmd` file (here, 1.5)
3231
- [ ] change `docs/prerelease/_highlights-release.qmd` so its include points to the new version-specific `_highlights.qmd` file (here, 1.4)
33-
- [ ] add the stable version to the older downloads list, like [this example](https://github.com/quarto-dev/quarto-web/commit/85ef62ec5036026d62d57f9cfb190d8b923b2d43)
34-
- [ ] run `quarto run tools/release-notes.R` to generate the release notes
32+
- [ ] add the stable version to the older downloads list by editing /docs/download/_download-older.yml
33+
- [ ] run `quarto run tools/release-notes.R` to generate the release notes
3534
- [ ] push the changes to `prerelease` branch, ensure they build correctly
36-
- [ ] Merge the `prerelease` branch into `main`
35+
- [ ] Merge the `prerelease` branch into `main`, push to `main`
3736
- [ ] ensure the build completes successfully
38-
- [ ] Merge `main` into `prerelease`
37+
- [ ] Merge `main` into `prerelease`, push to `prerelease`
3938
- [ ] ensure the build completes successfully
40-
- [ ] Create new tag on `main` (here, `v1.5`)
41-
- [ ] `git tag -a v1.5 -m "v1.5"`
42-
- [ ] `git push origin v1.5`
39+
- [ ] Create new tag on `main` with stable release version number (here, `v1.4`) to mark when the new main site version went live
40+
- [ ] `git tag -a v1.4 -m "v1.4"`
41+
- [ ] `git push origin v1.4`
4342
- [ ] Update `prerelease` version number (here, `v1.5`)
4443
- [ ] edit `_quarto-prerelease-docs.yml` to point to the new version
4544
- [ ] publish the release blog post that should exist in https://github.com/quarto-dev/quarto-web/tree/main/docs/blog/posts
46-
by removing the `draft: true` line in the metadata and changing the date to match the release date. Do this on a branch off of `main` to trigger our PR automation to make the corresponding change to `prerelease`.
45+
- [ ] Create a branch off of `main` (to trigger our PR automation to make the corresponding change to `prerelease`).
46+
- [ ] Removing the `draft: true` line in the metadata
47+
- [ ] Change the date to match the release date.
4748

4849
- [ ] Update https://github.com/quarto-dev/quarto-cli/blob/main/CITATION.cff
4950
- [ ] Packaging and package managers, etc
@@ -55,8 +56,8 @@
5556
- Check the "Whether to publish or not the package on chocolatey" checkbox
5657
- Wait for @cderv to receive email confirmation, no action needed
5758
- [ ] pypi
58-
- Goto the [quarto-cli-pypi repo](https://github.com/quarto-dev/quarto-cli-pypi)
59-
- Update `version.txt` to be the version you'd like to publish and commit
59+
- Go to the [quarto-cli-pypi repo](https://github.com/quarto-dev/quarto-cli-pypi)
60+
- [ ] Update `version.txt` to be the version you'd like to publish and commit
6061
- Go to actions
6162
- Select 'Publish Quarto PyPi'
6263
- [ ] Click "Run Workflow"

news/changelog-1.8.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
All changes included in 1.8:
2+
3+
## Projects
4+
5+
### `website`
6+
7+
- ([#12551](https://github.com/quarto-dev/quarto-cli/pull/12551)): Improve warning issued when `aliases` would overwrite an existing document.

src/project/types/website/website-aliases.ts

+11-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,17 @@ export async function updateAliases(
106106

107107
// Write the redirect file
108108
if (allOutputFiles.find((outputFile) => outputFile === targetFile)) {
109-
// Do not, this is the same name as an output file!
110-
warning(
111-
`Aliases that you have created would overwrite the output file ${targetFile}. The aliases file was not created.`,
112-
);
109+
for (
110+
const offendingAlias of targetHrefs.filter(
111+
(targetHref) =>
112+
targetHref.href ===
113+
relative(dirname(targetHref.outputFile), targetFile),
114+
)
115+
) {
116+
warning(
117+
`Requested alias ${targetFile} -> ${offendingAlias.outputFile} would overwrite the target. Skipping.`,
118+
);
119+
}
113120
} else {
114121
// Write, this is a safe file
115122
writeMultipleRedirectPage(targetFile, redirects);

src/resources/formats/html/giscus/giscus.ejs

+20
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,25 @@
1313
<%- giscus.loading ? `data-loading=${giscus.loading}` : '' %>
1414
async>
1515
</script>
16+
<script type="application/javascript">
17+
const giscusIframeObserver = new MutationObserver(function (mutations) {
18+
mutations.forEach(function (mutation) {
19+
mutation.addedNodes.forEach(function (addedNode) {
20+
if (addedNode.matches && addedNode.matches('div.giscus')) {
21+
const giscusIframe = addedNode.querySelector('iframe.giscus-frame');
22+
if(giscusIframe) {
23+
giscusIframe.addEventListener("load", function() {
24+
window.setTimeout(() => {
25+
toggleGiscusIfUsed(hasAlternateSentinel(), authorPrefersDark);
26+
}, 100);
27+
});
28+
giscusIframeObserver.disconnect();
29+
}
30+
}
31+
});
32+
});
33+
});
34+
giscusIframeObserver.observe(document.body, { childList: true, subtree: true });
35+
</script>
1636
<input type="hidden" id="giscus-base-theme" value="<%- giscus.baseTheme %>">
1737
<input type="hidden" id="giscus-alt-theme" value="<%- giscus.altTheme %>">

src/resources/formats/html/templates/quarto-html-after-body.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
2323
window.document.body.appendChild(a);
2424
}
25-
window.setColorSchemeToggle(window.hasAlternateSentinel())
25+
setColorSchemeToggle(hasAlternateSentinel())
2626
2727
<% } %>
2828

src/resources/formats/html/templates/quarto-html-before-body.ejs

+8-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222
}
2323
24-
window.setColorSchemeToggle = (alternate) => {
24+
const setColorSchemeToggle = (alternate) => {
2525
const toggles = window.document.querySelectorAll('.quarto-color-scheme-toggle');
2626
for (let i=0; i < toggles.length; i++) {
2727
const toggle = toggles[i];
@@ -56,7 +56,7 @@
5656
manageTransitions('#quarto-margin-sidebar .nav-link', true);
5757
5858
// Switch the toggles
59-
window.setColorSchemeToggle(alternate)
59+
setColorSchemeToggle(alternate)
6060
6161
// Hack to workaround the fact that safari doesn't
6262
// properly recolor the scrollbar when toggling (#1455)
@@ -103,7 +103,7 @@
103103
return window.location.protocol === 'file:';
104104
}
105105
106-
window.hasAlternateSentinel = () => {
106+
const hasAlternateSentinel = () => {
107107
let styleSentinel = getColorSchemeSentinel();
108108
if (styleSentinel !== null) {
109109
return styleSentinel === "alternate";
@@ -136,7 +136,7 @@
136136
137137
let newTheme = '';
138138
139-
if(darkModeDefault) {
139+
if(authorPrefersDark) {
140140
newTheme = isAlternate ? baseTheme : alternateTheme;
141141
} else {
142142
newTheme = isAlternate ? alternateTheme : baseTheme;
@@ -164,11 +164,12 @@
164164
}
165165
};
166166
167+
const authorPrefersDark = <%= darkModeDefault %>;
167168
<% if (respectUserColorScheme) { %>
168169
const queryPrefersDark = window.matchMedia('(prefers-color-scheme: dark)');
169170
const darkModeDefault = queryPrefersDark.matches;
170171
<% } else { %>
171-
const darkModeDefault = <%= darkModeDefault %>;
172+
const darkModeDefault = authorPrefersDark;
172173
<% } %>
173174
174175
<% if (!darkModeDefault) { %>
@@ -181,7 +182,7 @@
181182
// Dark / light mode switch
182183
window.quartoToggleColorScheme = () => {
183184
// Read the current dark / light value
184-
let toAlternate = !window.hasAlternateSentinel();
185+
let toAlternate = !hasAlternateSentinel();
185186
toggleColorMode(toAlternate);
186187
setStyleSentinel(toAlternate);
187188
toggleGiscusIfUsed(toAlternate, darkModeDefault);
@@ -199,7 +200,7 @@
199200
<% } %>
200201
201202
// Switch to dark mode if need be
202-
if (window.hasAlternateSentinel()) {
203+
if (hasAlternateSentinel()) {
203204
toggleColorMode(true);
204205
} else {
205206
toggleColorMode(false);

0 commit comments

Comments
 (0)