Skip to content

Commit

Permalink
Merge branch 'hibbitts-design:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhibbitts authored Oct 30, 2024
2 parents a3bb940 + 6e3db3a commit 6e2f969
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 46 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
## [v1.2.21](https://github.com/hibbitts-design/docsify-open-course-starter-kit/releases/tag/v1.2.21)
### XX/XX/2024

**New:**
* Added default setting of false for `mergeNavbar` to move Navbar items to the top of the Sidebar on smaller screens

**Improved:**
* Use of window.matchMedia.addListener replaced with window.matchMedia.addEventListener
* Cleanup HTML

## [v1.2.20](https://github.com/hibbitts-design/docsify-open-course-starter-kit/releases/tag/v1.2.20)
### 10/17/2024
Expand Down
86 changes: 40 additions & 46 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,14 @@
--sidebar-nav-link-font-weight--active: bold;

--sidebar-nav-pagelink-background--active:
no-repeat 0px center / 5px 6px
linear-gradient(225deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px),
no-repeat 5px center / 5px 6px
linear-gradient(135deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px);
no-repeat 0px center / 5px 6px linear-gradient(225deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px),
no-repeat 5px center / 5px 6px linear-gradient(135deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px);
--sidebar-nav-pagelink-background--collapse:
no-repeat 2px calc(50% - 2.5px) / 6px 5px
linear-gradient(45deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4px),
no-repeat 2px calc(50% + 2.5px) / 6px 5px
linear-gradient(135deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4px);
no-repeat 2px calc(50% - 2.5px) / 6px 5px linear-gradient(45deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4px),
no-repeat 2px calc(50% + 2.5px) / 6px 5px linear-gradient(135deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4px);
--sidebar-nav-pagelink-background--loaded:
no-repeat 0px center / 5px 6px
linear-gradient(225deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px),
no-repeat 5px center / 5px 6px
linear-gradient(135deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px);
no-repeat 0px center / 5px 6px linear-gradient(225deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px),
no-repeat 5px center / 5px 6px linear-gradient(135deg, transparent 2.75px, #0374B5 2.75px 4.25px, transparent 4.25px);

--navbar-root-margin: 0 0 0 .8em;
--navbar-root-color--active: #0374B5;
Expand All @@ -95,7 +89,6 @@

--docsifytabs-tab-color: var(--base-color);
}

</style>

</head>
Expand Down Expand Up @@ -166,7 +159,8 @@
name: 'Docsify Open Course Starter Kit',
homepage: 'home.md',
loadSidebar: !(getURLParameterByName(['standalone', 'embedded']) || standalone || false),
loadNavbar: !(getURLParameterByName(['standalone', 'embedded']) && !(getURLParameterByName('navbar')) || standalone && !navbar ||false),
loadNavbar: !(getURLParameterByName(['standalone', 'embedded']) && !(getURLParameterByName('navbar')) || standalone && !navbar || false),
mergeNavbar: false,
externalLinkTarget: standalone ? '_top' : (getURLParameterByName(['standalone', 'embedded'], '_top', '_blank')),
loadFooter: (getURLParameterByName('footer') || footer || false),

Expand Down Expand Up @@ -254,7 +248,7 @@
}
}
}

/* JS to change Embedly cards to light or dark theme based on system setting when using the light + dark theme (uncomment to use) */
/*
const embeds = Array.from(htmlElement.querySelectorAll('.embedly-card'))
Expand Down Expand Up @@ -307,11 +301,11 @@
hook.doneEach(function () {
var hasEmbedly = document.getElementsByClassName('embedly-card');
if (hasEmbedly.length > 0) {
// elements with class "embedly-card" exist
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdn.embedly.com/widgets/platform.js';
document.head.appendChild(script);
// elements with class "embedly-card" exist
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://cdn.embedly.com/widgets/platform.js';
document.head.appendChild(script);
}

// Remove optional ToC area if full width header image is present
Expand All @@ -334,17 +328,17 @@
const allIframes = Array.from(document.querySelectorAll('iframe[src*="youtube.com"], iframe[src*="youtube-nocookie.com"], iframe[src*="docs.google.com"], iframe[src*="onedrive.live.com"]'));

// Filter out iframes that are not already wrapped with a div including the classes 'video-container-16by9' and 'video-container-4by3'
const targetIframes = allIframes.filter(function(iframe) {
const targetIframes = allIframes.filter(function (iframe) {
const parentDiv = iframe.parentNode;
return !parentDiv.matches('.video-container-16by9, .video-container-4by3');
});

// Wrap each target iframe with a div element
targetIframes.forEach(function(iframe) {
targetIframes.forEach(function (iframe) {
const wrapperDiv = document.createElement('div');
wrapperDiv.classList.add('video-container-16by9');
// Preserve existing classes on the iframe
iframe.classList.forEach(function(className) {
iframe.classList.forEach(function (className) {
wrapperDiv.classList.add(className);
});
// Replace the iframe with the wrapper div
Expand All @@ -362,8 +356,8 @@

// Build the current URL without the hash
let currentUrlWithoutHash = new URL(
location.origin + location.pathname +
location.search
location.origin + location.pathname +
location.search
);

// Get the search parameters from the URL (before the hash)
Expand All @@ -376,28 +370,28 @@

// Check if the URL contains the 'id' query parameter in either search or hash
if (isUrlHasIdQuery || isHashHasIdQuery) {
// Get the 'id' from either search or hash
let urlId = isUrlHasIdQuery ? urlQueryParam.get(TARGET_QUERY) : hashParams.get(TARGET_QUERY);

// Delay the scrolling to ensure everything is loaded
setTimeout(function () {
try {
let targetElement = document.querySelector('#' + urlId);
if (targetElement) {
// Scroll to the element with smooth behavior
targetElement.scrollIntoView({
behavior: 'smooth', // Enables smooth scrolling
block: 'start', // Aligns the top of the element to the top of the viewport
});
}
} catch (e) {
console.log('custom scroll failed', e);
}
}, SCROLL_DELAY);

// Get the 'id' from either search or hash
let urlId = isUrlHasIdQuery ? urlQueryParam.get(TARGET_QUERY) : hashParams.get(TARGET_QUERY);

// Delay the scrolling to ensure everything is loaded
setTimeout(function () {
try {
let targetElement = document.querySelector('#' + urlId);
if (targetElement) {
// Scroll to the element with smooth behavior
targetElement.scrollIntoView({
behavior: 'smooth', // Enables smooth scrolling
block: 'start', // Aligns the top of the element to the top of the viewport
});
}
} catch (e) {
console.log('custom scroll failed', e);
}
}, SCROLL_DELAY);
}
});

}
]
}
Expand All @@ -419,7 +413,7 @@

<!-- Search Box Plugin -->
<!-- <script src="assets/js/search.min.js"></script> -->

<!-- Font Awesome Plugin -->
<script src="assets/js/docsify-fontawesome.min.js"></script>

Expand Down

0 comments on commit 6e2f969

Please sign in to comment.