mintlify 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +5 -0
- package/bin/index.js +1 -8
- package/bin/index.js.map +1 -1
- package/bin/local-preview/injectNav.js +94 -0
- package/bin/local-preview/injectNav.js.map +1 -0
- package/bin/mint/client/.babel-plugin-macrosrc.json +5 -0
- package/bin/mint/client/.babelrc +4 -0
- package/bin/mint/client/.editorconfig +12 -0
- package/bin/mint/client/.eslintrc.json +7 -0
- package/bin/mint/client/.prettierignore +4 -0
- package/bin/mint/client/.prettierrc +14 -0
- package/bin/mint/client/.vscode/launch.json +28 -0
- package/bin/mint/client/README.md +44 -0
- package/bin/mint/client/jest.config.ts +195 -0
- package/bin/mint/client/next-env.d.ts +4 -0
- package/bin/mint/client/next.config.js +152 -0
- package/bin/mint/client/package.json +139 -0
- package/bin/mint/client/postcss.config.cjs +9 -0
- package/bin/mint/client/prebuild/faviconConfig.js +35 -0
- package/bin/mint/client/prebuild/getOpenApiContext.js +53 -0
- package/bin/mint/client/prebuild/index.js +117 -0
- package/bin/mint/client/prebuild/injectNav.js +115 -0
- package/bin/mint/client/prebuild/slugToTitle.js +7 -0
- package/bin/mint/client/rehype/withApiComponents.js +60 -0
- package/bin/mint/client/rehype/withCodeBlocks.js +54 -0
- package/bin/mint/client/rehype/withLayouts.js +113 -0
- package/bin/mint/client/rehype/withLinkRoles.js +13 -0
- package/bin/mint/client/rehype/withRawComponents.js +13 -0
- package/bin/mint/client/rehype/withStaticProps.js +25 -0
- package/bin/mint/client/rehype/withSyntaxHighlighting.js +60 -0
- package/bin/mint/client/remark/utils.js +369 -0
- package/bin/mint/client/remark/withFrames.js +55 -0
- package/bin/mint/client/remark/withImportsInjected.js +36 -0
- package/bin/mint/client/remark/withNextLinks.js +37 -0
- package/bin/mint/client/remark/withTableOfContents.js +71 -0
- package/bin/mint/client/scripts/local.js +177 -0
- package/bin/mint/client/sentry.client.config.js +15 -0
- package/bin/mint/client/sentry.properties +4 -0
- package/bin/mint/client/sentry.server.config.js +15 -0
- package/bin/mint/client/src/analytics/AbstractAnalyticsImplementation.ts +50 -0
- package/bin/mint/client/src/analytics/AnalyticsContext.ts +5 -0
- package/bin/mint/client/src/analytics/AnalyticsMediator.ts +101 -0
- package/bin/mint/client/src/analytics/FakeAnalyticsMediator.ts +9 -0
- package/bin/mint/client/src/analytics/GA4Script.tsx +33 -0
- package/bin/mint/client/src/analytics/implementations/amplitude.ts +26 -0
- package/bin/mint/client/src/analytics/implementations/fathom.ts +38 -0
- package/bin/mint/client/src/analytics/implementations/ga4.ts +33 -0
- package/bin/mint/client/src/analytics/implementations/hotjar.ts +53 -0
- package/bin/mint/client/src/analytics/implementations/mixpanel-browser.d.ts +1 -0
- package/bin/mint/client/src/analytics/implementations/mixpanel.ts +52 -0
- package/bin/mint/client/src/analytics/implementations/posthog.ts +37 -0
- package/bin/mint/client/src/components/Accordion/Accordion.tsx +43 -0
- package/bin/mint/client/src/components/Accordion/index.ts +4 -0
- package/bin/mint/client/src/components/ApiExample.tsx +9 -0
- package/bin/mint/client/src/components/Card.tsx +51 -0
- package/bin/mint/client/src/components/CodeGroup.tsx +132 -0
- package/bin/mint/client/src/components/Editor.tsx +12 -0
- package/bin/mint/client/src/components/Expandable.tsx +40 -0
- package/bin/mint/client/src/components/Heading.tsx +84 -0
- package/bin/mint/client/src/components/Param.tsx +56 -0
- package/bin/mint/client/src/components/Request.tsx +19 -0
- package/bin/mint/client/src/components/ResponseField.tsx +33 -0
- package/bin/mint/client/src/components/TabBar.tsx +61 -0
- package/bin/mint/client/src/config.ts +115 -0
- package/bin/mint/client/src/css/bar-of-progress.css +10 -0
- package/bin/mint/client/src/css/base.css +29 -0
- package/bin/mint/client/src/css/font-awesome.css +7 -0
- package/bin/mint/client/src/css/fonts.css +44 -0
- package/bin/mint/client/src/css/main.css +11 -0
- package/bin/mint/client/src/css/prism.css +270 -0
- package/bin/mint/client/src/css/utilities.css +43 -0
- package/bin/mint/client/src/enums/components.ts +8 -0
- package/bin/mint/client/src/fonts/FiraCode-VF.woff +0 -0
- package/bin/mint/client/src/fonts/FiraCode-VF.woff2 +0 -0
- package/bin/mint/client/src/fonts/IBMPlexMono-Regular.ttf +0 -0
- package/bin/mint/client/src/fonts/IBMPlexMono-SemiBold.ttf +0 -0
- package/bin/mint/client/src/fonts/Inter-italic-latin.var.woff2 +0 -0
- package/bin/mint/client/src/fonts/Inter-roman-latin.var.woff2 +0 -0
- package/bin/mint/client/src/fonts/Pally-Variable.ttf +0 -0
- package/bin/mint/client/src/fonts/SourceSansPro-Regular.otf +0 -0
- package/bin/mint/client/src/fonts/SourceSerifPro-Regular.ttf +0 -0
- package/bin/mint/client/src/fonts/Synonym-Variable.ttf +0 -0
- package/bin/mint/client/src/fonts/Ubuntu-Mono-bold.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-Regular-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-Regular-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-Regular.module.css +11 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-SemiBold-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-SemiBold-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-SemiBold.module.css +11 -0
- package/bin/mint/client/src/fonts/generated/Pally-Variable-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/Pally-Variable-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/Pally-Variable.module.css +11 -0
- package/bin/mint/client/src/fonts/generated/SourceSerifPro-Regular-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/SourceSerifPro-Regular-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/SourceSerifPro-Regular.module.css +11 -0
- package/bin/mint/client/src/fonts/generated/Synonym-Variable-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/Synonym-Variable-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/Synonym-Variable.module.css +11 -0
- package/bin/mint/client/src/fonts/generated/TenorSans-Regular-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/TenorSans-Regular-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/TenorSans-Regular.module.css +11 -0
- package/bin/mint/client/src/hooks/useActionKey.ts +20 -0
- package/bin/mint/client/src/hooks/useIsomorphicLayoutEffect.ts +3 -0
- package/bin/mint/client/src/hooks/useMedia.ts +27 -0
- package/bin/mint/client/src/hooks/usePrevNext.ts +34 -0
- package/bin/mint/client/src/hooks/useTop.ts +15 -0
- package/bin/mint/client/src/icons/CopyToClipboard.tsx +33 -0
- package/bin/mint/client/src/index.d.ts +1 -0
- package/bin/mint/client/src/layouts/ApiSupplemental.tsx +173 -0
- package/bin/mint/client/src/layouts/ContentsLayout.tsx +256 -0
- package/bin/mint/client/src/layouts/DocumentationLayout.tsx +44 -0
- package/bin/mint/client/src/layouts/OpenApiContent.tsx +301 -0
- package/bin/mint/client/src/layouts/SidebarLayout.tsx +412 -0
- package/bin/mint/client/src/layouts/UserFeedback.tsx +73 -0
- package/bin/mint/client/src/layouts/getGroupsInDivision.ts +25 -0
- package/bin/mint/client/src/layouts/isPathInGroupPages.ts +10 -0
- package/bin/mint/client/src/metadata.ts +58 -0
- package/bin/mint/client/src/nav.json +219 -0
- package/bin/mint/client/src/openapi.ts +3 -0
- package/bin/mint/client/src/pages/404.tsx +73 -0
- package/bin/mint/client/src/pages/_app.tsx +138 -0
- package/bin/mint/client/src/pages/_document.tsx +57 -0
- package/bin/mint/client/src/pages/api/issue.ts +10 -0
- package/bin/mint/client/src/pages/api/name.ts +8 -0
- package/bin/mint/client/src/pages/api/request.ts +31 -0
- package/bin/mint/client/src/pages/api/suggest.ts +10 -0
- package/bin/mint/client/src/pages/api/syntax-highlighted-json.ts +13 -0
- package/bin/mint/client/src/pages/api/utils.ts +6 -0
- package/bin/mint/client/src/pages/index.tsx +31 -0
- package/bin/mint/client/src/ui/Api.tsx +359 -0
- package/bin/mint/client/src/ui/Footer.tsx +124 -0
- package/bin/mint/client/src/ui/Header.tsx +370 -0
- package/bin/mint/client/src/ui/Logo.tsx +55 -0
- package/bin/mint/client/src/ui/PageHeader.tsx +51 -0
- package/bin/mint/client/src/ui/Search.tsx +386 -0
- package/bin/mint/client/src/ui/ThemeToggle.tsx +285 -0
- package/bin/mint/client/src/ui/Title.tsx +22 -0
- package/bin/mint/client/src/ui/TopLevelLink.tsx +122 -0
- package/bin/mint/client/src/utils/api.ts +252 -0
- package/bin/mint/client/src/utils/brands.ts +217 -0
- package/bin/mint/client/src/utils/castArray.ts +3 -0
- package/bin/mint/client/src/utils/childrenArray.ts +3 -0
- package/bin/mint/client/src/utils/fit.ts +27 -0
- package/bin/mint/client/src/utils/fontAwesome.ts +577 -0
- package/bin/mint/client/src/utils/getAnalyticsConfig.ts +14 -0
- package/bin/mint/client/src/utils/getLogoHref.ts +9 -0
- package/bin/mint/client/src/utils/getOpenApiContext.ts +26 -0
- package/bin/mint/client/src/utils/importAll.ts +6 -0
- package/bin/mint/client/src/utils/isObject.ts +3 -0
- package/bin/mint/client/src/utils/kebabToTitleCase.ts +3 -0
- package/bin/mint/client/src/utils/loadImage.ts +8 -0
- package/bin/mint/client/src/utils/slugToTitle.ts +7 -0
- package/bin/mint/client/src/utils/wait.ts +5 -0
- package/bin/mint/client/tailwind.config.cjs +323 -0
- package/bin/mint/client/test/test.test.ts +5 -0
- package/bin/mint/client/tsconfig.json +36 -0
- package/bin/mint/client/yarn.lock +9702 -0
- package/bin/scraping/detectFramework.js +12 -3
- package/bin/scraping/detectFramework.js.map +1 -1
- package/bin/scraping/scrapeFileGettingFileNameFromUrl.js +2 -2
- package/bin/scraping/scrapeFileGettingFileNameFromUrl.js.map +1 -1
- package/bin/scraping/scrapeGettingFileNameFromUrl.js +3 -3
- package/bin/scraping/scrapeGettingFileNameFromUrl.js.map +1 -1
- package/bin/scraping/scrapePage.js +2 -2
- package/bin/scraping/scrapePage.js.map +1 -1
- package/bin/scraping/scrapePageCommands.js +6 -6
- package/bin/scraping/scrapePageCommands.js.map +1 -1
- package/bin/scraping/scrapeSection.js +2 -2
- package/bin/scraping/scrapeSection.js.map +1 -1
- package/bin/scraping/scrapeSectionCommands.js +8 -7
- package/bin/scraping/scrapeSectionCommands.js.map +1 -1
- package/bin/scraping/site-scrapers/links-per-group/getDocusaurusLinksPerGroup.js +36 -0
- package/bin/scraping/site-scrapers/links-per-group/getDocusaurusLinksPerGroup.js.map +1 -0
- package/bin/scraping/site-scrapers/links-per-group/getLinksRecursively.js +38 -0
- package/bin/scraping/site-scrapers/links-per-group/getLinksRecursively.js.map +1 -0
- package/bin/scraping/site-scrapers/scrapeDocusaurusPage.js +14 -8
- package/bin/scraping/site-scrapers/scrapeDocusaurusPage.js.map +1 -1
- package/bin/scraping/site-scrapers/scrapeDocusaurusSection.js +4 -29
- package/bin/scraping/site-scrapers/scrapeDocusaurusSection.js.map +1 -1
- package/bin/scraping/site-scrapers/scrapeGitBookPage.js +2 -1
- package/bin/scraping/site-scrapers/scrapeGitBookPage.js.map +1 -1
- package/bin/scraping/site-scrapers/scrapeGitBookSection.js +7 -5
- package/bin/scraping/site-scrapers/scrapeGitBookSection.js.map +1 -1
- package/bin/scraping/site-scrapers/scrapeReadMePage.js +2 -1
- package/bin/scraping/site-scrapers/scrapeReadMePage.js.map +1 -1
- package/bin/scraping/site-scrapers/scrapeReadMeSection.js +3 -3
- package/bin/scraping/site-scrapers/scrapeReadMeSection.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -16
- package/src/scraping/detectFramework.ts +13 -3
- package/src/scraping/scrapeFileGettingFileNameFromUrl.ts +5 -2
- package/src/scraping/scrapeGettingFileNameFromUrl.ts +5 -1
- package/src/scraping/scrapePage.ts +6 -3
- package/src/scraping/scrapePageCommands.ts +10 -6
- package/src/scraping/scrapeSection.ts +9 -2
- package/src/scraping/scrapeSectionCommands.ts +24 -7
- package/src/scraping/site-scrapers/links-per-group/getDocusaurusLinksPerGroup.ts +46 -0
- package/src/scraping/site-scrapers/{getLinksRecursively.ts → links-per-group/getLinksRecursively.ts} +0 -0
- package/src/scraping/site-scrapers/scrapeDocusaurusPage.ts +20 -8
- package/src/scraping/site-scrapers/scrapeDocusaurusSection.ts +9 -33
- package/src/scraping/site-scrapers/scrapeGitBookPage.ts +2 -1
- package/src/scraping/site-scrapers/scrapeGitBookSection.ts +9 -5
- package/src/scraping/site-scrapers/scrapeReadMePage.ts +2 -1
- package/src/scraping/site-scrapers/scrapeReadMeSection.ts +4 -2
- package/bin/local-preview/helper-commands/cleanCommand.js +0 -8
- package/bin/local-preview/helper-commands/cleanCommand.js.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import Link from 'next/link';
|
|
2
|
+
import { useRouter } from 'next/router';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { solid, regular } from '@fortawesome/fontawesome-svg-core/import.macro';
|
|
5
|
+
|
|
6
|
+
const FeedbackTooltip = ({ message }: { message: string }) => {
|
|
7
|
+
return (
|
|
8
|
+
<div className="absolute hidden group-hover:block bottom-full left-1/2 mb-3.5 pb-1 -translate-x-1/2">
|
|
9
|
+
<div
|
|
10
|
+
className="relative w-24 flex justify-center bg-primary-dark text-white text-xs font-medium py-0.5 px-1.5 rounded-lg"
|
|
11
|
+
data-reach-alert="true"
|
|
12
|
+
>
|
|
13
|
+
{message}
|
|
14
|
+
<svg
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
width="16"
|
|
17
|
+
height="6"
|
|
18
|
+
viewBox="0 0 16 6"
|
|
19
|
+
className="text-primary-dark absolute top-full left-1/2 -mt-px -ml-2"
|
|
20
|
+
>
|
|
21
|
+
<path
|
|
22
|
+
fillRule="evenodd"
|
|
23
|
+
clipRule="evenodd"
|
|
24
|
+
d="M15 0H1V1.00366V1.00366V1.00371H1.01672C2.72058 1.0147 4.24225 2.74704 5.42685 4.72928C6.42941 6.40691 9.57154 6.4069 10.5741 4.72926C11.7587 2.74703 13.2803 1.0147 14.9841 1.00371H15V0Z"
|
|
25
|
+
fill="currentColor"
|
|
26
|
+
></path>
|
|
27
|
+
</svg>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export function UserFeedback({ title }: { title: string }) {
|
|
34
|
+
const router = useRouter();
|
|
35
|
+
return (
|
|
36
|
+
<div className="flex items-center space-x-2">
|
|
37
|
+
<Link href={`/api/suggest?path=${router.pathname}`}>
|
|
38
|
+
<a
|
|
39
|
+
className="relative w-fit flex items-center p-1.5 group fill-slate-500 dark:fill-slate-400 hover:fill-slate-700 dark:hover:fill-slate-200 dark:hover:text-slate-300"
|
|
40
|
+
target="_blank"
|
|
41
|
+
rel="noopener noreferrer"
|
|
42
|
+
>
|
|
43
|
+
<FontAwesomeIcon
|
|
44
|
+
icon={regular('pencil')}
|
|
45
|
+
className="h-3.5 w-3.5 block group-hover:hidden"
|
|
46
|
+
/>
|
|
47
|
+
<FontAwesomeIcon
|
|
48
|
+
icon={solid('pencil')}
|
|
49
|
+
className="h-3.5 w-3.5 hidden group-hover:block"
|
|
50
|
+
/>
|
|
51
|
+
<FeedbackTooltip message="Edit this page" />
|
|
52
|
+
</a>
|
|
53
|
+
</Link>
|
|
54
|
+
<Link href={`/api/issue?path=${router.pathname}&title=${title}`}>
|
|
55
|
+
<a
|
|
56
|
+
className="relative w-fit flex items-center p-1.5 group fill-slate-500 dark:fill-slate-400 hover:fill-slate-700 dark:hover:fill-slate-200 dark:hover:text-slate-300"
|
|
57
|
+
target="_blank"
|
|
58
|
+
rel="noopener noreferrer"
|
|
59
|
+
>
|
|
60
|
+
<FontAwesomeIcon
|
|
61
|
+
icon={regular('triangle-exclamation')}
|
|
62
|
+
className="h-3.5 w-3.5 block group-hover:hidden"
|
|
63
|
+
/>
|
|
64
|
+
<FontAwesomeIcon
|
|
65
|
+
icon={solid('triangle-exclamation')}
|
|
66
|
+
className="h-3.5 w-3.5 hidden group-hover:block"
|
|
67
|
+
/>
|
|
68
|
+
<FeedbackTooltip message="Raise an issue" />
|
|
69
|
+
</a>
|
|
70
|
+
</Link>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Group, Groups, GroupPage, isGroup } from '@/metadata';
|
|
2
|
+
|
|
3
|
+
export function getGroupsInDivision(nav: Groups, divisionUrls: string[]) {
|
|
4
|
+
return nav.filter((group: Group) => isGroupInDivision(group, divisionUrls));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function getGroupsNotInDivision(nav: Groups, divisionUrls: string[]) {
|
|
8
|
+
return nav.filter((group: Group) => !isGroupInDivision(group, divisionUrls));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function isGroupInDivision(group: Group, divisionUrls: string[]) {
|
|
12
|
+
return group.pages.some((page) => divisionUrls.some((url) => isGroupPageInDivision(page, url)));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function isGroupPageInDivision(page: GroupPage, divisionUrl: string): boolean {
|
|
16
|
+
if (isGroup(page)) {
|
|
17
|
+
return isGroupInDivision(page, [divisionUrl]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (page?.href == null) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return page.href.startsWith(`/${divisionUrl}/`);
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GroupPage, isGroup } from '@/metadata';
|
|
2
|
+
|
|
3
|
+
export default function isPathInGroupPages(pathname: string, groupPages: GroupPage[]): boolean {
|
|
4
|
+
return groupPages.some((groupPage) => {
|
|
5
|
+
if (isGroup(groupPage)) {
|
|
6
|
+
return isPathInGroupPages(pathname, groupPage.pages);
|
|
7
|
+
}
|
|
8
|
+
return groupPage.href === pathname;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import metadataJson from './metadata.json';
|
|
2
|
+
|
|
3
|
+
export const documentationNav: Groups = metadataJson;
|
|
4
|
+
export const nonMetaTags = ['api', 'openapi', 'sidebarTitle'];
|
|
5
|
+
|
|
6
|
+
export type PageContext = {
|
|
7
|
+
title?: string;
|
|
8
|
+
sidebarTitle?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
api?: string;
|
|
11
|
+
openapi?: string;
|
|
12
|
+
href?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type Groups = Group[];
|
|
16
|
+
|
|
17
|
+
export type Group = {
|
|
18
|
+
group: string;
|
|
19
|
+
pages: GroupPage[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type GroupPage = PageContext | Group;
|
|
23
|
+
|
|
24
|
+
export const isGroup = (group: GroupPage): group is Group => {
|
|
25
|
+
// Used in if-statements to case GroupPage into either PageContext or Group
|
|
26
|
+
// The return type "group is Group" is the cast
|
|
27
|
+
return group && group.hasOwnProperty('group') && group.hasOwnProperty('pages');
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const findPageInGroup = (
|
|
31
|
+
group: Group,
|
|
32
|
+
targetHref: string
|
|
33
|
+
): { group: string; page: PageContext } | undefined => {
|
|
34
|
+
const { pages } = group;
|
|
35
|
+
let target = undefined;
|
|
36
|
+
pages.forEach((page) => {
|
|
37
|
+
const actualPage = page as PageContext;
|
|
38
|
+
const subGroup = page as Group;
|
|
39
|
+
if (actualPage?.href === targetHref) {
|
|
40
|
+
target = { group: group.group, page: actualPage };
|
|
41
|
+
} else if (isGroup(subGroup)) {
|
|
42
|
+
const resultInSubGroup = findPageInGroup(subGroup, targetHref);
|
|
43
|
+
if (resultInSubGroup != null) {
|
|
44
|
+
target = resultInSubGroup;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return target;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const flattenGroupPages = (groupPages: GroupPage[]): PageContext[] => {
|
|
52
|
+
return groupPages.flatMap((groupPage) => {
|
|
53
|
+
if (isGroup(groupPage)) {
|
|
54
|
+
return flattenGroupPages(groupPage.pages);
|
|
55
|
+
}
|
|
56
|
+
return groupPage;
|
|
57
|
+
});
|
|
58
|
+
};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"group": "Getting started",
|
|
4
|
+
"pages": [
|
|
5
|
+
{
|
|
6
|
+
"title": "Onboarding and Setup",
|
|
7
|
+
"description": "This page will help you get started with Telematica EV APIs",
|
|
8
|
+
"href": "/onboarding"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"title": "Contact us",
|
|
12
|
+
"href": "/contact-us"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"title": "Supported EV brands",
|
|
16
|
+
"href": "/supported-ev-models-india"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"group": "Products",
|
|
22
|
+
"pages": [
|
|
23
|
+
{
|
|
24
|
+
"title": "Telematica Connect UI",
|
|
25
|
+
"description": "Authenticate users with 26+ EV brands using white labeled UI",
|
|
26
|
+
"href": "/products/vehicle-apis"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"title": "Unified Vehicle APIs",
|
|
30
|
+
"description": "Single API to read and issue commands to 26+ EV brands",
|
|
31
|
+
"href": "/products/unified-vehicle-apis"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"title": "Telematica Poller",
|
|
35
|
+
"description": "Effortless polling of EV data",
|
|
36
|
+
"href": "/products/telematica-poller"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"title": "Telematica Webhooks",
|
|
40
|
+
"href": "/products/webhooks"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"title": "Telematica Schedules",
|
|
44
|
+
"description": "Schedule commands or report generation for your customer vehicles",
|
|
45
|
+
"href": "/products/telematica-schedules-beta"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"title": "Telematica Routing APIs (beta)",
|
|
49
|
+
"description": "Plug and play routing module for EVs with advanced features",
|
|
50
|
+
"href": "/products/telematica-routing-apis-in-alpha"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"group": "Guides and How-To's",
|
|
56
|
+
"pages": [
|
|
57
|
+
{
|
|
58
|
+
"title": "Consent UI and custom query parameters",
|
|
59
|
+
"href": "/guides/consent-ui-parameters"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"title": "Creating the POST callback endpoint",
|
|
63
|
+
"href": "/guides/callback-endpoint"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"title": "Expected Errors",
|
|
67
|
+
"href": "/guides/expected-errors"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"title": "FAQs",
|
|
71
|
+
"href": "/guides/faqs"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"group": "Telematica Vehicle APIs",
|
|
77
|
+
"pages": [
|
|
78
|
+
{
|
|
79
|
+
"group": "Vehicle Data - v2",
|
|
80
|
+
"pages": [
|
|
81
|
+
{
|
|
82
|
+
"title": "SOC",
|
|
83
|
+
"description": "Get the current SOC of the vehicle in kms",
|
|
84
|
+
"href": "/reference/vehicledatacontroller_getsoc"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"title": "Range",
|
|
88
|
+
"description": "Get the current range of the vehicle in kms",
|
|
89
|
+
"href": "/reference/vehicledatacontroller_getrange"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"title": "Odometer",
|
|
93
|
+
"description": "Get the current odometer reading of the vehicle in kms",
|
|
94
|
+
"href": "/reference/vehicledatacontroller_getodo"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"title": "Location",
|
|
98
|
+
"description": "Get the current location of the vehicle",
|
|
99
|
+
"href": "/reference/vehicledatacontroller_getlocation"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"title": "Charging Status",
|
|
103
|
+
"description": "Get the current charging status of the vehicle",
|
|
104
|
+
"href": "/reference/vehicledatacontroller_getchargingstatus"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"title": "Static Attributes",
|
|
108
|
+
"description": "Get the static attributes of the vehicle",
|
|
109
|
+
"href": "/reference/vehicledatacontroller_getstaticattributes"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"title": "Start Charge",
|
|
113
|
+
"description": "Command the vehicle to start charging",
|
|
114
|
+
"href": "/reference/vehicledatacontroller_startcharging"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"title": "Stop Charge",
|
|
118
|
+
"description": "Command the vehicle to stop charging",
|
|
119
|
+
"href": "/reference/vehicledatacontroller_stopcharging"
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"group": "Testing Endpoints",
|
|
125
|
+
"pages": [
|
|
126
|
+
{
|
|
127
|
+
"title": "Testing Endpoints",
|
|
128
|
+
"href": "/reference/testing"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"title": "Test SOC",
|
|
132
|
+
"description": "Test the soc endpoint on a dummy vehicle",
|
|
133
|
+
"href": "/reference/testing/vehicledatacontroller_getsoctest"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"title": "Test Range",
|
|
137
|
+
"description": "Test the range endpoint on a dummy vehicle",
|
|
138
|
+
"href": "/reference/testing/vehicledatacontroller_getrangetest"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"title": "Test Range-SOC",
|
|
142
|
+
"description": "Test the range-soc endpoint on a dummy vehicle",
|
|
143
|
+
"href": "/reference/testing/vehicledatacontroller_getrangesoctest"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"title": "Test Location",
|
|
147
|
+
"description": "Test the location endpoint on a dummy vehicle",
|
|
148
|
+
"href": "/reference/testing/vehicledatacontroller_getlocationtest"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"title": "Test Charging Status",
|
|
152
|
+
"description": "Test the charging-status endpoint on a dummy vehicle",
|
|
153
|
+
"href": "/reference/testing/vehicledatacontroller_getchargingstatustest"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"title": "Test Odometer",
|
|
157
|
+
"description": "Test the odo endpoint on a dummy vehicle",
|
|
158
|
+
"href": "/reference/testing/vehicledatacontroller_getodotest"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"title": "Test static-attributes",
|
|
162
|
+
"description": "Test the static-attributes endpoint on a dummy vehicle",
|
|
163
|
+
"href": "/reference/testing/vehicledatacontroller_getstaticattributestest"
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"group": "Vehicle Data - v1",
|
|
169
|
+
"pages": [
|
|
170
|
+
{
|
|
171
|
+
"title": "SOC (battery level)",
|
|
172
|
+
"description": "Get the current SOC (battery level) of the vehicle",
|
|
173
|
+
"href": "/reference/vehicledatacontroller_getsocv1"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"title": "Range",
|
|
177
|
+
"description": "Get the current range of the vehicle in kms",
|
|
178
|
+
"href": "/reference/vehicledatacontroller_getrangev1"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"title": "Range-SOC",
|
|
182
|
+
"description": "Get the current range and SOC of the vehicle in single call",
|
|
183
|
+
"href": "/reference/vehicledatacontroller_getrangesocv1"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"title": "Location",
|
|
187
|
+
"description": "Get the last known location of the vehicle",
|
|
188
|
+
"href": "/reference/vehicledatacontroller_getlocationv1"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"title": "Charging Status",
|
|
192
|
+
"description": "Get the current charging status of the vehicle",
|
|
193
|
+
"href": "/reference/vehicledatacontroller_getchargingstatusv1"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"title": "Odometer",
|
|
197
|
+
"description": "Get the odometer reading of the vehicle",
|
|
198
|
+
"href": "/reference/vehicledatacontroller_getodov1"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"title": "Static Attributes",
|
|
202
|
+
"description": "Get static attributes for a vehicle (like VIN, model, year etc.)",
|
|
203
|
+
"href": "/reference/vehicledatacontroller_getstaticattributesv1"
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"group": "Sample callback endpoints",
|
|
211
|
+
"pages": [
|
|
212
|
+
{
|
|
213
|
+
"title": "New vehicle connection callback",
|
|
214
|
+
"description": "This is a dummy callback endpoint. Please share the POST callback endpoint created in your app's backend with Telematica to get callback requests of below format",
|
|
215
|
+
"href": "/reference/appcontroller_callback"
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
]
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ChevronRightIcon } from '@heroicons/react/solid';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
|
|
4
|
+
import { documentationNav, isGroup } from '@/metadata';
|
|
5
|
+
|
|
6
|
+
export default function Error() {
|
|
7
|
+
return (
|
|
8
|
+
<div>
|
|
9
|
+
<main className="max-w-6xl w-full mx-auto px-4 sm:px-6 lg:px-8">
|
|
10
|
+
<div className="max-w-md mx-auto py-12 sm:py-20">
|
|
11
|
+
<div className="text-center">
|
|
12
|
+
<p className="text-xl font-semibold text-primary dark:text-primary-light">404</p>
|
|
13
|
+
<h1 className="mt-2 text-xl font-bold text-slate-800 dark:text-slate-100 tracking-tight sm:text-4xl sm:tracking-tight">
|
|
14
|
+
Page not found
|
|
15
|
+
</h1>
|
|
16
|
+
<p className="mt-2 text-lg text-slate-500 dark:text-slate-400">
|
|
17
|
+
But here are some other popular destinations
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
<div className="mt-8">
|
|
21
|
+
<ul className="mt-4 border-l border-slate-100 dark:border-slate-800">
|
|
22
|
+
{documentationNav.slice(0, 3).map((nav) => {
|
|
23
|
+
if (nav?.pages == null || nav.pages[0] == null || isGroup(nav.pages[0])) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Link href={nav.pages[0].href || '/'}>
|
|
29
|
+
<li
|
|
30
|
+
key={nav.group}
|
|
31
|
+
className="group -ml-px relative my-3 py-2 px-6 flex items-start border-l border-transparent hover:border-primary dark:hover:border-primary-light space-x-4 cursor-pointer"
|
|
32
|
+
>
|
|
33
|
+
<div className="min-w-0 flex-1">
|
|
34
|
+
<h3 className="text-sm font-semibold text-primary dark:text-primary-light">
|
|
35
|
+
{nav.group}
|
|
36
|
+
</h3>
|
|
37
|
+
<h1 className="text-base font-medium text-slate-600 dark:text-slate-300 group-hover:text-slate-900 dark:group-hover:text-slate-100">
|
|
38
|
+
{nav.pages[0].title}
|
|
39
|
+
</h1>
|
|
40
|
+
<p className="text-base text-slate-500 dark:text-slate-400">
|
|
41
|
+
{nav.pages[0].description}
|
|
42
|
+
</p>
|
|
43
|
+
</div>
|
|
44
|
+
<div className="flex-shrink-0 self-center">
|
|
45
|
+
<ChevronRightIcon
|
|
46
|
+
className="h-5 w-5 text-slate-400 dark:text-slate-400 group-hover:text-slate-700 dark:group-hover:text-slate-200"
|
|
47
|
+
aria-hidden="true"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</li>
|
|
51
|
+
</Link>
|
|
52
|
+
);
|
|
53
|
+
})}
|
|
54
|
+
</ul>
|
|
55
|
+
<div className="mt-12">
|
|
56
|
+
<Link href="/">
|
|
57
|
+
<a className="text-sm font-medium text-primary hover:text-primary-dark dark:text-primary-light dark:hover:text-primary">
|
|
58
|
+
Back to main page<span aria-hidden="true"> →</span>
|
|
59
|
+
</a>
|
|
60
|
+
</Link>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
</main>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
Error.layoutProps = {
|
|
70
|
+
meta: {
|
|
71
|
+
title: '404',
|
|
72
|
+
},
|
|
73
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import ProgressBar from '@badrap/bar-of-progress';
|
|
2
|
+
import { ResizeObserver } from '@juggle/resize-observer';
|
|
3
|
+
import 'focus-visible';
|
|
4
|
+
import 'intersection-observer';
|
|
5
|
+
import Head from 'next/head';
|
|
6
|
+
import Router from 'next/router';
|
|
7
|
+
import { useState, useEffect } from 'react';
|
|
8
|
+
|
|
9
|
+
import { AnalyticsMediatorInterface } from '@/analytics/AbstractAnalyticsImplementation';
|
|
10
|
+
import AnalyticsContext from '@/analytics/AnalyticsContext';
|
|
11
|
+
import AnalyticsMediator from '@/analytics/AnalyticsMediator';
|
|
12
|
+
import FakeAnalyticsMediator from '@/analytics/FakeAnalyticsMediator';
|
|
13
|
+
import GA4Script from '@/analytics/GA4Script';
|
|
14
|
+
import { config } from '@/config';
|
|
15
|
+
import { Meta } from '@/layouts/ContentsLayout';
|
|
16
|
+
import { DocumentationLayout } from '@/layouts/DocumentationLayout';
|
|
17
|
+
import { documentationNav, findPageInGroup, PageContext, nonMetaTags } from '@/metadata';
|
|
18
|
+
import { Header } from '@/ui/Header';
|
|
19
|
+
import { SearchProvider } from '@/ui/Search';
|
|
20
|
+
import { Title } from '@/ui/Title';
|
|
21
|
+
import '@/utils/fontAwesome';
|
|
22
|
+
import getAnalyticsConfig from '@/utils/getAnalyticsConfig';
|
|
23
|
+
|
|
24
|
+
import '../css/fonts.css';
|
|
25
|
+
import '../css/main.css';
|
|
26
|
+
|
|
27
|
+
if (typeof window !== 'undefined' && !('ResizeObserver' in window)) {
|
|
28
|
+
window.ResizeObserver = ResizeObserver;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const progress = new ProgressBar({
|
|
32
|
+
size: 2,
|
|
33
|
+
color: config?.colors?.primary ?? '#0C8C5E',
|
|
34
|
+
className: 'bar-of-progress',
|
|
35
|
+
delay: 100,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// this fixes safari jumping to the bottom of the page
|
|
39
|
+
// when closing the search modal using the `esc` key
|
|
40
|
+
if (typeof window !== 'undefined') {
|
|
41
|
+
progress.start();
|
|
42
|
+
progress.finish();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Router.events.on('routeChangeStart', () => progress.start());
|
|
46
|
+
Router.events.on('routeChangeComplete', () => progress.finish());
|
|
47
|
+
Router.events.on('routeChangeError', () => progress.finish());
|
|
48
|
+
|
|
49
|
+
export default function App(props: any) {
|
|
50
|
+
const { Component, pageProps, router } = props;
|
|
51
|
+
const [initializedAnalyticsMediator, setInitializedAnalyticsMediator] = useState(false);
|
|
52
|
+
const [analyticsMediator, setAnalyticsMediator] = useState<AnalyticsMediatorInterface>(
|
|
53
|
+
new FakeAnalyticsMediator()
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const analytics = getAnalyticsConfig(config);
|
|
57
|
+
|
|
58
|
+
// AnalyticsMediator can only run in the browser
|
|
59
|
+
// We use useEffect because it only runs on render
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!initializedAnalyticsMediator) {
|
|
62
|
+
const newMediator = new AnalyticsMediator(analytics);
|
|
63
|
+
setAnalyticsMediator(newMediator);
|
|
64
|
+
setInitializedAnalyticsMediator(true);
|
|
65
|
+
}
|
|
66
|
+
}, [initializedAnalyticsMediator, analytics]);
|
|
67
|
+
|
|
68
|
+
let [navIsOpen, setNavIsOpen] = useState(false);
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
Router.events.on('routeChangeComplete', (url: string, routeProps: any) => {
|
|
72
|
+
analyticsMediator.onRouteChange(url, routeProps);
|
|
73
|
+
});
|
|
74
|
+
}, [analyticsMediator]);
|
|
75
|
+
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (!navIsOpen) return;
|
|
78
|
+
function handleRouteChange() {
|
|
79
|
+
setNavIsOpen(false);
|
|
80
|
+
}
|
|
81
|
+
Router.events.on('routeChangeComplete', handleRouteChange);
|
|
82
|
+
return () => {
|
|
83
|
+
Router.events.off('routeChangeComplete', handleRouteChange);
|
|
84
|
+
};
|
|
85
|
+
}, [navIsOpen]);
|
|
86
|
+
|
|
87
|
+
let section = undefined;
|
|
88
|
+
let meta: Meta = {};
|
|
89
|
+
documentationNav.forEach((group) => {
|
|
90
|
+
const foundPage = findPageInGroup(group, router.pathname);
|
|
91
|
+
if (foundPage) {
|
|
92
|
+
section = foundPage.group;
|
|
93
|
+
meta = foundPage.page;
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
});
|
|
98
|
+
const metaTags: PageContext = {};
|
|
99
|
+
Object.entries(meta).forEach(([key, value]) => {
|
|
100
|
+
if (nonMetaTags.includes(key)) return;
|
|
101
|
+
metaTags[key as keyof PageContext] = value;
|
|
102
|
+
});
|
|
103
|
+
return (
|
|
104
|
+
<AnalyticsContext.Provider value={analyticsMediator}>
|
|
105
|
+
<Title suffix={config.name}>{meta.sidebarTitle || meta.title}</Title>
|
|
106
|
+
<Head>
|
|
107
|
+
{config?.metadata &&
|
|
108
|
+
Object.entries(config?.metadata).map(([key, value]) => {
|
|
109
|
+
if (!value) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
return <meta key={key} name={key} content={value as any} />;
|
|
113
|
+
})}
|
|
114
|
+
{Object.entries(metaTags).map(([key, value]) => (
|
|
115
|
+
<meta key={key} name={key} content={value} />
|
|
116
|
+
))}
|
|
117
|
+
</Head>
|
|
118
|
+
<GA4Script ga4={analytics.ga4} />
|
|
119
|
+
<SearchProvider>
|
|
120
|
+
<Header
|
|
121
|
+
hasNav={Boolean(config.navigation?.length)}
|
|
122
|
+
navIsOpen={navIsOpen}
|
|
123
|
+
onNavToggle={(isOpen: boolean) => setNavIsOpen(isOpen)}
|
|
124
|
+
title={meta?.title}
|
|
125
|
+
section={section}
|
|
126
|
+
/>
|
|
127
|
+
<DocumentationLayout
|
|
128
|
+
isMdx={pageProps?.isMdx}
|
|
129
|
+
navIsOpen={navIsOpen}
|
|
130
|
+
setNavIsOpen={setNavIsOpen}
|
|
131
|
+
meta={meta}
|
|
132
|
+
>
|
|
133
|
+
<Component section={section} meta={meta} />
|
|
134
|
+
</DocumentationLayout>
|
|
135
|
+
</SearchProvider>
|
|
136
|
+
</AnalyticsContext.Provider>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import NextDocument, { Html, Head, Main, NextScript, DocumentContext } from 'next/document';
|
|
2
|
+
|
|
3
|
+
import { config } from '@/config';
|
|
4
|
+
|
|
5
|
+
const FAVICON_VERSION = 3;
|
|
6
|
+
|
|
7
|
+
function v(href: string) {
|
|
8
|
+
return `${href}?v=${FAVICON_VERSION}`;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default class Document extends NextDocument {
|
|
12
|
+
static async getInitialProps(ctx: DocumentContext) {
|
|
13
|
+
const initialProps = await NextDocument.getInitialProps(ctx);
|
|
14
|
+
return { ...initialProps };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
render() {
|
|
18
|
+
return (
|
|
19
|
+
<Html lang="en" className="dark [--scroll-mt:9.875rem] lg:[--scroll-mt:6.3125rem]">
|
|
20
|
+
<Head>
|
|
21
|
+
<link rel="apple-touch-icon" sizes="180x180" href={v('/favicons/apple-touch-icon.png')} />
|
|
22
|
+
<link rel="icon" type="image/png" sizes="32x32" href={v('/favicons/favicon-32x32.png')} />
|
|
23
|
+
<link rel="icon" type="image/png" sizes="16x16" href={v('/favicons/favicon-16x16.png')} />
|
|
24
|
+
<link rel="shortcut icon" href={v('/favicons/favicon.ico')} />
|
|
25
|
+
<meta name="apple-mobile-web-app-title" content={config.name} />
|
|
26
|
+
<meta name="application-name" content={config.name} />
|
|
27
|
+
<meta name="theme-color" content="#ffffff" />
|
|
28
|
+
<meta name="msapplication-TileColor" content={config.colors?.primary} />
|
|
29
|
+
<meta name="msapplication-config" content={v('/favicons/browserconfig.xml')} />
|
|
30
|
+
<script
|
|
31
|
+
dangerouslySetInnerHTML={{
|
|
32
|
+
__html: `
|
|
33
|
+
try {
|
|
34
|
+
if (localStorage.theme === 'dark' || (!('theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
35
|
+
document.documentElement.classList.add('dark')
|
|
36
|
+
} else {
|
|
37
|
+
document.documentElement.classList.remove('dark')
|
|
38
|
+
}
|
|
39
|
+
} catch (_) {}
|
|
40
|
+
`,
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
</Head>
|
|
44
|
+
<body
|
|
45
|
+
className="antialiased bg-background-light dark:bg-background-dark text-slate-500 dark:text-slate-400"
|
|
46
|
+
// Add background image
|
|
47
|
+
{...(config.backgroundImage && {
|
|
48
|
+
style: { background: `url('${config.backgroundImage}') no-repeat fixed top right` },
|
|
49
|
+
})}
|
|
50
|
+
>
|
|
51
|
+
<Main />
|
|
52
|
+
<NextScript />
|
|
53
|
+
</body>
|
|
54
|
+
</Html>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { NextApiRequest, NextApiResponse } from 'next';
|
|
2
|
+
|
|
3
|
+
function handler(req: NextApiRequest, res: NextApiResponse) {
|
|
4
|
+
const { path, title } = req.query;
|
|
5
|
+
return res.redirect(
|
|
6
|
+
`https://docs.mintlify.com/api/v1/app/issue/${process.env.NAME}?path=${path}.mdx&title=${title}`
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default handler;
|