Skip to content

Commit 432b46f

Browse files
committed
Fix leaflet documentation
1 parent 5ca406d commit 432b46f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

assets/javascripts/templates/pages/about_tmpl.coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ credits = [
483483
'https://ctan.org/pkg/latex2e-help-texinfo/'
484484
], [
485485
'Leaflet',
486-
'2010-2019 Vladimir Agafonkin<br>&copy; 2010-2011, CloudMade<br>Maps &copy; OpenStreetMap contributors.',
486+
'2010-2021 Vladimir Agafonkin<br>&copy; 2010-2011, CloudMade<br>Maps &copy; OpenStreetMap contributors.',
487487
'BSD',
488488
'https://raw.githubusercontent.com/Leaflet/Leaflet/master/LICENSE'
489489
], [

lib/docs/scrapers/leaflet.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ class Leaflet < UrlScraper
1414
options[:skip_links] = true
1515

1616
options[:attribution] = <<-HTML
17-
&copy; 2010&ndash;2019 Vladimir Agafonkin<br>
17+
&copy; 2010&ndash;2021 Vladimir Agafonkin<br>
1818
&copy; 2010&ndash;2011, CloudMade<br>
1919
Maps &copy; OpenStreetMap contributors.
2020
HTML
2121

2222
version '1.7' do
2323
self.release = '1.7.1'
24-
self.base_url = "https://leafletjs.com/reference-#{release}.html"
24+
self.base_url = "https://leafletjs.com/reference.html"
2525
end
2626

2727
version '1.6' do
@@ -60,9 +60,9 @@ class Leaflet < UrlScraper
6060
end
6161

6262
def get_latest_version(opts)
63-
doc = fetch_doc('https://leafletjs.com/index.html', opts)
64-
link = doc.css('ul > li > a').to_a.select {|node| node.content == 'Docs'}.first
65-
link['href'].scan(/reference-([0-9.]+)\.html/)[0][0]
63+
doc = fetch_doc('https://leafletjs.com/reference-versions.html', opts)
64+
link = doc.at_css('.container > ul > li:last-child > a').content
65+
link.sub(/[a-zA-Z\s]*/, '')
6666
end
6767
end
6868
end

0 commit comments

Comments
 (0)