2021-06-15 22:38:40 +02:00
/ * *
* Copyright ( c ) Facebook , Inc . and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* /
const path = require ( 'path' ) ;
2022-07-27 18:39:04 +02:00
2023-06-20 16:26:05 +02:00
// read this text file
const fs = require ( 'fs' ) ;
const versions = fs . readFileSync ( '../../version.txt' , 'utf8' ) . split ( '\n' ) ;
2021-06-15 22:38:40 +02:00
// This probably only makes sense for the beta phase, temporary
2022-07-27 18:39:04 +02:00
// function getNextBetaVersionName() {
// const expectedPrefix = '';
2021-06-15 22:38:40 +02:00
2022-07-27 18:39:04 +02:00
// const lastReleasedVersion = versions[0];
// if (!lastReleasedVersion.includes(expectedPrefix)) {
// throw new Error(
// 'this code is only meant to be used during the 2.0 beta phase.'
// );
// }
// const version = parseInt(lastReleasedVersion.replace(expectedPrefix, ''), 10);
// return `${expectedPrefix}${version + 1}`;
// }
2021-06-15 22:38:40 +02:00
2022-07-27 18:39:04 +02:00
// const allDocHomesPaths = [
// '/docs/',
// '/docs/next/',
// ...versions.slice(1).map(version => `/docs/${version}/`),
// ];
2021-06-15 22:38:40 +02:00
const isDev = process . env . NODE _ENV === 'development' ;
const isDeployPreview =
process . env . NETLIFY && process . env . CONTEXT === 'deploy-preview' ;
2021-06-16 14:30:10 +02:00
const baseUrl = process . env . BASE _URL || '/' ;
2021-06-15 22:38:40 +02:00
const isBootstrapPreset = process . env . DOCUSAURUS _PRESET === 'bootstrap' ;
// Special deployment for staging locales until they get enough translations
// https://app.netlify.com/sites/docusaurus-i18n-staging
// https://docusaurus-i18n-staging.netlify.app/
const isI18nStaging = process . env . I18N _STAGING === 'true' ;
2021-06-16 01:11:09 +02:00
// const isVersioningDisabled = !!process.env.DISABLE_VERSIONING || isI18nStaging;
2021-06-15 22:38:40 +02:00
2021-06-15 17:50:38 +02:00
/** @type {import('@docusaurus/types').DocusaurusConfig} */
2022-07-27 18:39:04 +02:00
module . exports = {
2021-06-16 05:32:37 +02:00
title : 'OHIF' ,
2021-08-24 14:13:54 +02:00
tagline : 'Open-source web-based medical imaging platform' ,
2021-07-15 00:04:36 +02:00
organizationName : 'Open Health Imaging Foundation' ,
2021-06-16 05:32:37 +02:00
projectName : 'OHIF' ,
2021-06-15 22:38:40 +02:00
baseUrl ,
baseUrlIssueBanner : true ,
2023-06-06 19:34:26 +02:00
url : 'https://docs.ohif.org' ,
2021-06-15 22:38:40 +02:00
i18n : {
defaultLocale : 'en' ,
locales : isDeployPreview
? // Deploy preview: keep it fast!
2022-07-27 18:39:04 +02:00
[ 'en' ]
2021-06-15 22:38:40 +02:00
: isI18nStaging
2022-07-27 18:39:04 +02:00
? // Staging locales: https://docusaurus-i18n-staging.netlify.app/
2021-06-16 14:30:10 +02:00
[ 'en' ]
2022-07-27 18:39:04 +02:00
: // Production locales
2021-06-16 14:30:10 +02:00
[ 'en' ] ,
2021-06-15 22:38:40 +02:00
} ,
onBrokenLinks : 'warn' ,
2021-06-15 17:50:38 +02:00
onBrokenMarkdownLinks : 'warn' ,
2021-06-22 23:12:00 +02:00
favicon : 'img/favicon.ico' ,
2021-06-15 22:38:40 +02:00
// customFields: {
// description:
// 'An optimized site generator in React. Docusaurus helps you to move fast and write content. Build documentation websites, blogs, marketing pages, and more.',
// },
themes : [ '@docusaurus/theme-live-codeblock' ] ,
plugins : [
2021-07-13 23:48:16 +02:00
path . resolve ( _ _dirname , './pluginOHIFWebpackConfig.js' ) ,
2021-07-01 03:37:09 +02:00
'plugin-image-zoom' , // 3rd party plugin for image click to pop
2021-06-15 22:38:40 +02:00
[
'@docusaurus/plugin-client-redirects' ,
{
fromExtensions : [ 'html' ] ,
2021-07-06 02:47:30 +02:00
redirects : [
{
// we need this for https://cloud.google.com/healthcare/docs/how-tos/dicom-viewers
2023-06-20 16:26:05 +02:00
to : '/2.0-deprecated/deployment/recipes/google-cloud-healthcare' ,
2021-07-13 23:48:16 +02:00
from : [
'/connecting-to-image-archives/google-cloud-healthcare' ,
'/connecting-to-image-archives/google-cloud-healthcare.html' ,
] ,
} ,
] ,
2021-07-06 02:47:30 +02:00
// createRedirects: function(path) {
// // redirect to /docs from /docs/introduction,
// // as introduction has been made the home doc
// // if (allDocHomesPaths.includes(path)) {
// // return [`${path}/introduction`];
// // }
// if (path.includes("/connecting-to-image-archives/google-cloud-healthcare")) {
// return ["/deployment/recipes/google-cloud-healthcare"]
// }
// },
2021-06-15 22:38:40 +02:00
// redirects: [
// {
// from: ['/'],
// to: '/docs',
// },
// {
// from: ['/docs/support', '/docs/next/support'],
// to: '/community/support',
// },
// {
// from: ['/docs/team', '/docs/next/team'],
// to: '/community/team',
// },
// {
// from: ['/docs/resources', '/docs/next/resources'],
// to: '/community/resources',
// },
// ],
} ,
] ,
[
'@docusaurus/plugin-ideal-image' ,
{
quality : 70 ,
max : 1030 , // max resized image's size.
min : 640 , // min resized image's size. if original is lower, use that size.
steps : 2 , // the max number of images generated between min and max (inclusive)
} ,
] ,
2021-07-06 02:47:30 +02:00
// [
// '@docusaurus/plugin-pwa',
// {
// debug: isDeployPreview,
// offlineModeActivationStrategies: [
// 'appInstalled',
// 'standalone',
// 'queryString',
// ],
// // swRegister: false,
// // swCustom: path.resolve(__dirname, 'src/sw.js'),
// pwaHead: [
// {
// tagName: 'link',
// rel: 'icon',
// href: 'img/docusaurus.png',
// },
// {
// tagName: 'link',
// rel: 'manifest',
// href: `${baseUrl}manifest.json`,
// },
// {
// tagName: 'meta',
// name: 'theme-color',
// content: 'rgb(37, 194, 160)',
// },
// {
// tagName: 'meta',
// name: 'apple-mobile-web-app-capable',
// content: 'yes',
// },
// {
// tagName: 'meta',
// name: 'apple-mobile-web-app-status-bar-style',
// content: '#000',
// },
// {
// tagName: 'link',
// rel: 'apple-touch-icon',
// href: 'img/docusaurus.png',
// },
// {
// tagName: 'link',
// rel: 'mask-icon',
// href: 'img/docusaurus.svg',
// color: 'rgb(62, 204, 94)',
// },
// {
// tagName: 'meta',
// name: 'msapplication-TileImage',
// content: 'img/docusaurus.png',
// },
// {
// tagName: 'meta',
// name: 'msapplication-TileColor',
// content: '#000',
// },
// ],
// },
2021-08-24 14:13:54 +02:00
// ]
2021-06-15 22:38:40 +02:00
] ,
presets : [
[
2022-07-27 18:39:04 +02:00
'classic' ,
/** @type {import('@docusaurus/preset-classic').Options} */
( {
2021-06-15 22:38:40 +02:00
debug : true , // force debug plugin usage
docs : {
routeBasePath : '/' ,
path : 'docs' ,
sidebarPath : require . resolve ( './sidebars.js' ) ,
editUrl : ( { locale , docPath } ) => {
2021-08-24 14:13:54 +02:00
/ * i f ( l o c a l e ! = = ' e n ' ) {
2021-06-15 22:38:40 +02:00
return ` https://crowdin.com/project/docusaurus-v2/ ${ locale } ` ;
2021-08-24 14:13:54 +02:00
} * /
2021-06-15 22:38:40 +02:00
// We want users to submit doc updates to the upstream/next version!
// Otherwise we risk losing the update on the next release.
2023-06-06 19:34:26 +02:00
return ` https://github.com/OHIF/Viewers/edit/master/platform/docs/docs/ ${ docPath } ` ;
2021-06-15 22:38:40 +02:00
} ,
showLastUpdateAuthor : true ,
showLastUpdateTime : true ,
// remarkPlugins: [
// [require('@docusaurus/remark-plugin-npm2yarn'), { sync: true }],
// ],
2021-06-16 01:11:09 +02:00
// disableVersioning: isVersioningDisabled,
2021-08-24 14:13:54 +02:00
lastVersion : 'current' ,
2021-06-16 01:11:09 +02:00
// onlyIncludeVersions:
// !isVersioningDisabled && (isDev || isDeployPreview)
// ? ['current', ...versions.slice(0, 2)]
// : undefined,
2021-08-24 14:13:54 +02:00
versions : {
current : {
2023-06-20 16:26:05 +02:00
label : ` ${ versions } (Latest) ` ,
2021-08-24 14:13:54 +02:00
} ,
} ,
2021-06-15 22:38:40 +02:00
} ,
theme : {
customCss : [ require . resolve ( './src/css/custom.css' ) ] ,
} ,
2023-06-13 04:05:01 +02:00
gtag : {
trackingID : 'G-DDBJFE34EG' ,
anonymizeIP : true ,
} ,
2022-07-27 18:39:04 +02:00
} ) ,
2021-06-15 22:38:40 +02:00
] ,
] ,
2022-07-27 18:39:04 +02:00
themeConfig :
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
( {
liveCodeBlock : {
playgroundPosition : 'bottom' ,
} ,
docs : {
sidebar : {
hideable : true ,
autoCollapseCategories : true ,
} ,
} ,
colorMode : {
defaultMode : 'dark' ,
disableSwitch : false ,
// respectPrefersColorScheme: true,
} ,
2023-07-27 18:39:12 +02:00
announcementBar : {
id : 'healthimaging' ,
content :
'🚀 AWS has announced the general availability of <a target="_blank" rel="noopener noreferrer" href=" https://aws.amazon.com/about-aws/whats-new/2023/07/general-availability-aws-healthimaging/">HealthImaging!</a> Easily connect your OHIF to it. Learn more <a target="_blank" rel="noopener noreferrer" href="https://github.com/RadicalImaging/ohif-aws-healthimaging">Here!</a>! 🌟' ,
} ,
2022-07-27 18:39:04 +02:00
prism : {
theme : require ( 'prism-react-renderer/themes/github' ) ,
darkTheme : require ( 'prism-react-renderer/themes/dracula' ) ,
2021-06-15 17:50:38 +02:00
} ,
2022-07-27 18:39:04 +02:00
algolia : {
appId : 'EFLT6YIHHZ' ,
apiKey : 'c220dd24fe4f86248eea3b1238a1fb60' ,
indexName : 'ohif' ,
} ,
navbar : {
hideOnScroll : false ,
logo : {
alt : 'OHIF Logo' ,
src : 'img/ohif-logo-light.svg' ,
srcDark : 'img/ohif-logo.svg' ,
2021-06-15 17:50:38 +02:00
} ,
2022-07-27 18:39:04 +02:00
items : [
{
2023-06-20 16:26:05 +02:00
href : 'https://ohif.org/showcase' ,
2023-06-13 04:05:01 +02:00
label : 'Showcase' ,
2023-06-06 19:34:26 +02:00
target : '_blank' ,
2022-07-27 18:39:04 +02:00
position : 'left' ,
} ,
{
position : 'left' ,
to : '/' ,
activeBaseRegex : '^(/next/|/)$' ,
docId : 'Introduction' ,
label : 'Docs' ,
} ,
{
2023-06-20 16:26:05 +02:00
href : 'https://ohif.org/collaborate' ,
2023-06-13 04:05:01 +02:00
label : 'Collaborate' ,
2023-06-06 19:34:26 +02:00
target : '_blank' ,
2022-07-27 18:39:04 +02:00
position : 'left' ,
} ,
2023-06-20 16:26:05 +02:00
{
to : '/migration-guide' ,
label : 'Migration Guides' ,
position : 'left' ,
className : 'new-badge' ,
} ,
2022-07-27 18:39:04 +02:00
{
to : '/help' ,
//activeBaseRegex: '(^/help$)|(/help)',
label : 'Help' ,
position : 'right' ,
} ,
{
type : 'docsVersionDropdown' ,
position : 'right' ,
dropdownActiveClassDisabled : true ,
dropdownItemsAfter : [
{
type : 'html' ,
value : '<hr class="dropdown-separator">' ,
} ,
{
to : '/versions' ,
label : 'All versions' ,
} ,
] ,
} ,
{
type : 'localeDropdown' ,
position : 'right' ,
dropdownItemsAfter : [
{
to : '/platform/internationalization' ,
label : 'Help Us Translate' ,
} ,
] ,
} ,
{
to : 'https://github.com/OHIF/Viewers' ,
position : 'right' ,
className : 'header-github-link' ,
'aria-label' : 'GitHub Repository' ,
} ,
] ,
} ,
footer : {
style : 'dark' ,
links : [
{
title : ' ' ,
items : [
{
// This doesn't show up on dev for some reason, but displays in build
html : `
2021-08-30 15:36:05 +02:00
< a href = "https://www.massgeneral.org/" target = "_blank" rel = "noreferrer noopener" >
2021-08-31 16:30:53 +02:00
< img src = "/img/mgh-logo.png" id = "mgh-logo" alt = "MGH" / >
2021-06-23 03:02:14 +02:00
< / a >
` ,
2022-07-27 18:39:04 +02:00
} ,
] ,
} ,
{
title : 'Learn' ,
items : [
{
label : 'Introduction' ,
to : '/' ,
} ,
{
2023-06-20 16:26:05 +02:00
label : 'Getting Started' ,
2022-07-27 18:39:04 +02:00
to : 'development/getting-started' ,
} ,
2023-06-20 16:26:05 +02:00
{
label : 'FAQ' ,
to : '/faq' ,
} ,
{
label : 'Resources' ,
to : '/resources' ,
} ,
2022-07-27 18:39:04 +02:00
] ,
} ,
{
title : 'Community' ,
items : [
{
label : 'Discussion board' ,
2023-06-20 16:26:05 +02:00
href : 'https://community.ohif.org/' ,
2022-07-27 18:39:04 +02:00
} ,
{
label : 'Help' ,
to : '/help' ,
} ,
] ,
} ,
{
title : 'More' ,
items : [
{
label : 'Donate' ,
2023-06-20 16:26:05 +02:00
href : 'https://giving.massgeneral.org/ohif' ,
2022-07-27 18:39:04 +02:00
} ,
{
label : 'GitHub' ,
2023-06-20 16:26:05 +02:00
href : 'https://github.com/OHIF/Viewers' ,
2022-07-27 18:39:04 +02:00
} ,
{
label : 'Twitter' ,
2023-06-20 16:26:05 +02:00
href : 'https://twitter.com/OHIFviewer' ,
2022-07-27 18:39:04 +02:00
} ,
] ,
} ,
] ,
logo : {
alt : 'OHIF ' ,
src : 'img/netlify-color-accent.svg' ,
2023-06-06 19:34:26 +02:00
href : 'https://viewer.ohif.org/' ,
2021-06-22 01:35:41 +02:00
} ,
2022-07-27 18:39:04 +02:00
copyright : ` OHIF is open source software released under the MIT license. ` ,
2021-08-30 15:36:05 +02:00
} ,
2022-07-27 18:39:04 +02:00
} ) ,
} ;