Skip to content

Commit

Permalink
Remove /panel/file_links.html
Browse files Browse the repository at this point in the history
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 d0e2ead, 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`.
  • Loading branch information
jonathanhefner committed Oct 5, 2023
1 parent 90086d8 commit f4a96a7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 29 deletions.
2 changes: 0 additions & 2 deletions lib/rdoc/generator/template/rails/_panel.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,5 @@
<div class="panel__nav content">
<% yield if block_given? %>
</div>

<a id="links" href="/panel/file_links.html">index</a>
</div>
</nav>
13 changes: 0 additions & 13 deletions lib/rdoc/generator/template/rails/file_links.rhtml

This file was deleted.

4 changes: 0 additions & 4 deletions lib/rdoc/generator/template/rails/resources/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 0 additions & 10 deletions lib/sdoc/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f4a96a7

Please sign in to comment.