From 5825312f9f01c0e9772bfc79bd68ffdc0878e00a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Thu, 16 Jan 2025 07:06:10 +0100 Subject: [PATCH] Make sure all searchable pages have a frontmatter title --- lib/tasks/vendor_files.rake | 7 ++++--- source/conduct.html.md | 4 ++++ source/guides/bundler_workflow.html.md | 4 ++++ source/guides/gemfile.html.md | 4 ++++ source/guides/gemfile_ruby.html.md | 4 ++++ source/guides/rationale.html.md | 4 ++++ source/guides/rubygems.html.md | 4 ++++ source/guides/rubymotion.html.md | 4 ++++ 8 files changed, 32 insertions(+), 3 deletions(-) diff --git a/lib/tasks/vendor_files.rake b/lib/tasks/vendor_files.rake index 118b2ff5e4..78d21578e3 100644 --- a/lib/tasks/vendor_files.rake +++ b/lib/tasks/vendor_files.rake @@ -28,7 +28,7 @@ def new_link(file, link) end end -def write_file(file, to) +def write_file(file, to, title: nil) content = File.read(file) file = file.sub("doc/bundler/", "doc/").downcase @@ -38,6 +38,7 @@ def write_file(file, to) new_link = new_link(file, Regexp.last_match[:link].downcase) "[#{Regexp.last_match[:title]}](#{new_link})" end + content.prepend("---\ntitle: #{title}\n---\n\n") if title FileUtils.mkpath(File.dirname(to)) File.write(to, content) @@ -70,7 +71,7 @@ task repo_pages: :update_vendor do write_file(file, to) end - write_file("CODE_OF_CONDUCT.md", File.expand_path("./conduct.html.md", source_dir)) - write_file("CHANGELOG.md", File.expand_path("./changelog.html.md", source_dir)) + write_file("CODE_OF_CONDUCT.md", File.expand_path("./conduct.html.md", source_dir), title: "RubyGems and Bundler Code of Conduct") + write_file("CHANGELOG.md", File.expand_path("./changelog.html.md", source_dir), title: "ChangeLog") end end diff --git a/source/conduct.html.md b/source/conduct.html.md index 1c267117ea..56ce602903 100644 --- a/source/conduct.html.md +++ b/source/conduct.html.md @@ -1,3 +1,7 @@ +--- +title: RubyGems and Bundler Code of Conduct +--- + # RubyGems and Bundler Code of Conduct ## Our Pledge diff --git a/source/guides/bundler_workflow.html.md b/source/guides/bundler_workflow.html.md index 9b62302b56..2f3125abc4 100644 --- a/source/guides/bundler_workflow.html.md +++ b/source/guides/bundler_workflow.html.md @@ -1,3 +1,7 @@ +--- +title: Recommended Workflow with Version Control +--- + ## Recommended Workflow with Version Control In general, when working with an application managed with bundler, you diff --git a/source/guides/gemfile.html.md b/source/guides/gemfile.html.md index 2ca4087340..55e953a92b 100644 --- a/source/guides/gemfile.html.md +++ b/source/guides/gemfile.html.md @@ -1,3 +1,7 @@ +--- +title: Gemfiles +--- + ## In Depth Read the manual for an in-depth discussion of all of the options available in the diff --git a/source/guides/gemfile_ruby.html.md b/source/guides/gemfile_ruby.html.md index 7d93612225..2f6f4b553c 100644 --- a/source/guides/gemfile_ruby.html.md +++ b/source/guides/gemfile_ruby.html.md @@ -1,3 +1,7 @@ +--- +title: Ruby Directive +--- + ## Specifying a Ruby Version Like gems, developers can setup a dependency on Ruby. diff --git a/source/guides/rationale.html.md b/source/guides/rationale.html.md index 3f9bc69d40..8f03bd6f2c 100644 --- a/source/guides/rationale.html.md +++ b/source/guides/rationale.html.md @@ -1,3 +1,7 @@ +--- +title: Why Bundler exists +--- + If you just want to know our recommended workflow and don't care about the rationale, feel free to [jump to the summary](#summary) below. diff --git a/source/guides/rubygems.html.md b/source/guides/rubygems.html.md index 5a92ca44a0..217acd7f29 100644 --- a/source/guides/rubygems.html.md +++ b/source/guides/rubygems.html.md @@ -1,3 +1,7 @@ +--- +title: Bundler in gems +--- + ## Using Bundler while developing a gem If you're creating a gem from scratch, you can use bundler's built in gem skeleton to create a base gem for you to edit. diff --git a/source/guides/rubymotion.html.md b/source/guides/rubymotion.html.md index 57222b6569..3e5587a09f 100644 --- a/source/guides/rubymotion.html.md +++ b/source/guides/rubymotion.html.md @@ -1,3 +1,7 @@ +--- +title: How to use Bundler with RubyMotion +--- + ## How to use Bundler with RubyMotion If you don't have a RubyMotion app yet, generate one.