docusaurus.config.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  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.8",
  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/clarity.js",
  141. "./plugins/templates.js",
  142. "./plugins/example-redirects.js",
  143. ],
  144. themeConfig: {
  145. prism: {
  146. theme: require("prism-react-renderer/themes/github"),
  147. darkTheme: require("prism-react-renderer/themes/vsDark"),
  148. magicComments: [
  149. // Remember to extend the default highlight class name as well!
  150. {
  151. className: "theme-code-block-highlighted-line",
  152. line: "highlight-next-line",
  153. block: { start: "highlight-start", end: "highlight-end" },
  154. },
  155. {
  156. className: "code-block-hidden",
  157. line: "hide-next-line",
  158. block: { start: "hide-start", end: "hide-end" },
  159. },
  160. {
  161. className: "theme-code-block-added-line",
  162. line: "added-line",
  163. block: { start: "added-start", end: "added-end" },
  164. },
  165. {
  166. className: "theme-code-block-removed-line",
  167. line: "removed-line",
  168. block: { start: "removed-start", end: "removed-end" },
  169. },
  170. ],
  171. },
  172. image: "img/openpanel_social.png",
  173. algolia: {
  174. appId: "AEUKT9VWIW",
  175. apiKey: '8c38649d5d06ae64c7d6c595b9dcf4ac',
  176. indexName: 'codex-openpanel',
  177. contextualSearch: true,
  178. //replaceSearchResultPathname: {from: '/docs/',to: '/',},
  179. searchParameters: {},
  180. searchPagePath: 'search',
  181. },
  182. metadata: [
  183. {
  184. name: "keywords",
  185. content:
  186. "openpanel, openadmin, open panel, open admin, open hosting panel, open control panel",
  187. },
  188. ],
  189. navbar: {
  190. logo: {
  191. alt: "refine",
  192. src: "img/refine_logo.png",
  193. },
  194. items: [
  195. { to: "https://docusaurus.io/docs/api/docusaurus-config", label: "Blog", position: "left" },
  196. {
  197. type: "docsVersionDropdown",
  198. position: "right",
  199. dropdownActiveClassDisabled: true,
  200. },
  201. {
  202. href: "https://github.com/",
  203. position: "right",
  204. className: "header-icon-link header-github-link",
  205. },
  206. {
  207. href: "https://discord.gg/",
  208. position: "right",
  209. className: "header-icon-link header-discord-link",
  210. },
  211. {
  212. href: "https://twitter.com/",
  213. position: "right",
  214. className: "header-icon-link header-twitter-link",
  215. },
  216. ],
  217. },
  218. footer: {
  219. logo: {
  220. alt: "refine",
  221. src: "/img/refine_logo.png",
  222. },
  223. links: [
  224. {
  225. title: "Resources",
  226. items: [
  227. {
  228. label: "Getting Started",
  229. to: "https://docusaurus.io/docs/api/docusaurus-config",
  230. },
  231. {
  232. label: "Tutorials",
  233. to: "https://docusaurus.io/docs/api/docusaurus-config",
  234. },
  235. {
  236. label: "Blog",
  237. to: "https://docusaurus.io/docs/api/docusaurus-config",
  238. },
  239. ],
  240. },
  241. {
  242. title: "Product",
  243. items: [
  244. {
  245. label: "Examples",
  246. to: "https://docusaurus.io/docs/api/docusaurus-config",
  247. },
  248. {
  249. label: "Integrations",
  250. to: "https://docusaurus.io/docs/api/docusaurus-config",
  251. },
  252. {
  253. label: "Become an Expert",
  254. to: "https://docusaurus.io/docs/api/docusaurus-config",
  255. },
  256. ],
  257. },
  258. {
  259. title: "Company",
  260. items: [
  261. {
  262. label: "About",
  263. to: "https://google.rs",
  264. },
  265. {
  266. label: "Store 🎁",
  267. to: "https://google.rs",
  268. },
  269. ],
  270. },
  271. {
  272. title: "__LEGAL",
  273. items: [
  274. {
  275. label: "License",
  276. to: "/LICENSE",
  277. },
  278. // {
  279. // label: "Terms",
  280. // to: "/enterprise",
  281. // },
  282. // {
  283. // label: "Privacy",
  284. // to: "/privacy-policy",
  285. // },
  286. // {
  287. // label: "info@refine.dev",
  288. // to: "mailto:info@refine.dev",
  289. // },
  290. ],
  291. },
  292. {
  293. title: "__SOCIAL",
  294. items: [
  295. {
  296. href: "https://github.com/",
  297. label: "github",
  298. },
  299. {
  300. href: "https://discord.gg/",
  301. label: "discord",
  302. },
  303. {
  304. href: "https://reddit.com/r/",
  305. label: "reddit",
  306. },
  307. {
  308. href: "https://twitter.com/",
  309. label: "twitter",
  310. },
  311. {
  312. href: "https://www.linkedin.com/company/openpanel/",
  313. label: "linkedin",
  314. },
  315. ],
  316. },
  317. ],
  318. },
  319. docs: {
  320. sidebar: {
  321. autoCollapseCategories: false,
  322. },
  323. },
  324. colorMode: {
  325. defaultMode: "light",
  326. },
  327. },
  328. customFields: {
  329. /** Footer Fields */
  330. footerDescription:
  331. '<strong style="font-weight:700;">OpenPanel</strong> is a next generation hosting panel for more secure and provacy focused hosting.',
  332. contactTitle: "Contact",
  333. contactDescription: [
  334. "OpenPanel Co.",
  335. "256 Amsterdam, NL 19702",
  336. ],
  337. contactEmail: "info@openpanel.co",
  338. /** ---- */
  339. /** Live Preview */
  340. LIVE_PREVIEW_URL:
  341. process.env.LIVE_PREVIEW_URL ?? "http://localhost:3030/preview",
  342. /** ---- */
  343. tutorial: tutorialData,
  344. },
  345. webpack: {
  346. jsLoader: (isServer) => ({
  347. loader: require.resolve("swc-loader"),
  348. options: {
  349. jsc: {
  350. parser: {
  351. syntax: "typescript",
  352. tsx: true,
  353. },
  354. target: "es2017",
  355. },
  356. module: {
  357. type: isServer ? "commonjs" : "es6",
  358. },
  359. },
  360. }),
  361. },
  362. };
  363. module.exports = siteConfig;