Comments (3)
You have a couple of options here:
- If the new links point to known URLs, you can ignore the URLs directly:
htmlproofer --ignore-urls "/www.github.com/,/foo.com/"
- If you are able to edit the HTML directly, adding a
data-proofer-ignore
attribute to any element ignores any checks:<a href="https://notareallink" data-proofer-ignore>Not checked.</a>
- You can also explicitly ignore specific files from checks:
htmlproofer --ignore-files "/dir_of_new_files/, new_file.html"
Would any of these work for you? The GitHub Action example just collects all the new files and passes them into --ignore-files
--you can provide your own list or a directory if that's easier.
from html-proofer.
(Closing this not because I won't keep helping if you have questions, but because I like to keep a clean issue list in my repos.)
from html-proofer.
hi 👋 thank you!! i definitely understand issue lists becoming unwieldy!
i think i may have poorly described the issue.
Essentially we are creating a new piece of content in the PR so the new link is a new page on the website. please see here: for an example (screenshot below as well). Essentially installable-code.html is a new page in our guidebook that we are adding. so every time we add a new page html proofer can't find it because it isn't online yet.
In the html-proofer readme, i see a section on ignoring new files.
the code is below and i think it's trying to parse through the files but skipping the newly added file (maybe)?:
directories = ['content']
merge_base = %x(git merge-base origin/production HEAD).chomp
diffable_files = %x(git diff -z --name-only --diff-filter=AC #{merge_base}).split("\0")
diffable_files = diffable_files.select do |filename|
next true if directories.include?(File.dirname(filename))
filename.end_with?(".md")
end.map { |f| Regexp.new(File.basename(f, File.extname(f))) }
HTMLProofer.check_directory("./output", { ignore_urls: diffable_files }).run
but
- i'm not sure how to implement this in my github action here.
- And i'm also not sure if i do implement that fix will it totally skip checking the new page for bad links and such as well?
i hope this makes more sense! Essentially each time i create a new website page, our build breaks because the new page is not yet online and as such it's a broken link according to HTML proofer (i think anyway that is what is happening). many thanks again!!
from html-proofer.
Related Issues (20)
- Official HTMLProofer Docker image HOT 2
- v5 upgrade guide? HOT 1
- Reporting broken links when using relative internal links reported as broken HOT 11
- Fails multi email mailto
- Add --ignore-internal flag HOT 4
- Error for http only sites HOT 5
- allow_missing_href started giving false positives since v4.3 HOT 2
- cyn.eth
- HTTP 302 (to the same URL?) reported as failures HOT 2
- Error during deployment with scheme format HOT 3
- "ERROR: Invalid predicate" on ugly Maven search URL HOT 2
- Manager
- Small extra hint for beginners HOT 2
- Ruby 3.3.0 parameters bug HOT 3
- CI output disappeared when running htmlproofer, only raw logs show errors HOT 1
- The regex in Attribute::URL.clean_url is very slow for JavaScript bookmarklet URLs HOT 2
- Allow color in non tty shell HOT 7
- Link checker triggered on <a name="..."> and <a id="..."> HOT 6
- Want documentation (or even feature?) to parallelize local scans HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html-proofer.