2021-06-15 16:38:40 -04: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 16:39:04 +00:00
2023-06-20 10:26:05 -04:00
// read this text file
const fs = require ( 'fs' );
const versions = fs . readFileSync ( '../../version.txt' , 'utf8' ). split ( '\n' );
2021-06-15 16:38:40 -04:00
2024-11-06 07:15:27 -05:00
const ArchivedVersionsDropdownItems = [
{
2024-11-12 16:18:33 -05:00
version : '3.8.5' ,
href : 'https://v3p8.docs.ohif.org' ,
isExternal : true ,
},
{
version : '2.0' ,
2024-11-06 07:15:27 -05:00
href : 'https://v2.docs.ohif.org' ,
isExternal : true ,
},
{
2024-11-12 16:18:33 -05:00
version : '1.0' ,
2024-11-06 07:15:27 -05:00
href : 'https://v1.docs.ohif.org' ,
isExternal : true ,
},
];
2021-06-16 08:30:10 -04:00
const baseUrl = process . env . BASE_URL || '/' ;
2021-06-15 16:38:40 -04:00
2021-06-15 11:50:38 -04:00
/** @type {import('@docusaurus/types').DocusaurusConfig} */
2022-07-27 16:39:04 +00:00
module . exports = {
2024-11-06 07:15:27 -05:00
future : {
experimental_faster : true ,
},
2021-06-15 23:32:37 -04: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-15 23:32:37 -04:00
projectName : 'OHIF' ,
2021-06-15 16:38:40 -04:00
baseUrl ,
baseUrlIssueBanner : true ,
2023-06-06 13:34:26 -04:00
url : 'https://docs.ohif.org' ,
2021-06-15 16:38:40 -04:00
i18n : {
defaultLocale : 'en' ,
2024-10-15 09:53:26 -04:00
locales : [ 'en' ],
2021-06-15 16:38:40 -04:00
},
onBrokenLinks : 'warn' ,
2021-06-15 11:50:38 -04:00
onBrokenMarkdownLinks : 'warn' ,
2021-06-22 17:12:00 -04:00
favicon : 'img/favicon.ico' ,
2021-06-15 16:38:40 -04:00
themes : [ '@docusaurus/theme-live-codeblock' ],
plugins : [
2023-09-25 23:13:43 -04:00
() => ({
name : 'resolve-react' ,
configureWebpack () {
return {
resolve : {
alias : {
// assuming root node_modules is up from "./packages/<your-docusaurus>
react : path . resolve ( '../../node_modules/react' ),
},
},
};
},
}),
2024-10-15 09:53:26 -04:00
// path.resolve(__dirname, './pluginOHIFWebpackConfig.js'),
// /path.resolve(__dirname, './postcss.js'),
2024-01-09 10:15:56 -05:00
'docusaurus-plugin-image-zoom' , // 3rd party plugin for image click to pop
2021-06-15 16:38:40 -04:00
[
'@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)
},
],
],
presets : [
[
2022-07-27 16:39:04 +00:00
'classic' ,
2024-10-15 09:53:26 -04:00
{
2021-06-15 16:38:40 -04: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
/*if (locale !== 'en') {
2021-06-15 16:38:40 -04:00
return `https://crowdin.com/project/docusaurus-v2/${locale}`;
2021-08-24 14:13:54 +02:00
}*/
2021-06-15 16:38:40 -04: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 13:34:26 -04:00
return `https://github.com/OHIF/Viewers/edit/master/platform/docs/docs/ ${ docPath } ` ;
2021-06-15 16:38:40 -04:00
},
showLastUpdateAuthor : true ,
showLastUpdateTime : true ,
// remarkPlugins: [
// [require('@docusaurus/remark-plugin-npm2yarn'), { sync: true }],
// ],
2021-06-15 19:11:09 -04:00
// disableVersioning: isVersioningDisabled,
2021-08-24 14:13:54 +02:00
lastVersion : 'current' ,
2021-06-15 19:11:09 -04:00
// onlyIncludeVersions:
// !isVersioningDisabled && (isDev || isDeployPreview)
// ? ['current', ...versions.slice(0, 2)]
// : undefined,
2021-08-24 14:13:54 +02:00
versions : {
current : {
2023-06-20 10:26:05 -04:00
label : ` ${ versions } (Latest)` ,
2021-08-24 14:13:54 +02:00
},
},
2021-06-15 16:38:40 -04:00
},
theme : {
customCss : [ require . resolve ( './src/css/custom.css' )],
},
2023-06-12 22:05:01 -04:00
gtag : {
trackingID : 'G-DDBJFE34EG' ,
anonymizeIP : true ,
},
2024-10-15 09:53:26 -04:00
},
2021-06-15 16:38:40 -04:00
],
],
2022-07-27 16:39:04 +00: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 12:39:12 -04:00
announcementBar : {
2024-11-12 16:18:33 -05:00
id : 'cornerstone20_ohif_anniversary' ,
2023-07-27 12:39:12 -04:00
content :
2024-11-12 16:18:33 -05:00
'🎉 Celebrating OHIF’ s 10-Year Anniversary with Cornerstone 2.0! Explore enhanced segmentation, new video & microscopy viewports, UI/UX upgrades, and blazing fast prefetching. Dive into the release notes <a target="_blank" rel="noopener noreferrer" href="https://ohif.org/release-notes/3p9/">here</a>! 🚀' ,
2023-07-27 12:39:12 -04:00
},
2024-11-12 16:18:33 -05:00
2022-07-27 16:39:04 +00:00
prism : {
2024-10-15 09:53:26 -04:00
theme : require ( 'prism-react-renderer' ). themes . github ,
darkTheme : require ( 'prism-react-renderer' ). themes . dracula ,
2021-06-15 11:50:38 -04:00
},
2022-07-27 16:39:04 +00: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 11:50:38 -04:00
},
2022-07-27 16:39:04 +00:00
items : [
{
position : 'left' ,
to : '/' ,
activeBaseRegex : '^(/next/|/)$' ,
docId : 'Introduction' ,
label : 'Docs' ,
},
{
2024-11-12 12:33:09 -05:00
to : '/components' ,
label : 'Components' ,
position : 'left' ,
},
{
href : 'https://ohif.org/showcase' ,
label : 'Showcase' ,
2023-06-06 13:34:26 -04:00
target : '_blank' ,
2022-07-27 16:39:04 +00:00
position : 'left' ,
},
2023-06-20 10:26:05 -04:00
{
2024-11-12 12:33:09 -05:00
href : 'https://ohif.org/collaborate' ,
label : 'Collaborate' ,
target : '_blank' ,
2023-06-20 10:26:05 -04:00
position : 'left' ,
},
2022-07-27 16:39:04 +00:00
{
to : '/help' ,
//activeBaseRegex: '(^/help$)|(/help)',
label : 'Help' ,
2024-11-12 12:33:09 -05:00
position : 'left' ,
2022-07-27 16:39:04 +00:00
},
2024-11-14 12:37:04 -05:00
{
to : '/migration-guide/3p8-to-3p9/' ,
//activeBaseRegex: '(^/help$)|(/help)',
label : '3.9 Migration Guides' ,
position : 'left' ,
},
2022-07-27 16:39:04 +00:00
{
type : 'docsVersionDropdown' ,
position : 'right' ,
dropdownActiveClassDisabled : true ,
dropdownItemsAfter : [
{
type : 'html' ,
value : '<hr class="dropdown-separator">' ,
},
{
2024-11-06 07:15:27 -05:00
type : 'html' ,
className : 'dropdown-archived-versions' ,
value : '<b>Archived versions</b>' ,
2022-07-27 16:39:04 +00:00
},
2024-11-06 07:15:27 -05:00
... ArchivedVersionsDropdownItems . map ( item => ({
label : ` ${ item . version } ` ,
href : item . href ,
target : item . isExternal ? '_blank' : undefined ,
rel : item . isExternal ? 'noopener noreferrer' : undefined ,
})),
2022-07-27 16:39:04 +00:00
],
},
{
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 09:36:05 -04:00
<a href="https://www.massgeneral.org/" target="_blank" rel="noreferrer noopener">
2021-08-31 10:30:53 -04:00
<img src="/img/mgh-logo.png" id="mgh-logo" alt="MGH" />
2021-06-22 21:02:14 -04:00
</a>
` ,
2022-07-27 16:39:04 +00:00
},
],
},
{
title : 'Learn' ,
items : [
{
label : 'Introduction' ,
to : '/' ,
},
{
2023-06-20 10:26:05 -04:00
label : 'Getting Started' ,
2022-07-27 16:39:04 +00:00
to : 'development/getting-started' ,
},
2023-06-20 10:26:05 -04:00
{
label : 'FAQ' ,
to : '/faq' ,
},
{
label : 'Resources' ,
to : '/resources' ,
},
2022-07-27 16:39:04 +00:00
],
},
{
title : 'Community' ,
items : [
{
label : 'Discussion board' ,
2023-06-20 10:26:05 -04:00
href : 'https://community.ohif.org/' ,
2022-07-27 16:39:04 +00:00
},
{
label : 'Help' ,
to : '/help' ,
},
],
},
{
title : 'More' ,
items : [
{
label : 'Donate' ,
2023-06-20 10:26:05 -04:00
href : 'https://giving.massgeneral.org/ohif' ,
2022-07-27 16:39:04 +00:00
},
{
label : 'GitHub' ,
2023-06-20 10:26:05 -04:00
href : 'https://github.com/OHIF/Viewers' ,
2022-07-27 16:39:04 +00:00
},
{
label : 'Twitter' ,
2023-06-20 10:26:05 -04:00
href : 'https://twitter.com/OHIFviewer' ,
2022-07-27 16:39:04 +00:00
},
],
},
],
logo : {
alt : 'OHIF ' ,
src : 'img/netlify-color-accent.svg' ,
2023-06-06 13:34:26 -04:00
href : 'https://viewer.ohif.org/' ,
2021-06-21 19:35:41 -04:00
},
2022-07-27 16:39:04 +00:00
copyright : `OHIF is open source software released under the MIT license.` ,
2021-08-30 09:36:05 -04:00
},
2022-07-27 16:39:04 +00:00
}),
};