docusaurus.config.js 13 KB

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