Skip to content

Commit

Permalink
fix: docs. domain adaptation
Browse files Browse the repository at this point in the history
  • Loading branch information
whitebit-robot committed Nov 23, 2023
1 parent 68ee49f commit 8efd0a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion constants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
const isProduction = process.env.NODE_ENV === "production";
export const assetPrefix = isProduction ? "/api-docs" : "";
8 changes: 2 additions & 6 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ const withNextra = require("nextra")({
themeConfig: "./theme.config.tsx",
});

const isProduction = process.env.NODE_ENV === "production";

const assetPrefix = isProduction ? "/api-docs" : "";

module.exports = {
...withNextra(),
images: {
Expand All @@ -15,6 +11,6 @@ module.exports = {
reactStrictMode: true,
swcMinify: true,
trailingSlash: true,
assetPrefix,
basePath: assetPrefix,
// assetPrefix,
// basePath: assetPrefix,
};
11 changes: 5 additions & 6 deletions theme.config.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from "react";
import { DocsThemeConfig } from "nextra-theme-docs";
import { assetPrefix } from "./constants";

const config: DocsThemeConfig = {
logo: (
<img
src={`${assetPrefix}/img/logo.svg`}
src={"/img/logo.svg"}
alt={"WhiteBIT logo"}
width={32}
height={32}
Expand All @@ -19,7 +18,7 @@ const config: DocsThemeConfig = {
return {
titleTemplate: "%s | WhiteBIT API Documentation",
openGraph: {
images: [{ url: `${assetPrefix}/img/og-image.png` }],
images: [{ url: "/img/og-image.png" }],
siteName: "WhiteBIT API Documentation",
},
};
Expand All @@ -35,19 +34,19 @@ const config: DocsThemeConfig = {
<link
rel="shortcut icon"
type="image/x-icon"
href={`${assetPrefix}/img/favicon.ico`}
href={"/img/favicon.ico"}
/>
<link
rel="icon"
type="image/x-icon"
sizes="16x16"
href={`${assetPrefix}/img/favicon-16x16.png`}
href={"/img/favicon-16x16.png"}
/>
<link
rel="icon"
type="image/x-icon"
sizes="32x32"
href={`${assetPrefix}/img/favicon-32x32.png`}
href={"/img/favicon-32x32.png"}
/>
</>
),
Expand Down

0 comments on commit 8efd0a1

Please sign in to comment.