docusaurus.config.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. /**
  2. * Copyright (c) 2017-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. require("dotenv").config();
  8. const redirectJson = require("./redirects.json");
  9. /** @type {import('@docusaurus/types/src/index').DocusaurusConfig} */
  10. const siteConfig = {
  11. title: "OpenPanel",
  12. tagline: 'Unparalleled support. Effortless website hosting. Continuous feature development.',
  13. url: "https://openpanel.co",
  14. baseUrl: "/",
  15. onBrokenLinks: 'ignore',
  16. projectName: "openpanel",
  17. organizationName: "stefanpejcic",
  18. trailingSlash: true,
  19. favicon: "img/favicon.svg",
  20. scripts: ["https://platform.twitter.com/widgets.js"],
  21. presets: [
  22. [
  23. "@docusaurus/preset-classic",
  24. {
  25. docs: Boolean(process.env.DISABLE_DOCS)
  26. ? false
  27. : {
  28. path: "./docs",
  29. sidebarPath: require.resolve("./sidebars.js"),
  30. editUrl:
  31. "https://github.com/stefanpejcic/openpanel/tree/master/documentation",
  32. showLastUpdateAuthor: true,
  33. showLastUpdateTime: true,
  34. disableVersioning:
  35. process.env.DISABLE_VERSIONING === "true",
  36. versions: {
  37. current: {
  38. label: "0.1.6",
  39. },
  40. },
  41. lastVersion: "current",
  42. admonitions: {
  43. tag: ":::",
  44. keywords: [
  45. "additional",
  46. "note",
  47. "tip",
  48. "info-tip",
  49. "info",
  50. "caution",
  51. "danger",
  52. "sourcecode",
  53. "create-example",
  54. "simple",
  55. ],
  56. },
  57. exclude: ["**/**/_*.md"],
  58. },
  59. blog: false,
  60. theme: {
  61. customCss: [
  62. require.resolve("./src/refine-theme/css/colors.css"),
  63. require.resolve("./src/refine-theme/css/fonts.css"),
  64. require.resolve("./src/refine-theme/css/custom.css"),
  65. require.resolve("./src/css/custom.css"),
  66. require.resolve("./src/css/split-pane.css"),
  67. require.resolve("./src/css/demo-page.css"),
  68. ],
  69. },
  70. gtag: {
  71. trackingID: "G-XXXXXX",
  72. },
  73. sitemap: {
  74. ignorePatterns: ["**/_*.md"],
  75. },
  76. },
  77. ],
  78. ],
  79. plugins: [
  80. [
  81. "@docusaurus/plugin-client-redirects",
  82. {
  83. redirects: redirectJson.redirects,
  84. createRedirects(existingPath) {
  85. if (existingPath.includes("/api-reference/core/")) {
  86. return [
  87. existingPath.replace(
  88. "/api-reference/core/",
  89. "/api-references/",
  90. ),
  91. ];
  92. }
  93. return undefined; // Return a falsy value: no redirect created
  94. },
  95. },
  96. ],
  97. [
  98. "docusaurus-plugin-copy",
  99. {
  100. id: "Copy Workers",
  101. path: "static/workers",
  102. context: "workers",
  103. include: ["**/*.{js}"],
  104. },
  105. ],
  106. async function tailwindcss() {
  107. return {
  108. name: "docusaurus-tailwindcss",
  109. configurePostCss(postcssOptions) {
  110. postcssOptions.plugins.push(require("tailwindcss"));
  111. postcssOptions.plugins.push(require("autoprefixer"));
  112. return postcssOptions;
  113. },
  114. };
  115. },
  116. "./plugins/docgen.js",
  117. "./plugins/examples.js",
  118. "./plugins/checklist.js",
  119. ...(process.env.DISABLE_BLOG
  120. ? []
  121. : [
  122. [
  123. "./plugins/blog-plugin.js",
  124. {
  125. blogTitle: "Blog",
  126. blogDescription:
  127. "A resource for Refine, front-end ecosystem, and web development",
  128. routeBasePath: "/blog",
  129. postsPerPage: 12,
  130. blogSidebarTitle: "All posts",
  131. blogSidebarCount: 0,
  132. feedOptions: {
  133. type: "all",
  134. copyright: `Copyright © ${new Date().getFullYear()} OpenPanel.`,
  135. },
  136. },
  137. ],
  138. ]),
  139. "./plugins/clarity.js",
  140. "./plugins/templates.js",
  141. "./plugins/example-redirects.js",
  142. ],
  143. themeConfig: {
  144. prism: {
  145. theme: require("prism-react-renderer/themes/github"),
  146. darkTheme: require("prism-react-renderer/themes/vsDark"),
  147. magicComments: [
  148. // Remember to extend the default highlight class name as well!
  149. {
  150. className: "theme-code-block-highlighted-line",
  151. line: "highlight-next-line",
  152. block: { start: "highlight-start", end: "highlight-end" },
  153. },
  154. {
  155. className: "code-block-hidden",
  156. line: "hide-next-line",
  157. block: { start: "hide-start", end: "hide-end" },
  158. },
  159. {
  160. className: "theme-code-block-added-line",
  161. line: "added-line",
  162. block: { start: "added-start", end: "added-end" },
  163. },
  164. {
  165. className: "theme-code-block-removed-line",
  166. line: "removed-line",
  167. block: { start: "removed-start", end: "removed-end" },
  168. },
  169. ],
  170. },
  171. image: "img/openpanel_social.png",
  172. algolia: {
  173. appId: "AEUKT9VWIW",
  174. apiKey: '8c38649d5d06ae64c7d6c595b9dcf4ac',
  175. indexName: 'codex-openpanel',
  176. contextualSearch: true,
  177. //replaceSearchResultPathname: {from: '/docs/',to: '/',},
  178. searchParameters: {},
  179. searchPagePath: 'search',
  180. },
  181. metadata: [
  182. {
  183. name: "keywords",
  184. content:
  185. "openpanel, openadmin, open panel, open admin, open hosting panel, open control panel",
  186. },
  187. ],
  188. navbar: {
  189. logo: {
  190. alt: "refine",
  191. src: "img/refine_logo.png",
  192. },
  193. items: [
  194. { to: "https://docusaurus.io/docs/api/docusaurus-config", label: "Blog", position: "left" },
  195. {
  196. type: "docsVersionDropdown",
  197. position: "right",
  198. dropdownActiveClassDisabled: true,
  199. },
  200. {
  201. href: "https://github.com/",
  202. position: "right",
  203. className: "header-icon-link header-github-link",
  204. },
  205. {
  206. href: "https://discord.gg/",
  207. position: "right",
  208. className: "header-icon-link header-discord-link",
  209. },
  210. {
  211. href: "https://twitter.com/",
  212. position: "right",
  213. className: "header-icon-link header-twitter-link",
  214. },
  215. ],
  216. },
  217. footer: {
  218. logo: {
  219. alt: "refine",
  220. src: "/img/refine_logo.png",
  221. },
  222. links: [
  223. {
  224. title: "Resources",
  225. items: [
  226. {
  227. label: "Getting Started",
  228. to: "https://docusaurus.io/docs/api/docusaurus-config",
  229. },
  230. {
  231. label: "Tutorials",
  232. to: "https://docusaurus.io/docs/api/docusaurus-config",
  233. },
  234. {
  235. label: "Blog",
  236. to: "https://docusaurus.io/docs/api/docusaurus-config",
  237. },
  238. ],
  239. },
  240. {
  241. title: "Product",
  242. items: [
  243. {
  244. label: "Examples",
  245. to: "https://docusaurus.io/docs/api/docusaurus-config",
  246. },
  247. {
  248. label: "Integrations",
  249. to: "https://docusaurus.io/docs/api/docusaurus-config",
  250. },
  251. {
  252. label: "Become an Expert",
  253. to: "https://docusaurus.io/docs/api/docusaurus-config",
  254. },
  255. ],
  256. },
  257. {
  258. title: "Company",
  259. items: [
  260. {
  261. label: "About",
  262. to: "https://google.rs",
  263. },
  264. {
  265. label: "Store 🎁",
  266. to: "https://google.rs",
  267. },
  268. ],
  269. },
  270. {
  271. title: "__LEGAL",
  272. items: [
  273. {
  274. label: "License",
  275. to: "/LICENSE",
  276. },
  277. // {
  278. // label: "Terms",
  279. // to: "/enterprise",
  280. // },
  281. // {
  282. // label: "Privacy",
  283. // to: "/privacy-policy",
  284. // },
  285. // {
  286. // label: "info@refine.dev",
  287. // to: "mailto:info@refine.dev",
  288. // },
  289. ],
  290. },
  291. {
  292. title: "__SOCIAL",
  293. items: [
  294. {
  295. href: "https://github.com/",
  296. label: "github",
  297. },
  298. {
  299. href: "https://discord.gg/",
  300. label: "discord",
  301. },
  302. {
  303. href: "https://reddit.com/r/",
  304. label: "reddit",
  305. },
  306. {
  307. href: "https://twitter.com/",
  308. label: "twitter",
  309. },
  310. {
  311. href: "https://www.linkedin.com/company/openpanel/",
  312. label: "linkedin",
  313. },
  314. ],
  315. },
  316. ],
  317. },
  318. docs: {
  319. sidebar: {
  320. autoCollapseCategories: false,
  321. },
  322. },
  323. colorMode: {
  324. defaultMode: "light",
  325. },
  326. },
  327. customFields: {
  328. /** Footer Fields */
  329. footerDescription:
  330. '<strong style="font-weight:700;">OpenPanel</strong> is a next generation hosting panel for more secure and provacy focused hosting.',
  331. contactTitle: "Contact",
  332. contactDescription: [
  333. "OpenPanel Co.",
  334. "256 Amsterdam, NL 19702",
  335. ],
  336. contactEmail: "info@openpanel.co",
  337. /** ---- */
  338. /** Live Preview */
  339. LIVE_PREVIEW_URL:
  340. process.env.LIVE_PREVIEW_URL ?? "http://localhost:3030/preview",
  341. /** ---- */
  342. tutorial: tutorialData,
  343. },
  344. webpack: {
  345. jsLoader: (isServer) => ({
  346. loader: require.resolve("swc-loader"),
  347. options: {
  348. jsc: {
  349. parser: {
  350. syntax: "typescript",
  351. tsx: true,
  352. },
  353. target: "es2017",
  354. },
  355. module: {
  356. type: isServer ? "commonjs" : "es6",
  357. },
  358. },
  359. }),
  360. },
  361. };
  362. module.exports = siteConfig;