jekyll.rb 990 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. module Docs
  2. class Jekyll < UrlScraper
  3. self.type = 'jekyll'
  4. self.base_url = 'https://jekyllrb.com/docs/'
  5. self.root_path = 'index.html'
  6. self.links = {
  7. home: 'https://jekyllrb.com/',
  8. code: 'https://github.com/jekyll/jekyll'
  9. }
  10. html_filters.push 'jekyll/clean_html', 'jekyll/entries'
  11. options[:trailing_slash] = true
  12. options[:skip] = %w(sites/ upgrading/)
  13. options[:skip_patterns] = [
  14. /conduct/,
  15. /history/,
  16. /maintaining/,
  17. /contributing/,
  18. ]
  19. options[:replace_paths] = {
  20. 'templates/' => 'liquid/'
  21. }
  22. options[:attribution] = <<-HTML
  23. &copy; 2020 Jekyll Core Team and contributors<br>
  24. Licensed under the MIT license.
  25. HTML
  26. version '4' do
  27. self.release = '4.1.1'
  28. end
  29. version '3' do
  30. self.release = '3.7.2'
  31. end
  32. def get_latest_version(opts)
  33. doc = fetch_doc('https://jekyllrb.com/docs/', opts)
  34. doc.at_css('.meta a').content[1..-1]
  35. end
  36. end
  37. end