From 920556e7a2a3d87efa2beab11801d19e2329391d Mon Sep 17 00:00:00 2001 From: toshimaru Date: Sun, 18 Apr 2021 17:07:52 +0900 Subject: [PATCH 1/3] Update CI Badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From f8da17be686a1f11eea09fd2876cef8d22f82e63 Mon Sep 17 00:00:00 2001 From: toshimaru Date: Sun, 18 Apr 2021 17:25:00 +0900 Subject: [PATCH 2/3] =?UTF-8?q?Update=20jQuery:=203.5.1=E2=86=923.6.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/_layouts/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_layouts/default.html b/src/_layouts/default.html index f07a1d6429..baa8e08732 100644 --- a/src/_layouts/default.html +++ b/src/_layouts/default.html @@ -58,7 +58,7 @@ - + From 1a8551fb4a74c54e583ab3973db13e801f537d72 Mon Sep 17 00:00:00 2001 From: toshimaru Date: Mon, 19 Apr 2021 00:42:24 +0900 Subject: [PATCH 3/3] Use `$.load` instead of Jekyll `include` --- Rakefile | 2 +- src/_layouts/default.html | 3 +-- src/assets/js/app.js | 16 +++++++++------- src/navigation.html | 1 + 4 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 src/navigation.html 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 baa8e08732..083de3fdd0 100644 --- a/src/_layouts/default.html +++ b/src/_layouts/default.html @@ -40,8 +40,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