Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
Something went wrong. Try again.
10 kB · 354 lines
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355import * as Preset from '@docusaurus/preset-classic';import type { Config } from '@docusaurus/types';import * as themes from 'prism-react-renderer';import * as Renderers from './lib/socialCard/ImageRenderers.js';import path from 'node:path';import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";//import sidebars from './sidebars';
let baseSite: string = 'https://foxxmd.github.io';
const baseUrlEnvs = [ // To build with base URL via normal docker build with build-args/env // or if specified, to override the subsequent set ENVs process.env.BASE_SITE, // To build with base URL set via netlify CI // https://docs.netlify.com/build/configure-builds/environment-variables/#deploy-urls-and-metadata process.env.DEPLOY_PRIME_URL, // To build with base URL set via cloudflare pages CI // https://developers.cloudflare.com/pages/configuration/build-configuration/#environment-variables process.env.CF_PAGES_URL];
for(const baseUrlVal of baseUrlEnvs) { if(baseUrlVal !== undefined && baseUrlVal !== null && baseUrlVal.trim() !== '') { baseSite = baseUrlVal; break; }}console.log(`Base URL => ${baseSite}`);
const config: Config = { future: { v4: { removeLegacyPostBuildHeadAttribute: true, // required }, faster: { ssgWorkerThreads: true, rspackBundler: true, // required flag rspackPersistentCache: true, // new flag }, }, title: 'Multi-Scrobbler', tagline: 'Scrobble all the things', favicon: 'img/favicon.ico',
// Set the production url of your site here url: baseSite, // Set the /<baseUrl>/ pathname under which your site is served // For GitHub pages deployment, it is often '/<projectName>/' baseUrl: process.env.DOCS_BASE !== undefined && process.env.DOCS_BASE !== '' ? process.env.DOCS_BASE : '/docs',
// GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. organizationName: 'foxxmd', // Usually your GitHub org/user name. projectName: 'multi-scrobbler', // Usually your repo name.
trailingSlash: true,
markdown: { hooks: { onBrokenMarkdownLinks: 'warn', } },
// Even if you don't use internalization, you can use this field to set useful // metadata like html lang. For example, if your site is Chinese, you may want // to replace "en" with "zh-Hans". i18n: { defaultLocale: 'en', locales: ['en'], }, scripts: [ ], presets: [ [ 'classic', { docs: { sidebarPath: './sidebars.ts', docItemComponent: "@theme/ApiItem", routeBasePath: '/', // Please change this to your repo. // Remove this to remove the "edit this page" links. editUrl: (params: { version: string; versionDocsDirPath: string; docPath: string; permalink: string; locale: string; }) => { return `https://github.com/FoxxMD/multi-scrobbler/blob/master${path.join('/docsite', params.versionDocsDirPath, params.docPath)}?plain=1`; }, // based on this https://github.com/facebook/docusaurus/issues/6127#issuecomment-3937124499 // to filter out the autogenerated api folder sidebar item sidebarItemsGenerator: async function ({ defaultSidebarItemsGenerator, ...args }) { const items = await defaultSidebarItemsGenerator(args); const filteredItems = items.filter(item => !(item.type === 'category' && item.label === 'api')); return filteredItems }, }, // blog: { // showReadingTime: true, // // Please change this to your repo. // // Remove this to remove the "edit this page" links. // editUrl: // 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', // }, blog: false,
theme: { customCss: ['./src/css/custom.css','./src/css/openapiBase.css','./src/css/evergreen.css'], }, } satisfies Preset.Options, ], ], themes: [ //"docusaurus-json-schema-plugin", [ "@easyops-cn/docusaurus-search-local", /** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */ { // ... Your options. // `hashed` is recommended as long-term-cache of index file is possible. hashed: true, indexBlog: false, docsRouteBasePath: "/", // For Docs using Chinese, The `language` is recommended to set to: // ``` // language: ["en", "zh"], // ``` }, ], 'docusaurus-theme-github-codeblock', "docusaurus-theme-openapi-docs" ], plugins: [ 'docusaurus-plugin-sass', [ '@docusaurus/plugin-client-redirects', { redirects: [ // /docs/oldDoc -> /docs/newDoc { to: '/configuration', from: '/docs/configuration', }, { to: '/configuration/kitchensink', from: '/docs/configuration/kitchensink', }, { to: '/installation', from: '/docs/installation', }, { to: '/quickstart', from: '/docs/quickstart', }, { to: '/FAQ', from: '/docs/FAQ', }, { to: '/', from: '/docs', }, ] } ], [ '@bony_chops/docusaurus-og', { path: './preview-images', // relative to the build directory imageRenderers: { 'docusaurus-plugin-content-docs': Renderers.docs, 'docusaurus-plugin-content-pages': Renderers.docs, }, }, ], [ 'docusaurus-plugin-openapi-docs', { id: "api", // plugin id docsPluginId: "classic", // configured for preset-classic config: { ms: { specPath: "static/openapi.json", outputDir: "docs/api", showInfoPage: true, maskCredentials: false, // Disable credential masking in code snippets sidebarOptions: { groupPathsBy: "tag", }, } satisfies OpenApiPlugin.Options, } }, ], // [ // '@docusaurus/plugin-content-docs', // { // sidebarItemsGenerator: async function ({ defaultSidebarItemsGenerator, ...args }) { // const items = await defaultSidebarItemsGenerator(args); // for(const i of items) { // console.log(i); // } // //const filteredItems = items.filter(item => item.type !== 'doc' || !item.id.endsWith('/index')); // //return filteredItems // }, // } // ] ], themeConfig: { // Replace with your project's social card image: 'img/icon.png', navbar: { title: 'Multi-Scrobbler', hideOnScroll: true, logo: { alt: 'Logo', src: 'img/icon.svg', height: 40 }, items: [ { type: 'docSidebar', sidebarId: 'tutorialSidebar', position: 'left', label: 'Docs', }, { to: 'playground', position: 'left', label: 'Config Playground', }, { to: 'api/multi-scrobbler-api', position: 'left', label: 'API', }, { href: 'https://github.com/foxxmd/multi-scrobbler', label: 'GitHub', position: 'right', }, { href: 'https://multi-scrobbler.app', label: 'Website', position: 'right', }, ], }, footer: {
links: [ { title: 'Docs', items: [ { label: 'Overview', to: '/', }, { label: 'Installation', to: '/installation', }, { label: 'Configuration', to: '/configuration', }, { label: 'Development', to: '/development/dev-common', }, ], }, { title: 'More', items: [ { label: 'GitHub', href: 'https://github.com/foxxmd/multi-scrobbler', }, { label: 'Website', href: 'https://multi-scrobbler.app', }, ], }, ], copyright: `Copyright © ${new Date().getFullYear()} Multi-Scrobbler. Built with Docusaurus.`, }, prism: { theme: themes.themes.github, darkTheme: themes.themes.dracula, additionalLanguages: ['json','json5','typescript', 'docker', 'bash', 'ini', 'diff'] }, colorMode: { defaultMode: 'dark', disableSwitch: false, respectPrefersColorScheme: false, }, codeblock: { showGithubLink: true, githubLinkLabel: 'View on GitHub', showRunmeLink: false, runmeLinkLabel: 'Checkout via Runme' } } satisfies Preset.ThemeConfig};
const gverify = process.env.GSITEVERIFICATION;if(gverify !== undefined && gverify !== null && gverify.trim() !== '') { config.headTags = [ { tagName: 'meta', attributes: { name: 'google-site-verification', content: gverify } } ]}
if (process.env.RY_ANALYTICS !== undefined && process.env.RY_ANALYTICS !== '') { const script = { src: process.env.RY_ANALYTICS, defer: true } if (process.env.RY_ANALYTICS_SITEID !== undefined && process.env.RY_ANALYTICS_SITEID !== '') { script['data-site-id'] = process.env.RY_ANALYTICS_SITEID; } config.scripts.push(script)}
if(process.env.NETLIFY === 'true') { // @ts-ignore config.themeConfig.footer.links.push({ title: 'Docs Powered By', items: [ { html: ` <a href="https://www.netlify.com"> <img src="https://www.netlify.com/assets/badges/netlify-badge-color-accent.svg" alt="Deploys by Netlify" /> </a> ` } ] });}
export default config;