mirror of https://github.com/freeCodeCamp/devdocs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
436 B
20 lines
436 B
6 years ago
|
module Docs
|
||
6 years ago
|
class Mkdocs < UrlScraper
|
||
6 years ago
|
self.abstract = true
|
||
6 years ago
|
self.type = 'mkdocs'
|
||
|
|
||
|
html_filters.push 'mkdocs/clean_html'
|
||
|
|
||
|
private
|
||
|
|
||
|
def handle_response(response)
|
||
|
# Some scrapped urls don't have ending slash
|
||
|
# which leads to page duplication
|
||
|
if !response.url.path.ends_with?('/') && !response.url.path.ends_with?('index.html')
|
||
|
response.url.path << '/'
|
||
|
end
|
||
|
super
|
||
|
end
|
||
6 years ago
|
end
|
||
|
end
|