Skip to content

Commit 9a09753

Browse files
committed
Show github actions even if there is no TOC
1 parent 99128f0 commit 9a09753

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,12 @@ function handleRepoLinks(
549549
if (repoInfo) {
550550
if (repoActions.length > 0) {
551551
// find the toc
552-
const toc = doc.querySelector(`nav[role="doc-toc"]`);
553-
if (toc) {
552+
let repoTarget = doc.querySelector(`nav[role="doc-toc"]`);
553+
if (repoTarget === null) {
554+
repoTarget = doc.querySelector("#quarto-margin-sidebar");
555+
}
556+
557+
if (repoTarget) {
554558
// get the action links
555559
const links = repoActionLinks(
556560
repoActions,
@@ -578,7 +582,7 @@ function handleRepoLinks(
578582
linksDiv.appendChild(p);
579583
});
580584
actionsDiv.appendChild(linksDiv);
581-
toc.appendChild(actionsDiv);
585+
repoTarget.appendChild(actionsDiv);
582586
}
583587
}
584588
if (elRepoSource) {

src/resources/projects/website/navigation/quarto-nav.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,22 @@ nav.sidebar.sidebar-navigation:not(.rollup) {
510510
color: $text-muted;
511511
}
512512

513+
.sidebar nav[role="doc-toc"] .toc-actions .bi:before {
514+
padding-top: 3px;
515+
}
516+
517+
#quarto-margin-sidebar .toc-actions .bi:before {
518+
margin-top: 0.3rem;
519+
font-size: 0.7rem;
520+
color: $text-muted;
521+
vertical-align: top;
522+
}
523+
513524
.sidebar nav[role="doc-toc"] .toc-actions > div:first-of-type {
514525
margin-top: -3px;
515526
}
516527

528+
#quarto-margin-sidebar .toc-actions p,
517529
.sidebar nav[role="doc-toc"] .toc-actions p {
518530
font-size: $toc-font-size;
519531
}

0 commit comments

Comments
 (0)