Skip to content

Commit

Permalink
Build website
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jun 2, 2024
1 parent ed5d328 commit 7790007
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 27 deletions.
3 changes: 3 additions & 0 deletions docs/assets/css/just-the-docs-head-nav.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.site-nav ul li a {
background-image: linear-gradient(-90deg, #ebedf5 0%, rgba(235, 237, 245, 0.8) 80%, rgba(235, 237, 245, 0) 100%); }
55 changes: 41 additions & 14 deletions docs/assets/js/just-the-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function initNav() {
const siteNav = document.getElementById('site-nav');
const mainHeader = document.getElementById('main-header');
const menuButton = document.getElementById('menu-button');
disableHeadStyleSheet();

disableHeadStyleSheets();

jtd.addEvent(menuButton, 'click', function(e){
e.preventDefault();
Expand All @@ -54,13 +54,23 @@ function initNav() {
});
}

// The page-specific <style> in the <head> is needed only when JS is disabled.
// Moreover, it incorrectly overrides dynamic stylesheets set by setTheme(theme).
// The page-specific stylesheet is assumed to have index 1 in the list of stylesheets.
// The <head> element is assumed to include the following stylesheets:
// - a <link> to /assets/css/just-the-docs-head-nav.css,
// with id 'jtd-head-nav-stylesheet'
// - a <style> containing the result of _includes/css/activation.scss.liquid.
// To avoid relying on the order of stylesheets (which can change with HTML
// compression, user-added JavaScript, and other side effects), stylesheets
// are only interacted with via ID

function disableHeadStyleSheets() {
const headNav = document.getElementById('jtd-head-nav-stylesheet');
if (headNav) {
headNav.disabled = true;
}

function disableHeadStyleSheet() {
if (document.styleSheets[1]) {
document.styleSheets[1].disabled = true;
const activation = document.getElementById('jtd-nav-activation');
if (activation) {
activation.disabled = true;
}
}
// Site search
Expand Down Expand Up @@ -453,20 +463,37 @@ jtd.setTheme = function(theme) {
// and not have the slash on GitHub Pages

function navLink() {
var href = document.location.pathname;
if (href.endsWith('/') && href != '/') {
href = href.slice(0, -1);
var pathname = document.location.pathname;

var navLink = document.getElementById('site-nav').querySelector('a[href="' + pathname + '"]');
if (navLink) {
return navLink;
}

// The `permalink` setting may produce navigation links whose `href` ends with `/` or `.html`.
// To find these links when `/` is omitted from or added to pathname, or `.html` is omitted:

if (pathname.endsWith('/') && pathname != '/') {
pathname = pathname.slice(0, -1);
}
return document.getElementById('site-nav').querySelector('a[href="' + href + '"], a[href="' + href + '/"]');

if (pathname != '/') {
navLink = document.getElementById('site-nav').querySelector('a[href="' + pathname + '"], a[href="' + pathname + '/"], a[href="' + pathname + '.html"]');
if (navLink) {
return navLink;
}
}

return null; // avoids `undefined`
}

// Scroll site-nav to ensure the link to the current page is visible

function scrollNav() {
const targetLink = navLink();
if (targetLink) {
const rect = targetLink.getBoundingClientRect();
document.getElementById('site-nav').scrollBy(0, rect.top - 3*rect.height);
targetLink.scrollIntoView({ block: "center" });
targetLink.removeAttribute('href');
}
}

Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/faq/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/guides/docker_build/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/guides/docker_install/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/guides/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/guides/vagrant_build/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/guides/virtualbox_build/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/guides/virtualbox_install/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/stacks/gds/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/stacks/gds_dev/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/stacks/gds_py/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/stacks/index.html

Large diffs are not rendered by default.

0 comments on commit 7790007

Please sign in to comment.