| 27 | } |
| 28 | |
| 29 | class RelativeLinks extends Rule { |
| 30 | documentation(context) { |
| 31 | return { |
| 32 | description: "Within the Camel site we should use only relative links" |
| 33 | }; |
| 34 | } |
| 35 | |
| 36 | setup() { |
| 37 | this.on("dom:ready", event => { |
| 38 | const anchors = event.document.getElementsByTagName('a'); |
| 39 | if (anchors === null) { |
| 40 | return; |
| 41 | } |
| 42 | anchors.forEach(a => { |
| 43 | const href = a.getAttribute("href"); |
| 44 | if (href && href.value.startsWith("https://camel.apache.org")) { |
| 45 | this.report(a, `For links within camel.apache.org use relative links, found: ${href.value}`); |
| 46 | } |
| 47 | }); |
| 48 | }); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | class StructuredData extends Rule { |
| 53 | documentation(context) { |
nothing calls this directly
no outgoing calls
no test coverage detected