diff --git a/Rakefile b/Rakefile index d237dfe74d..65410062e8 100644 --- a/Rakefile +++ b/Rakefile @@ -66,15 +66,11 @@ def generate_src(target_version: nil) cd target_dir do cp INDEX_HTML, 'index.html' - if target_version.nil? - mv 'navigation.html', '_includes/navigation.html', force: true - else - # Replace absolute path in navigation.html - content = File.read("navigation.html") - content.gsub!("
  • files
  • Core extensions
  • AbstractController
  • ActionCable
  • ActionController
  • ActionDispatch
  • ActionMailbox
  • ActionMailer
  • ActionText
  • ActionView
  • ActiveJob
  • ActiveModel
  • ActiveRecord
  • ActiveStorage
  • ActiveSupport
  • Arel
  • Mail
  • Mime
  • Minitest
  • Rails
  • \ No newline at end of file diff --git a/src/_includes/.keep b/src/_includes/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/_includes/navigation.html b/src/_includes/navigation.html deleted file mode 100644 index 1289db0c60..0000000000 --- a/src/_includes/navigation.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/_includes/navigation6.0.html b/src/_includes/navigation6.0.html deleted file mode 100644 index 50c265e012..0000000000 --- a/src/_includes/navigation6.0.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/_includes/navigation6.1.html b/src/_includes/navigation6.1.html deleted file mode 120000 index 48c4e92d5e..0000000000 --- a/src/_includes/navigation6.1.html +++ /dev/null @@ -1 +0,0 @@ -navigation.html \ No newline at end of file diff --git a/src/_layouts/default.html b/src/_layouts/default.html index 7f64a4c464..702f11a3a4 100644 --- a/src/_layouts/default.html +++ b/src/_layouts/default.html @@ -18,6 +18,10 @@ gtag('js', new Date()); gtag('config', 'UA-134470810-1'); + + window.config = { + rootPath: "{{ page.root_path }}" + } @@ -49,8 +53,7 @@
    diff --git a/src/assets/js/app.js b/src/assets/js/app.js index b90ac0b2a6..90c5f5243f 100644 --- a/src/assets/js/app.js +++ b/src/assets/js/app.js @@ -6,12 +6,14 @@ $(() => { // highlight.js hljs.highlightAll(); - $(".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(); + $("#navigation").load(`${config.rootPath}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(); + }) }); diff --git a/src/navigation.html b/src/navigation.html new file mode 100644 index 0000000000..5164d7d61a --- /dev/null +++ b/src/navigation.html @@ -0,0 +1 @@ + \ No newline at end of file