/********************************************************************************
* Copyright (c) 2020 TypeFox and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
********************************************************************************/
import { FunctionComponent, ReactNode } from 'react';
import { Helmet } from 'react-helmet-async';
import { Typography, Box, Link } from '@mui/material';
import { Link as RouteLink, Route, useParams } from 'react-router';
import GitHubIcon from '@mui/icons-material/GitHub';
import CallSplitIcon from '@mui/icons-material/CallSplit';
import BugReportIcon from '@mui/icons-material/BugReport';
import MenuBookIcon from '@mui/icons-material/MenuBook';
import { Extension, NamespaceDetails } from '../extension-registry-types';
import { PageSettings } from '../page-settings';
import { ExtensionListRoutes } from '../pages/extension-list/extension-list-routes';
import { DefaultMenuContent, MobileMenuContent } from './menu-content';
import { OpenVsxMark } from '../components/openvsx-mark';
import OpenVSXLogo from './openvsx-registry-logo';
import About from './about';
import { createAbsoluteURL } from '../utils';
const WIKI_URL = 'https://github.com/eclipse-openvsx/openvsx/wiki';
const REPO_URL = 'https://github.com/eclipse-openvsx/openvsx';
const ISSUES_URL = `${REPO_URL}/issues`;
export default function createPageSettings(prefersDarkMode: boolean, serverUrl: string): PageSettings {
const toolbarContent: FunctionComponent = () => (
);
const footer: PageSettings['elements']['footer'] = {
brand: {
logo: ,
name: 'Open VSX Registry',
description: 'An open-source, vendor-neutral registry for VS Code–compatible extensions.'
},
columns: [
{
heading: 'Resources',
links: [{ label: 'Documentation', href: WIKI_URL }]
},
{
heading: 'Community',
links: [
{ label: 'GitHub', href: REPO_URL, external: true },
{ label: 'About This Service', href: '/about' }
]
}
],
social: [{ title: 'GitHub', href: REPO_URL, icon: }],
copyright: (
<>
Copyright © 2026 by{' '}
Eclipse Foundation
>
),
showVersion: true
};
const home: PageSettings['elements']['home'] = {
popularSearches: ['python', 'git', 'docker', 'prettier', 'eslint', 'rust', 'java'],
involvement: {
heading: 'Get Involved',
cards: [
{
icon: ,
title: 'Contribute',
description: 'Open VSX is fully open source. Help build the registry the ecosystem depends on.',
href: REPO_URL,
label: 'View on GitHub →'
},
{
icon: ,
title: 'Report an issue',
description: 'Found a bug or have a feature request? Open an issue and help improve the registry.',
href: ISSUES_URL,
label: 'Open an issue →'
},
{
icon: ,
title: 'Read the docs',
description: 'Learn how to publish, claim namespaces, and consume extensions via the API.',
href: WIKI_URL,
label: 'View documentation →'
}
]
}
};
const searchHeader: FunctionComponent = () => (
`${theme.shape.borderRadiusPill}px`,
bgcolor: 'accentSoft',
color: 'secondary.light',
fontSize: '0.75rem',
fontWeight: 500,
mb: 2
}}>
Open-source registry for VS Code–compatible editors
Find the right extension,
for any editor.
Browse community-published extensions.
Free, open, and vendor-neutral.
);
const additionalRoutes: ReactNode = } />;
const headTags: FunctionComponent<{ title: string }> = props => {
return (
{props.title}
);
};
const mainHeadTags: FunctionComponent<{ pageSettings: PageSettings }> = props => {
return headTags({ title: props.pageSettings.pageTitle });
};
const extensionHeadTags: FunctionComponent<{ extension?: Extension; pageSettings: PageSettings }> = props => {
const params = useParams();
const name = props.extension ? (props.extension.displayName ?? props.extension.name) : params.name;
return headTags({ title: `${name} – ${props.pageSettings.pageTitle}` });
};
const namespaceHeadTags: FunctionComponent<{
namespaceDetails?: NamespaceDetails;
name: string;
pageSettings: PageSettings;
}> = props => {
const name = props.namespaceDetails
? (props.namespaceDetails.displayName ?? props.namespaceDetails.name)
: props.name;
return headTags({ title: `${name} – ${props.pageSettings.pageTitle}` });
};
return {
pageTitle: 'Open VSX Registry',
themeType: prefersDarkMode ? 'dark' : 'light',
publisherAgreement: {
name: 'Open VSX'
},
elements: {
toolbarContent,
defaultMenuContent: DefaultMenuContent,
mobileMenuContent: MobileMenuContent,
footer,
home,
searchHeader,
additionalRoutes,
mainHeadTags,
extensionHeadTags,
namespaceHeadTags
},
urls: {
extensionDefaultIcon: '/default-icon.png',
namespaceAccessInfo: 'https://github.com/eclipse/openvsx/wiki/Namespace-Access',
publisherAgreement: createAbsoluteURL([serverUrl, 'documents', 'publisher-agreement.md'])
}
};
}