From dc7ae8b20a902017dea554e9d96a3c2ed32db52c Mon Sep 17 00:00:00 2001 From: secustor Date: Thu, 25 Jan 2024 16:12:42 +0100 Subject: [PATCH] fix(plugins/home/FeatureDocsCard): fall back to metadata.name if no title has been supplied Signed-off-by: secustor --- .changeset/nasty-shirts-look.md | 5 +++++ .../home/src/homePageComponents/FeaturedDocsCard/Content.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/nasty-shirts-look.md diff --git a/.changeset/nasty-shirts-look.md b/.changeset/nasty-shirts-look.md new file mode 100644 index 0000000000..2742ebd1f6 --- /dev/null +++ b/.changeset/nasty-shirts-look.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-home': patch +--- + +Fall back to metadata.name if no metadata.title has been defined diff --git a/plugins/home/src/homePageComponents/FeaturedDocsCard/Content.tsx b/plugins/home/src/homePageComponents/FeaturedDocsCard/Content.tsx index eb8d78b0cc..21ed43003b 100644 --- a/plugins/home/src/homePageComponents/FeaturedDocsCard/Content.tsx +++ b/plugins/home/src/homePageComponents/FeaturedDocsCard/Content.tsx @@ -116,7 +116,7 @@ export const Content = (props: FeaturedDocsCardProps): JSX.Element => { }/` } > - {d.metadata.title} + {d.metadata.title ?? d.metadata.name} {d.metadata.description && (