1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/website/docusaurus.config.js

222 lines
7.9 KiB
JavaScript
Raw Normal View History

/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: 'Unleash',
tagline: 'The enterprise ready feature toggle service',
url: 'https://docs.getunleash.io',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'Unleash', // Usually your GitHub org/user name.
projectName: 'unleash.github.io', // Usually your repo name.
trailingSlash: false,
customFields: {
// expose env vars etc here
unleashProxyUrl: process.env.UNLEASH_PROXY_URL,
unleashProxyClientKey: process.env.UNLEASH_PROXY_CLIENT_KEY,
unleashFeedbackTargetUrl: process.env.UNLEASH_FEEDBACK_TARGET_URL,
environment: process.env.NODE_ENV,
},
themeConfig: {
defaultMode: 'light',
disableSwitch: true,
respectPrefersColorScheme: false,
2021-06-16 08:52:33 +02:00
algolia: {
appId: 'BH4D9OD16A',
apiKey: '9772249a7262b377ac876853d32bd760',
indexName: 'getunleash',
2021-06-16 08:52:33 +02:00
},
announcementBar: {
id: 'strategy-constraints-announcement',
content:
'🚀 Unleash brings powerful Constraints feature to OSS users. <a href=https://www.getunleash.io/blog/unleash-brings-powerful-constraints-feature-to-oss-users title="Unleash blog: Constraints are now available to open-source users">Read more</a> →',
isCloseable: true,
},
navbar: {
title: 'Unleash',
logo: {
alt: 'Unleash logo',
src: 'img/logo.svg',
},
items: [
{
href: 'https://www.getunleash.io/plans',
label: 'Unleash Enterprise',
position: 'right',
},
{
href: 'https://github.com/Unleash/unleash',
position: 'right',
className: 'header-github-link',
'aria-label': 'Unleash GitHub repository',
},
],
},
2021-06-04 14:50:52 +02:00
prism: {
additionalLanguages: [
'csharp',
'http',
'java',
'kotlin',
'php',
'ruby',
'swift',
],
},
footer: {
style: 'dark',
links: [
{
title: 'Product',
items: [
{
label: 'Docs',
to: '/',
2021-08-11 12:55:56 +02:00
},
{
label: 'Unleash on GitHub',
href: 'https://github.com/Unleash/unleash',
2021-08-11 12:55:56 +02:00
},
{
label: 'Roadmap',
href: 'https://github.com/orgs/Unleash/projects/5',
},
],
},
{
title: 'Community',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/unleash',
},
{
label: 'Slack',
href: 'https://slack.unleash.run/',
},
{
label: 'Twitter',
href: 'https://twitter.com/getunleash',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Unleash. Built with Docusaurus.`,
logo: {
src: 'img/logo.svg',
alt: 'Unleash logo',
},
},
image: 'img/logo.png',
},
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl:
'https://github.com/Unleash/unleash/edit/main/website/',
routeBasePath: '/',
remarkPlugins: [
[
require('@docusaurus/remark-plugin-npm2yarn'),
{ sync: true },
],
],
docLayoutComponent: '@theme/DocPage',
docItemComponent: '@theme/ApiItem',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
googleAnalytics: {
trackingID: 'UA-134882379-1',
},
},
],
],
plugins: [
[
docs: update images using latest UI screenshots (#1992) * Update api_access_history.png * updating images in - How to capture impression data * Update Quickstart image * Update images: How to add strategy constraints * Update images: How to create a feature toggle * Update images: How to define custom context fields * Update images: How to use custom activation strategies * Update images: How to schedule feature releases * Update images: How to add new users to your Unleash instance * Update images: How to create and assign custom project roles * Update images: How to add SSO with OpenId Connect * Update images: How to add SSO with SAML 2.0 Okta * Update images: Slack * Update images: Activation Strategies * Update images: Archived toggles * Update images: The audit log * Update images: Impression data * Update images: Custom Activation Strategies * Update images: Environments * Update images: Feature Toggle Types * Update images: Feature Toggle Variants * Update images: Projects * Update images: Segments * Update images: Stickiness * Update images: Strategy Constraints * Update images: Technical Debt * Update images: Unleash Context * Update images: Unleash introductory overview * Update images: Unleash introductory overview * docs: replace strategy constraints step 2 img * Update website/docs/how-to/how-to-add-strategy-constraints.md Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * change text request * Updating docs text to match the screenshots * Docs: change audit log to event log and add redirects * Docs: update "archive" page with deletion info * Docs: update constraints how to * Docs: minor tech debt doc fixes * docs-update-images-set1: update overview page * Apply suggestions from code review Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * Update website/docs/user_guide/quickstart.md Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * Update website/docs/user_guide/user-management.md Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * Update website/docs/user_guide/user-management.md Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * Activation strategy update * Apply suggestions from code review * Update delete-archive img * Fix prettier formatting for admonitions * Update website/docs/user_guide/environments.md * Update website/docs/user_guide/projects.md Co-authored-by: Tymoteusz Czech <tymek+gpg@getunleash.ai> Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2022-09-14 09:59:18 +02:00
// heads up to anyone making redirects:
//
// remember that redirects only work in production and not in
// development, as mentioned in the docs
// https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-client-redirects/
'@docusaurus/plugin-client-redirects',
{
fromExtensions: ['html', 'htm'],
redirects: [
{
2021-06-04 14:38:11 +02:00
to: '/sdks',
from: [
'/user_guide/client-sdk',
'/client-sdk',
'/user_guide/connect_sdk',
'/sdks/community',
],
},
2021-06-10 23:15:14 +02:00
{
to: '/user_guide/api-token',
from: '/deploy/user_guide/api-token',
2021-06-10 23:15:14 +02:00
},
{
to: '/sdks/unleash-proxy',
from: '/user_guide/native_apps/',
2021-06-10 23:15:14 +02:00
},
{
to: '/advanced/toggle_variants',
from: '/toggle_variants',
},
{
2022-01-11 10:38:22 +01:00
to: '/integrations',
from: '/integrations/integrations',
},
{
to: '/user_guide/activation_strategy',
from: '/user_guide/control_rollout',
},
{
from: '/advanced/impression_data',
to: '/advanced/impression-data',
},
docs: update images using latest UI screenshots (#1992) * Update api_access_history.png * updating images in - How to capture impression data * Update Quickstart image * Update images: How to add strategy constraints * Update images: How to create a feature toggle * Update images: How to define custom context fields * Update images: How to use custom activation strategies * Update images: How to schedule feature releases * Update images: How to add new users to your Unleash instance * Update images: How to create and assign custom project roles * Update images: How to add SSO with OpenId Connect * Update images: How to add SSO with SAML 2.0 Okta * Update images: Slack * Update images: Activation Strategies * Update images: Archived toggles * Update images: The audit log * Update images: Impression data * Update images: Custom Activation Strategies * Update images: Environments * Update images: Feature Toggle Types * Update images: Feature Toggle Variants * Update images: Projects * Update images: Segments * Update images: Stickiness * Update images: Strategy Constraints * Update images: Technical Debt * Update images: Unleash Context * Update images: Unleash introductory overview * Update images: Unleash introductory overview * docs: replace strategy constraints step 2 img * Update website/docs/how-to/how-to-add-strategy-constraints.md Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * change text request * Updating docs text to match the screenshots * Docs: change audit log to event log and add redirects * Docs: update "archive" page with deletion info * Docs: update constraints how to * Docs: minor tech debt doc fixes * docs-update-images-set1: update overview page * Apply suggestions from code review Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * Update website/docs/user_guide/quickstart.md Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * Update website/docs/user_guide/user-management.md Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * Update website/docs/user_guide/user-management.md Co-authored-by: Thomas Heartman <thomas@getunleash.ai> * Activation strategy update * Apply suggestions from code review * Update delete-archive img * Fix prettier formatting for admonitions * Update website/docs/user_guide/environments.md * Update website/docs/user_guide/projects.md Co-authored-by: Tymoteusz Czech <tymek+gpg@getunleash.ai> Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
2022-09-14 09:59:18 +02:00
{
from: '/advanced/audit_log',
to: '/reference/event-log',
},
],
createRedirects: function (toPath) {
if (
toPath.indexOf('/docs/') === -1 &&
toPath.indexOf('index.html') === -1
) {
return `/docs/${toPath}`;
}
},
},
],
Add OpenAPI docs (#1391) (#2066) ## What This PR (finally 🎉) adds generated OpenAPI docs to the official Unleash documentation. In addition to generating docs when things get merged to main, it also pushes new doc updates every day at 12:00 AM (cron `@daily`). ## Why Now that we have OpenAPI'd all the things, we can finally start using it. This will allow us to remove hand-written api docs from the documentation and should make sure everything is always kept up to date. ### Generating from us-hosted (Unleash enterprise) Unleash has several different versions (open source, pro, enterprise). The versions do not necessarily have the exact same api surface. In fact, the enterprise version has a few endpoints that open source does not. Because we want to have _all_ endpoints listed in the documentation we need to generated the docs from an enterprise spec. Which brings us into the next point: ### The need for scheduled jobs Regarding the daily scheduled tasks to update the documentation: why do we need that? The docs are generated from the tip of the main branch. For most of the docs, this is good and something that we want. However, because the OpenAPI docs are generated from the enterprise edition, it _will not be in sync_ with the open source main branch. Also, we probably do not want the docs to list the current bleeding edge api changes. Instead, we should prefer to use the latest enterprise release (roughly). However, because we don't get notified when this version is released and deployed, we'll instead run the API generation on a daily cadence. This isn't the perfect solution, but it's simple and gets us 80% of the way there. More intricate solutions can be set up later. ## How - By adding a scheduled workflow to the generate docs config. - By adding .gitignore entries for the generated files There's also some minor changes in styling etc. ## Dependencies This is dependent on the changes introduced in #2062 having propagated to the enterprise release, which will probably not be for another week or so. ## Discussion What should the API reference docs url be? I've set it to be `/reference/api/unleash/*` for now, but I'm on the fence about whether it should be `apis` or `api` in there. I also want to get the proxy and other APIs in there as we grow. ------- ## Commits * docs: style openapi operation buttons * docs: minor operation badge adjustments * docs: use permalink to css snippet i copied * docs: ignore files related to openapi generation * docs: re-enable openapi docs * Docs(#1391): prep for integration * docs(#1391): run docs generation daily * docs(#1391): add generation step to doc prs too * docs(#1391): use the US hosted instance to generate docs * docs(#1391): move doc generation into build command * docs(#1391): use `/reference/api/*` instead of `/reference/apis/*`
2022-09-19 14:50:24 +02:00
[
'docusaurus-plugin-openapi-docs',
{
id: 'api-operations',
docsPluginId: 'classic',
config: {
server: {
specPath:
2022-09-20 12:43:39 +02:00
process.env.OPENAPI_SOURCE === 'localhost'
Add OpenAPI docs (#1391) (#2066) ## What This PR (finally 🎉) adds generated OpenAPI docs to the official Unleash documentation. In addition to generating docs when things get merged to main, it also pushes new doc updates every day at 12:00 AM (cron `@daily`). ## Why Now that we have OpenAPI'd all the things, we can finally start using it. This will allow us to remove hand-written api docs from the documentation and should make sure everything is always kept up to date. ### Generating from us-hosted (Unleash enterprise) Unleash has several different versions (open source, pro, enterprise). The versions do not necessarily have the exact same api surface. In fact, the enterprise version has a few endpoints that open source does not. Because we want to have _all_ endpoints listed in the documentation we need to generated the docs from an enterprise spec. Which brings us into the next point: ### The need for scheduled jobs Regarding the daily scheduled tasks to update the documentation: why do we need that? The docs are generated from the tip of the main branch. For most of the docs, this is good and something that we want. However, because the OpenAPI docs are generated from the enterprise edition, it _will not be in sync_ with the open source main branch. Also, we probably do not want the docs to list the current bleeding edge api changes. Instead, we should prefer to use the latest enterprise release (roughly). However, because we don't get notified when this version is released and deployed, we'll instead run the API generation on a daily cadence. This isn't the perfect solution, but it's simple and gets us 80% of the way there. More intricate solutions can be set up later. ## How - By adding a scheduled workflow to the generate docs config. - By adding .gitignore entries for the generated files There's also some minor changes in styling etc. ## Dependencies This is dependent on the changes introduced in #2062 having propagated to the enterprise release, which will probably not be for another week or so. ## Discussion What should the API reference docs url be? I've set it to be `/reference/api/unleash/*` for now, but I'm on the fence about whether it should be `apis` or `api` in there. I also want to get the proxy and other APIs in there as we grow. ------- ## Commits * docs: style openapi operation buttons * docs: minor operation badge adjustments * docs: use permalink to css snippet i copied * docs: ignore files related to openapi generation * docs: re-enable openapi docs * Docs(#1391): prep for integration * docs(#1391): run docs generation daily * docs(#1391): add generation step to doc prs too * docs(#1391): use the US hosted instance to generate docs * docs(#1391): move doc generation into build command * docs(#1391): use `/reference/api/*` instead of `/reference/apis/*`
2022-09-19 14:50:24 +02:00
? 'http://localhost:4242/docs/openapi.json'
: 'https://us.app.unleash-hosted.com/ushosted/docs/openapi.json',
outputDir: 'docs/reference/api/unleash',
sidebarOptions: {
groupPathsBy: 'tag',
categoryLinkSource: 'tag',
},
},
},
},
],
],
themes: ['docusaurus-theme-openapi-docs'], // Allows use of @theme/ApiItem and other components
};