Skip to content

Commit 615c4b0

Browse files
committed
Don’t default show repo actions on all pages.
1 parent cbae013 commit 615c4b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ function navigationHtmlPostprocessor(
491491

492492
// handle repo links
493493
handleRepoLinks(
494+
format,
494495
doc,
495496
pathWithForwardSlashes(sourceRelative),
496497
language,
@@ -529,6 +530,7 @@ function navigationHtmlPostprocessor(
529530
}
530531

531532
function handleRepoLinks(
533+
format: Format,
532534
doc: Document,
533535
source: string,
534536
language: FormatLanguage,
@@ -539,6 +541,7 @@ function handleRepoLinks(
539541
kWebsite,
540542
config,
541543
);
544+
const forecRepoActions = format.metadata[kSiteRepoActions] === true;
542545

543546
const elRepoSource = doc.querySelector(
544547
"[" + kDataQuartoSourceUrl + '="repo"]',
@@ -550,7 +553,7 @@ function handleRepoLinks(
550553
if (repoActions.length > 0) {
551554
// find the toc
552555
let repoTarget = doc.querySelector(`nav[role="doc-toc"]`);
553-
if (repoTarget === null) {
556+
if (repoTarget === null && forecRepoActions) {
554557
repoTarget = doc.querySelector("#quarto-margin-sidebar");
555558
}
556559

0 commit comments

Comments
 (0)