Merge pull request #1689 from Homebrew/dependabot/bundler/jekyll-4.4.1
[Homebrew/formulae.brew.sh.git] / docs / Rakefile
blob4d76f69297f9005e998c3d8ca5f891de315407a9
1 # frozen_string_literal: true
3 require "rake"
5 task default: :build
7 desc "Build the site."
8 task :build do
9   sh "jekyll", "build"
10 end
12 desc "Run Markdownlint to validate the Markdown style."
13 task :lint do
14   sh "mdl $(git ls-files '*.md' | grep -v 'Manpage.md')"
15 end
17 desc "Run HTMLProofer to validate the HTML output."
18 task test: :build do
19   require "html-proofer"
20   HTMLProofer.check_directory(
21     "./_site",
22     parallel:            { in_threads: 4 },
23     favicon:             true,
24     ignore_status_codes: [0, 403],
25     check_favicon:       true,
26     check_opengraph:     true,
27     check_html:          true,
28     check_img_http:      true,
29     enforce_https:       true,
30     ignore_files:        [
31       /Kickstarter-Supporters/,
32     ],
33     ignore_urls:         [
34       "/",
35       %r{https://formulae.brew.sh"},
36       %r{https://github.com/},
37       "https://legacy.python.org/dev/peps/pep-0453/#recommendations-for-downstream-distributors",
38     ],
39     cache:               {
40       timeframe: {
41         external: "1h",
42       },
43     },
44   ).run
45 end