This plugin adds capability to retrieve Confluence documents from the Backstage Search engine.
Before we begin make sure:
- You have created your own standalone Backstage app using @backstage/create-app and not using a fork of the Backstage repository. If you haven't setup Backstage already, start here.
To use any of the functionality this plugin provides, you need to start by configuring your App with the following config:
confluence:
baseUrl: http://confluence.example.com
auth:
type: bearer
token: youApiToken
spaces: [] # Warning, it is highly recommended to safely list the spaces that you want to index, either all documents will be indexed.
This confluence frontend plugin is primarily responsible for the following:
- Exposing Confluence related component
<ConfluenceSearchResultListItem />
which can be used for composing the search page.
Note: For Confluence specific search results to be returned, it needs to be indexed. Use the search-backend-module-confluence-collator to index Confluence documents to search.
When you have you packages/app/src/components/search/SearchPage.tsx
file ready to make modifications, add the following code snippet to add the ConfluenceSearchResultListItem
web the type of search results are confluence
.
import {
ConfluenceSearchResultListItem,
ConfluenceSearchIcon } from '@backstage-community/plugin-confluence';
...
<SearchType.Accordion
name="Result Type"
defaultValue="software-catalog"
types={[
...
{
value: 'confluence',
name: 'Confluence',
icon: <ConfluenceSearchIcon />,
},
]}
/>
...
<SearchResult>
...
<ConfluenceSearchResultListItem icon={<ConfluenceSearchIcon />} />
</SearchResult>
Follow this section if you are using Backstage's new frontend system.
Import confluencePlugin
in your App.tsx
and add it to your app's features
array:
import confluencePlugin from '@backstage-community/plugin-confluence/alpha';
// ...
export const app = createApp({
features: [
// ...
confluencePlugin,
// ...
],
});
Thanks to K-Phoen for creating the confluence plugin found here. As an outcome of this discussion, he gave us permission to keep working on this plugin.