Unified · Split
| @@ -12,6 +12,13 @@ module Docs · 11 unmodified lines | |||
| 12 | container.child.before(at_css('header.hero h1')).before(badges).before(css('header.hero + .banner')) | 12 | container.child.before(at_css('header.hero h1')).before(badges).before(css('header.hero + .banner')) |
| 13 | @doc = container | 13 | @doc = container |
| 14 | 14 | ||
| 15 | title = at_css('h1').content.strip | ||
| 16 | if title == 'Index' | ||
| 17 | at_css('h1').content = result[:entries].first.name | ||
| 18 | elsif title == 'Angular' | ||
| 19 | at_css('h1').content = slug.split('/').last.gsub('-', ' ') | ||
| 20 | end | ||
| 21 | |||
| 15 | css('pre.no-bg-with-indent').each do |node| | 22 | css('pre.no-bg-with-indent').each do |node| |
| 16 | node.content = ' ' + node.content.gsub("\n", "\n ") | 23 | node.content = ' ' + node.content.gsub("\n", "\n ") |
| 17 | end | 24 | end |
| @@ -11,10 +11,10 @@ module Docs · 10 unmodified lines | |||
| 11 | name = name.split(':').first | 11 | name = name.split(':').first |
| 12 | 12 | ||
| 13 | if mod | 13 | if mod |
| 14 | if name == 'Testing' | 14 | if name == 'Index' |
| 15 | return "#{mod.capitalize} Testing" | 15 | return slug.split('/')[1..-2].join('/') |
| 16 | elsif name == 'Index' || name == 'Angular' | 16 | elsif name == 'Angular' |
| 17 | return mod | 17 | return slug.split('/').last.split('-').first |
| 18 | end | 18 | end |
| 19 | end | 19 | end |
| 20 | 20 | ||
| @@ -25,7 +25,6 @@ module Docs · 24 unmodified lines | |||
| 25 | 25 | ||
| 26 | options[:fix_urls] = -> (url) do | 26 | options[:fix_urls] = -> (url) do |
| 27 | url.sub! %r{\A(https://angular\.io/docs/.+/)index\.html\z}, '\1' | 27 | url.sub! %r{\A(https://angular\.io/docs/.+/)index\.html\z}, '\1' |
| 28 | url.sub! %r{\A(https://angular\.io/docs/.+/index)/\z}, '\1' | ||
| 29 | url | 28 | url |
| 30 | end | 29 | end |
| 31 | 30 | ||