Skip to content

Commit c058546

Browse files
committed
book: fix a couple of broken redirects
When falling back to redirecting to to the English ProGit2 book in case a translation is incomplete and is missing a certain reference, we face the problem that some references have been renamed in the English version. Let's list the known mappings and thereby fix most of the broken links. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent d02f153 commit c058546

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

script/book.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,26 @@ def save
165165
@xrefs.each do |id_xref, section|
166166
path = self.absolute_path("ch00/#{id_xref}.html")
167167
if section == 'redirect-to-en'
168-
url = "book/en/v2/ch00/#{id_xref}"
168+
if id_xref == 'ch01-introduction'
169+
id_xref = 'ch01-getting-started'
170+
elsif id_xref == 'ch02-git-basics' || id_xref == '_bab_dasar-dasar_git'
171+
id_xref = 'ch02-git-basics-chapter'
172+
elsif id_xref == '_percabangan_git'
173+
id_xref = 'ch03-git-branching'
174+
elsif id_xref == 'r_git_on_the_server'
175+
id_xref = 'ch04-git-on-the-server'
176+
elsif id_xref == '_getting_notes' || id_xref == '_sharing_notes'
177+
# Was removed in e2af0d7b (Remove dead notes content, 2014-11-09),
178+
# fall back to `git fetch`
179+
id_xref = '_git_fetch'
180+
elsif id_xref == 'r_undoing' || id_xref == '_mengembalikan_ke_sebelumnya'
181+
id_xref = '_undoing'
182+
end
183+
if id_xref == '_git_notes'
184+
url = "docs/git-notes"
185+
else
186+
url = "book/en/v2/ch00/#{id_xref}"
187+
end
169188
else
170189
url = "#{section.relative_url(nil)}##{id_xref}"
171190
end

0 commit comments

Comments
 (0)