From 1acb26d35c79c79584614d227e49fa94926a17a4 Mon Sep 17 00:00:00 2001 From: Jonathan Hefner Date: Fri, 25 Aug 2023 12:14:00 -0500 Subject: [PATCH] Fix link to crawler file The `generate_file_links` method generates a `panel/links.html` file for search engines to crawl. When `panel/index.html` was converted to `_panel.rhtml` in 4c5d4a0863ef1c44a41e828ce621c23a6a2e2712, the link to `panel/links.html` was broken. Though the value of this file may be debatable, it definitely provides zero value if it is unreachable. This commit fixes the broken link. This commit also renames the `generate_search_index` method to `generate_file_links`, and renames `search_index.rhtml` to `file_links.rhtml` so that it won't be confused with `search_index.js`, which is entirely unrelated. --- lib/rdoc/generator/template/rails/_panel.rhtml | 2 +- .../rails/{search_index.rhtml => file_links.rhtml} | 0 lib/sdoc/generator.rb | 8 ++++---- 3 files changed, 5 insertions(+), 5 deletions(-) rename lib/rdoc/generator/template/rails/{search_index.rhtml => file_links.rhtml} (100%) diff --git a/lib/rdoc/generator/template/rails/_panel.rhtml b/lib/rdoc/generator/template/rails/_panel.rhtml index c0c771c9..4f1ab567 100644 --- a/lib/rdoc/generator/template/rails/_panel.rhtml +++ b/lib/rdoc/generator/template/rails/_panel.rhtml @@ -31,6 +31,6 @@ - index + index diff --git a/lib/rdoc/generator/template/rails/search_index.rhtml b/lib/rdoc/generator/template/rails/file_links.rhtml similarity index 100% rename from lib/rdoc/generator/template/rails/search_index.rhtml rename to lib/rdoc/generator/template/rails/file_links.rhtml diff --git a/lib/sdoc/generator.rb b/lib/sdoc/generator.rb index d3713a35..9c9c2a05 100644 --- a/lib/sdoc/generator.rb +++ b/lib/sdoc/generator.rb @@ -102,7 +102,7 @@ def generate copy_resources @json_index.generate @json_index.generate_gzipped - generate_search_index + generate_file_links generate_class_tree generate_index_file @@ -177,10 +177,10 @@ def generate_file_files end ### Generate file with links for the search engine - def generate_search_index + def generate_file_links debug_msg "Generating search engine index in #{@outputdir}" - templatefile = @template_dir + 'search_index.rhtml' - outfile = @outputdir + 'panel/links.html' + templatefile = @template_dir + 'file_links.rhtml' + outfile = @outputdir + 'panel/file_links.html' self.render_template( templatefile, binding(), outfile ) unless @options.dry_run end