diff --git a/plugins/techdocs/src/Router.tsx b/plugins/techdocs/src/Router.tsx index 45b0dc756c..102cda979a 100644 --- a/plugins/techdocs/src/Router.tsx +++ b/plugins/techdocs/src/Router.tsx @@ -25,6 +25,9 @@ import { MissingAnnotationEmptyState } from '@backstage/core-components'; const TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref'; +export const isTechDocsAvailable = (entity: Entity) => + Boolean(entity?.metadata?.annotations?.[TECHDOCS_ANNOTATION]); + export const Router = () => { return ( diff --git a/plugins/techdocs/src/index.ts b/plugins/techdocs/src/index.ts index ba24f1c39d..50e25c5582 100644 --- a/plugins/techdocs/src/index.ts +++ b/plugins/techdocs/src/index.ts @@ -44,4 +44,4 @@ export { TechDocsReaderPage, } from './plugin'; export * from './reader'; -export { EmbeddedDocsRouter, Router } from './Router'; +export { EmbeddedDocsRouter, Router, isTechDocsAvailable } from './Router';