Adding handling which checks if the current entity (the catalog entity being loaded) has an annotation for an external entity's TechDocs. If it does then we will redirect there rather than allowing a 404 (mic drop). This helps keep older URLs routing to the updated locations.

Adding changesets.
Adding test coverage for external TechDocs entitiy redirect.

Signed-off-by: Owen Shartle <timeloveinvent+github@gmail.com>
This commit is contained in:
Owen Shartle
2025-08-25 15:39:29 -04:00
parent dae9dd1af0
commit a0b604cb6a
11 changed files with 255 additions and 20 deletions
@@ -10,3 +10,17 @@ spec:
type: service
lifecycle: experimental
owner: user:guest
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: techdocs-entity-documented-component
title: Example Entity Documented By TechDocs Entity Annotation
description: A Service with TechDocs documentation via the `backstage.io/techdocs-entity` annotation.
annotations:
backstage.io/techdocs-entity: component:default/documented-component
backstage.io/techdocs-entity-path: /inner-component-docs
spec:
type: service
lifecycle: experimental
owner: user:guest
@@ -0,0 +1,5 @@
# Inner Component Docs
This is a basic example of documentation within a larger suite of TechDocs that can be referenced by whatever entities necessary. It is intended as a showcase of the `backstage.io/techdocs-entity-path` annotation for linking to a "subpage" in TechDocs that are declared by another entity.
Please review the [How-To Guides - Deep Linking Into TechDocs](../../../../../../docs/features/techdocs/how-to-guides.md#deep-linking-into-techdocs) section for more information and you can view the example usage on the "Example Entity Documented By TechDocs Entity Annotation" component in this [catalog-info.yaml](../../catalog-info.yaml) file.
@@ -7,6 +7,8 @@ nav:
- Subpage: sub-page.md
- 'Code Sample': code/code-sample.md
- Extensions: extensions.md
- 'Inner Component Docs': inner-component-docs/index.md
plugins:
- techdocs-core