wagtail.rb 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. module Docs
  2. class Wagtail < UrlScraper
  3. self.name = 'Wagtail'
  4. self.type = 'sphinx'
  5. self.root_path = 'index.html'
  6. self.links = {
  7. home: 'https://wagtail.org/',
  8. code: 'https://github.com/wagtail/wagtail'
  9. }
  10. # adding filters from lib/docs/filters/wagtail
  11. html_filters.push 'wagtail/entries', 'sphinx/clean_html', 'wagtail/clean_html'
  12. # attributions are seen at the bottom of every page(copyright and license etc. details)
  13. options[:attribution] = <<-HTML
  14. &copy; 2014-present Torchbox Ltd and individual contributors.<br>
  15. All rights are reserved.<br>
  16. Licensed under the BSD License.
  17. HTML
  18. # no one wants to see docs about search or release notes
  19. options[:skip] = %w[search.html]
  20. options[:skip_patterns] = [
  21. %r{\Areleases/}
  22. ]
  23. # updating release and base_url for different versions
  24. version do
  25. self.release = '4.1.1'
  26. self.base_url = 'https://docs.wagtail.org/en/stable/'
  27. end
  28. version '3' do
  29. self.release = '3.0.3'
  30. self.base_url = "https://docs.wagtail.org/en/v#{release}/"
  31. end
  32. version '2' do
  33. self.release = '2.16.3'
  34. self.base_url = "https://docs.wagtail.org/en/v#{release}/"
  35. end
  36. # this method will fetch the latest version of wagtail
  37. def get_latest_version(opts)
  38. get_latest_github_release('wagtail', 'wagtail', opts)
  39. end
  40. end
  41. end