From f4a96a7618b0682031a5d9ce2ea44429b6beee9c Mon Sep 17 00:00:00 2001 From: Jonathan Hefner Date: Mon, 2 Oct 2023 16:39:06 -0500 Subject: [PATCH] Remove /panel/file_links.html Modern search engines evaluate JavaScript, so it is unclear whether they will crawl a link that is hidden via JavaScript. Also, if they do see the link, there could be an SEO penalty. There are reports that Google penalizes hidden backlinks (in other words, hidden links that exist solely to game the page rank algorithm), but it's unclear whether that applies to intra-site hidden links. Regardless, since d0e2ead20f0ca159503b2871667452abcedd4c2e, all sidebar links are actual links, so search engines can crawl the entire site without `/panel/file_links.html`. Therefore, this commit removes `/panel/file_links.html`. --- lib/rdoc/generator/template/rails/_panel.rhtml | 2 -- lib/rdoc/generator/template/rails/file_links.rhtml | 13 ------------- .../generator/template/rails/resources/js/main.js | 4 ---- lib/sdoc/generator.rb | 10 ---------- 4 files changed, 29 deletions(-) delete mode 100644 lib/rdoc/generator/template/rails/file_links.rhtml diff --git a/lib/rdoc/generator/template/rails/_panel.rhtml b/lib/rdoc/generator/template/rails/_panel.rhtml index 0d0390b6..838f6437 100644 --- a/lib/rdoc/generator/template/rails/_panel.rhtml +++ b/lib/rdoc/generator/template/rails/_panel.rhtml @@ -24,7 +24,5 @@
<% yield if block_given? %>
- - index diff --git a/lib/rdoc/generator/template/rails/file_links.rhtml b/lib/rdoc/generator/template/rails/file_links.rhtml deleted file mode 100644 index 376dcc2b..00000000 --- a/lib/rdoc/generator/template/rails/file_links.rhtml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - File Index - - - - <% @context.each do |file| %> - <%= file.relative_name %> - <% end %> - - diff --git a/lib/rdoc/generator/template/rails/resources/js/main.js b/lib/rdoc/generator/template/rails/resources/js/main.js index 61604817..5b5add01 100644 --- a/lib/rdoc/generator/template/rails/resources/js/main.js +++ b/lib/rdoc/generator/template/rails/resources/js/main.js @@ -48,10 +48,6 @@ document.addEventListener("turbo:load", () => { } }, { once: true }); -document.addEventListener("turbo:load", function() { - $('#links').hide(); -}); - // Hide menu on mobile when navigating to a named anchor on the current page. // For example, when clicking on a method in the method list. diff --git a/lib/sdoc/generator.rb b/lib/sdoc/generator.rb index e11f3191..861b760d 100644 --- a/lib/sdoc/generator.rb +++ b/lib/sdoc/generator.rb @@ -88,8 +88,6 @@ def generate FileUtils.mkdir_p(@output_dir) copy_resources generate_search_index - generate_file_links - generate_index_file generate_file_files generate_class_files @@ -135,26 +133,18 @@ def render_file(template_path, output_path, context = nil) output_path.write(result) end - ### Generate index.html def generate_index_file render_file("index.rhtml", "index.html", index) end - ### Generate a documentation file for each class def generate_class_files @classes.each { |klass| render_file("class.rhtml", klass.path, klass) } end - ### Generate a documentation file for each file def generate_file_files @files.each { |file| render_file("file.rhtml", file.path, file) } end - ### Generate file with links for the search engine - def generate_file_links - render_file("file_links.rhtml", "panel/file_links.html", @files) - end - def generate_search_index debug_msg "Generating search index" unless @options.dry_run