-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7371357
commit 2ab2c20
Showing
4 changed files
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script> | ||
// Create a status div | ||
var statusDiv = document.createElement('div'); | ||
statusDiv.className = 'alert alert-primary text-center'; | ||
statusDiv.role = 'alert'; | ||
|
||
// Add the content of params$wordcount to the status div | ||
statusDiv.innerHTML = '<i class="bi bi-bar-chart-fill"></i> `r params$wordcount`'; | ||
|
||
// Create a <header class="fixed-top"> element to hold the status div | ||
var header = document.createElement('header'); | ||
header.className = 'fixed-top'; | ||
|
||
// Add the status div to the header | ||
header.appendChild(statusDiv); | ||
|
||
// Insert the header div before the `quarto-content` div | ||
var quartoContent = document.getElementById('quarto-content'); | ||
if (quartoContent) { | ||
quartoContent.parentNode.insertBefore(header, quartoContent); | ||
} | ||
|
||
// Add padding to the top of the body to create space for the banner | ||
document.body.style.paddingTop = statusDiv.offsetHeight + 'px'; | ||
|
||
// Inject style attribute into the sidebar div if it's there | ||
var sidebar = document.getElementById('quarto-margin-sidebar'); | ||
if (sidebar) { | ||
sidebar.style.top = '67px'; | ||
sidebar.style.maxHeight = 'calc(-67px + 100vh)'; | ||
} | ||
</script> |