MCPcopy Create free account
hub / github.com/apache/camel-website / RelativeLinks

Class RelativeLinks

rules.js:29–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29class 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
52class StructuredData extends Rule {
53 documentation(context) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected