diff --git a/README.md b/README.md index 4cac2d9e85..bfd02681d3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # [railsdoc.github.io](https://railsdoc.github.io/) -[![Build Status](https://travis-ci.com/railsdoc/railsdoc.github.io.svg?branch=main)](https://travis-ci.com/railsdoc/railsdoc.github.io) +[![CI](https://github.com/railsdoc/railsdoc.github.io/actions/workflows/ci.yml/badge.svg)](https://github.com/railsdoc/railsdoc.github.io/actions/workflows/ci.yml) [![Netlify Status](https://api.netlify.com/api/v1/badges/c964029a-6d5a-4f3a-95e9-d35830a2fe83/deploy-status)](https://app.netlify.com/sites/railsdoc-preview/deploys) railsdoc.github.io is yet another Rails API documentation website. diff --git a/Rakefile b/Rakefile index a19a0ab5b0..207e377593 100644 --- a/Rakefile +++ b/Rakefile @@ -13,7 +13,7 @@ task :build do cd 'src' do cp 'files/railties/RDOC_MAIN_rdoc.html', 'index.html' - mv 'navigation.html', '_includes/navigation.html', force: true + # mv 'navigation.html', '_includes/navigation.html', force: true end sh 'bundle exec jekyll build' diff --git a/src/_layouts/default.html b/src/_layouts/default.html index f07a1d6429..083de3fdd0 100644 --- a/src/_layouts/default.html +++ b/src/_layouts/default.html @@ -40,8 +40,7 @@
@@ -58,7 +57,7 @@
- + diff --git a/src/assets/js/app.js b/src/assets/js/app.js index 1e1d19aaa3..8b170b761b 100644 --- a/src/assets/js/app.js +++ b/src/assets/js/app.js @@ -6,12 +6,14 @@ $(() => { // highlight.js hljs.initHighlighting(); - $(".sidebar-sticky .icon").on("click", function (e) { - $(this).siblings("ul").toggle(); - this.classList.toggle("icon-opened"); + $("#navigation").load("/navigation.html", function() { + $(".sidebar-sticky .icon").on("click", function (e) { + $(this).siblings("ul").toggle(); + this.classList.toggle("icon-opened"); + }); + $(`.sidebar-content a[href='${window.location.pathname}']`) + .attr("class", "active-link") + .parents('ul') + .show(); }); - $(`.sidebar-content a[href='${window.location.pathname}']`) - .attr("class", "active-link") - .parents('ul') - .show(); }); diff --git a/src/navigation.html b/src/navigation.html new file mode 100644 index 0000000000..88bdff23db --- /dev/null +++ b/src/navigation.html @@ -0,0 +1 @@ + \ No newline at end of file