mirror of https://github.com/freeCodeCamp/devdocs
parent
14623be628
commit
8fdaf8a33c
@ -1,5 +1,19 @@
|
|||||||
module Docs
|
module Docs
|
||||||
class Mkdocs < Scraper
|
class Mkdocs < UrlScraper
|
||||||
self.abstract = true
|
self.abstract = true
|
||||||
|
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
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in new issue