Closed 1jasgithub closed 1 year ago
Hi @1jasgithub!
The code for excluding URLs from the testing uses a simple regular expression, so you should be able to pass any valid regular expression and pa11y-ci will match all the URLs in the sitemap against the regexp.
As what you're passing as an argument to pa11y is a regex, the character *
in your command will be interpreted as "zero or more instances of the previous token" rather than a pathname wildcard. Something like the following should work to exclude PDFs:
pa11y-ci --sitemap 'http://localhost:4000/sitemap.xml' --sitemap-exclude '\.pdf$'
Hello, how would I include the '--sitemap-exclude' command-line option with our website?
pa11y-ci keeps failing on pdfs.
I see this line in package.json "pa11y-ci:sitemap": "pa11y-ci --sitemap http://localhost:4000/sitemap.xml --sitemap-exclude \"/*.pdf\" --sitemap-exclude \"/admin\""
but not sure how to use it to exclude the pdf? (I'm a new user) Thanks! Jas