diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0b88ffa..f941cc5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -28,7 +28,7 @@ jobs: - name: Setup mdBook uses: peaceiris/actions-mdbook@v2 with: - mdbook-version: "latest" + mdbook-version: "0.4.43" - name: Setup Pages uses: actions/configure-pages@v4 diff --git a/book.toml b/book.toml index bc8df70..a8e03f4 100644 --- a/book.toml +++ b/book.toml @@ -4,6 +4,7 @@ language = "en" multilingual = false src = "src" title = "ESP-docs mdbook theme" +description = "https://espressif.github.io/esp-docs-mdbook/" [build] @@ -17,3 +18,4 @@ smart-punctuation = true git-repository-url="https://github.com/espressif/esp-docs-mdbook" copy-theme = true additional-files = ["theme"] +site-url = "/esp-docs-mdbook/" \ No newline at end of file diff --git a/theme/book.js b/theme/book.js index 3e99c07..dee76ef 100644 --- a/theme/book.js +++ b/theme/book.js @@ -350,6 +350,7 @@ function playground_text(playground, hidden = true) { function get_theme() { var theme; + return theme; try { theme = localStorage.getItem("mdbook-theme"); } catch (e) {} @@ -361,6 +362,7 @@ function playground_text(playground, hidden = true) { } function set_theme(theme, store = true) { + return; let ace_theme; if (theme == "coal" || theme == "navy") { @@ -411,36 +413,36 @@ function playground_text(playground, hidden = true) { set_theme(theme, false); - themeToggleButton.addEventListener("click", function () { - if (themePopup.style.display === "block") { - hideThemes(); - } else { - showThemes(); - } - }); + // themeToggleButton.addEventListener("click", function () { + // if (themePopup.style.display === "block") { + // hideThemes(); + // } else { + // showThemes(); + // } + // }); - themePopup.addEventListener("click", function (e) { - var theme; - if (e.target.className === "theme") { - theme = e.target.id; - } else if (e.target.parentElement.className === "theme") { - theme = e.target.parentElement.id; - } else { - return; - } - set_theme(theme); - }); + // themePopup.addEventListener("click", function (e) { + // var theme; + // if (e.target.className === "theme") { + // theme = e.target.id; + // } else if (e.target.parentElement.className === "theme") { + // theme = e.target.parentElement.id; + // } else { + // return; + // } + // set_theme(theme); + // }); - themePopup.addEventListener("focusout", function (e) { - // e.relatedTarget is null in Safari and Firefox on macOS (see workaround below) - if ( - !!e.relatedTarget && - !themeToggleButton.contains(e.relatedTarget) && - !themePopup.contains(e.relatedTarget) - ) { - hideThemes(); - } - }); + // themePopup.addEventListener("focusout", function (e) { + // // e.relatedTarget is null in Safari and Firefox on macOS (see workaround below) + // if ( + // !!e.relatedTarget && + // !themeToggleButton.contains(e.relatedTarget) && + // !themePopup.contains(e.relatedTarget) + // ) { + // hideThemes(); + // } + // }); // Should not be needed, but it works around an issue on macOS & iOS: https://github.com/rust-lang/mdBook/issues/628 document.addEventListener("click", function (e) { @@ -527,28 +529,28 @@ function playground_text(playground, hidden = true) { } // Toggle sidebar - sidebarToggleButton.addEventListener("click", function sidebarToggle() { - if (body.classList.contains("sidebar-hidden")) { - var current_width = parseInt( - document.documentElement.style.getPropertyValue("--sidebar-width"), - 10 - ); - if (current_width < 150) { - document.documentElement.style.setProperty("--sidebar-width", "150px"); - } - showSidebar(); - } else if (body.classList.contains("sidebar-visible")) { - hideSidebar(); - } else { - if (getComputedStyle(sidebar)["transform"] === "none") { - hideSidebar(); - } else { - showSidebar(); - } - } - }); + // sidebarToggleButton.addEventListener("click", function sidebarToggle() { + // if (body.classList.contains("sidebar-hidden")) { + // var current_width = parseInt( + // document.documentElement.style.getPropertyValue("--sidebar-width"), + // 10 + // ); + // if (current_width < 150) { + // document.documentElement.style.setProperty("--sidebar-width", "150px"); + // } + // showSidebar(); + // } else if (body.classList.contains("sidebar-visible")) { + // hideSidebar(); + // } else { + // if (getComputedStyle(sidebar)["transform"] === "none") { + // hideSidebar(); + // } else { + // showSidebar(); + // } + // } + // }); - sidebarResizeHandle.addEventListener("mousedown", initResize, false); + // sidebarResizeHandle.addEventListener("mousedown", initResize, false); function initResize(e) { window.addEventListener("mousemove", resize, false); @@ -692,9 +694,9 @@ function playground_text(playground, hidden = true) { (function scrollToTop() { var menuTitle = document.querySelector(".menu-title"); - menuTitle.addEventListener("click", function () { - document.scrollingElement.scrollTo({ top: 0, behavior: "smooth" }); - }); + // menuTitle.addEventListener("click", function () { + // document.scrollingElement.scrollTo({ top: 0, behavior: "smooth" }); + // }); })(); (function controllMenu() { @@ -703,12 +705,12 @@ function playground_text(playground, hidden = true) { (function controllPosition() { var scrollTop = document.scrollingElement.scrollTop; var prevScrollTop = scrollTop; - var minMenuY = -menu.clientHeight - 50; + // var minMenuY = -menu.clientHeight - 50; // When the script loads, the page can be at any scroll (e.g. if you reforesh it). - menu.style.top = scrollTop + "px"; + // menu.style.top = scrollTop + "px"; // Same as parseInt(menu.style.top.slice(0, -2), but faster - var topCache = menu.style.top.slice(0, -2); - menu.classList.remove("sticky"); + // var topCache = menu.style.top.slice(0, -2); + // menu.classList.remove("sticky"); var stickyCache = false; // Same as menu.classList.contains('sticky'), but faster document.addEventListener( "scroll", @@ -749,11 +751,11 @@ function playground_text(playground, hidden = true) { })(); (function controllBorder() { function updateBorder() { - if (menu.offsetTop === 0) { - menu.classList.remove("bordered"); - } else { - menu.classList.add("bordered"); - } + // if (menu.offsetTop === 0) { + // menu.classList.remove("bordered"); + // } else { + // menu.classList.add("bordered"); + // } } updateBorder(); document.addEventListener("scroll", updateBorder, { passive: true }); diff --git a/theme/css/general.css b/theme/css/general.css index ddf000a..af1244b 100644 --- a/theme/css/general.css +++ b/theme/css/general.css @@ -105,6 +105,12 @@ h1:visited, h2:visited { margin-top: 0; color: #333; + text-decoration: none; +} + +h1 a, +h2 a { + text-decoration: none; } .requirements-list { @@ -145,7 +151,6 @@ h2:visited { } .main-content a { color: #404040; - text-decoration: none; /* Optional: to remove underline from links */ } .main-content a:hover { diff --git a/theme/index.hbs b/theme/index.hbs index 36f9f11..72d574d 100644 --- a/theme/index.hbs +++ b/theme/index.hbs @@ -20,22 +20,32 @@ - + {{#if copy_fonts}} - + {{/if}} - + - - - + {{!-- + + --}} - +
@@ -116,7 +126,7 @@ @@ -138,13 +148,13 @@