We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fda2a02 commit 7795261Copy full SHA for 7795261
_lib/tasks/api_doc.rake
@@ -21,11 +21,13 @@ namespace :api do
21
Kernel.system(cmd)
22
exitstatus = $?.exitstatus
23
if exitstatus.zero?
24
- html_contents = File.read(html_file)
25
- html_contents.gsub!('<head>', '<head><link rel="canonical" href="'+canonical_url+'" />')
26
- File.open(html_file, 'w') do |f|
27
- f.write(html_contents)
28
- end
+ html = File
+ .read(html_file)
+ .gsub('<head>', <<~HEAD)
+ <head><link rel="canonical" href="#{canonical_url}" />
+ HEAD
29
+
30
+ File.open(html_file, 'w') { |f| f.write(html) }
31
32
puts "Compilation done for #{file[:src]}. Generated the #{file[:dest]} file."
33
else
0 commit comments