I recently wanted to detect and clear out all the old files in my static site. I did this by
- running hyperlink
- munging its text output to get a list of files accessible from the roots
- using
find to list all files in my static site
- using
diff to list those files in my static site that are not accessible from the roots
- deleting those files
Hyperlink was very useful here, but I think it would be cool if the feature was built in, or if there was a good example in the README for how to do this with hyperlink. Ultimately I'd like to have this test in my CI to ensure I keep the site clean.
(Not posting my script here because it's awful messy, mostly due to scraping hyperlink's stdout!)
I recently wanted to detect and clear out all the old files in my static site. I did this by
findto list all files in my static sitediffto list those files in my static site that are not accessible from the rootsHyperlink was very useful here, but I think it would be cool if the feature was built in, or if there was a good example in the README for how to do this with hyperlink. Ultimately I'd like to have this test in my CI to ensure I keep the site clean.
(Not posting my script here because it's awful messy, mostly due to scraping hyperlink's stdout!)