Skip to content

Commit

Permalink
Drop dead links if they're camel ones
Browse files Browse the repository at this point in the history
  • Loading branch information
holly-cummins committed Feb 29, 2024
1 parent b8a3069 commit 9a4cdc2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/util/guide-url-rewriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const rewriteGuideUrl = async ({ name, metadata }) => {
// In general, links should be valid. However, relax that requirement for deprecated extensions because
// the guide may have been taken down well after the release, and an extension is not going to do a new release
// to remove a dead guide link, on an extension which is dead anyway.
//Also relax it for Camel extensions - see https://github.com/apache/camel-quarkus/issues/5814#issuecomment-1968999263
if (!exists) {
if (metadata?.status?.includes("deprecated")) {
console.warn(
Expand Down Expand Up @@ -64,6 +65,17 @@ const rewriteGuideUrl = async ({ name, metadata }) => {
}
}
}

// If none of the transforms worked, if this is a camel link, drop the dead link
if (metadata?.maven?.groupId === "org.apache.camel.quarkus") {
console.warn(
"Dropping dead guide link from Camel extension. Extension is:",
name,
"and guide link is",
originalLink
)
return undefined
}
}

return originalLink
Expand Down

0 comments on commit 9a4cdc2

Please sign in to comment.