Skip to content

Commit

Permalink
Make sure all searchable pages have a frontmatter title (#1433)
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez authored Jan 20, 2025
1 parent fc60c87 commit 597aac7
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/tasks/vendor_files.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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
4 changes: 4 additions & 0 deletions source/conduct.html.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: RubyGems and Bundler Code of Conduct
---

# RubyGems and Bundler Code of Conduct

## Our Pledge
Expand Down
4 changes: 4 additions & 0 deletions source/guides/bundler_workflow.html.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions source/guides/gemfile.html.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Gemfiles
---

## In Depth

Read the manual for an in-depth discussion of all of the options available in the
Expand Down
4 changes: 4 additions & 0 deletions source/guides/gemfile_ruby.html.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Ruby Directive
---

## Specifying a Ruby Version

Like gems, developers can setup a dependency on Ruby.
Expand Down
4 changes: 4 additions & 0 deletions source/guides/rationale.html.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 4 additions & 0 deletions source/guides/rubygems.html.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 4 additions & 0 deletions source/guides/rubymotion.html.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 597aac7

Please sign in to comment.