I've just imported a ton of old content into a Nanoc site, and I'm having fun with the external_links check. Because I'm debugging something, I'm watching traces of some of the things the checker is looking at, and I think there's room for it to help me out a bit more if it can be enhanced.
One specific enhancement I would be interested in would be the ability to warn (or flag as an error) a URL which is permanently redirected. Sometimes this is more innocuous (an http:// to https:// redirection, or removing a www.) and sometimes it signals a change in ownership of the site. I'd want to change my source document either way.
More generally, and potentially as an alternative to that specific proposal, it would be nice to have a couple of defined hook points in the external links validator so that a user could plug in evaluation code of their own to customise the behaviour without having to clone the entire checker.
Before the url = URI.parse(href) and therefore prior to any access, to allow for some pattern matching (e.g., no "external" links to my own site)
Migrated from nanoc/nanoc#1298.
@iay said:
I've just imported a ton of old content into a Nanoc site, and I'm having fun with the
external_links
check. Because I'm debugging something, I'm watching traces of some of the things the checker is looking at, and I think there's room for it to help me out a bit more if it can be enhanced.One specific enhancement I would be interested in would be the ability to warn (or flag as an error) a URL which is permanently redirected. Sometimes this is more innocuous (an
http://
tohttps://
redirection, or removing awww.
) and sometimes it signals a change in ownership of the site. I'd want to change my source document either way.More generally, and potentially as an alternative to that specific proposal, it would be nice to have a couple of defined hook points in the external links validator so that a user could plug in evaluation code of their own to customise the behaviour without having to clone the entire checker.
url = URI.parse(href)
and therefore prior to any access, to allow for some pattern matching (e.g., no "external" links to my own site)