Skip to content

Commit

Permalink
Add PrepVerse files
Browse files Browse the repository at this point in the history
  • Loading branch information
Akash Singh committed Feb 5, 2024
1 parent 41feef2 commit 90083c8
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 1 deletion.
129 changes: 129 additions & 0 deletions documentation/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@docusaurus/core": "2.4.0",
"@docusaurus/plugin-client-redirects": "2.4.0",
"@docusaurus/preset-classic": "2.4.0",
"@giscus/react": "^2.4.0",
"@headlessui/react": "^1.7.15",
"@mdx-js/react": "^1.6.22",
"@swc/core": "^1.3.64",
Expand Down
33 changes: 33 additions & 0 deletions documentation/src/components/blog-comment/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React from 'react'
import { useThemeConfig, useColorMode } from '@docusaurus/theme-common'
import { ThemeConfig } from '@docusaurus/preset-classic'
import BrowserOnly from '@docusaurus/BrowserOnly'
import Giscus, { GiscusProps, Theme } from '@giscus/react'

export type GiscusConfig = GiscusProps & { darkTheme: Theme }

const defaultConfig: Partial<GiscusProps> & { darkTheme: string } = {
id: 'comments',
repo: "PrepVerse/CodePoint",
repoId: "R_kgDOItEdJw",
category: "Q&A",
categoryId: "DIC_kwDOItEdJ84CZ4tA",
mapping: 'pathname',
reactionsEnabled: '1',
emitMetadata: '0',
inputPosition: 'top',
lang: 'en',
theme: 'light',
darkTheme: 'dark_dimmed',
}

export default function Comment(): JSX.Element {
const themeConfig = useThemeConfig() as ThemeConfig & { giscus: GiscusConfig }
const giscus = { ...defaultConfig, ...themeConfig.giscus }
giscus.theme = useColorMode().colorMode === 'dark' ? giscus.darkTheme : giscus.theme
return (
<BrowserOnly fallback={<div>Loading Comments...</div>}>
{() => <Giscus {...giscus} />}
</BrowserOnly>
)
}
4 changes: 3 additions & 1 deletion documentation/src/prepverse-theme/blog-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
import { CommonLayout } from "./common-layout";
import { CommonHeader } from "./common-header";
import { BlogFooter } from "./blog-footer";
import BackToTopButton from '@theme/BackToTopButton'
import clsx from "clsx";
import { BannerSidebar } from "../components/banner/banner-sidebar";
import { BannerModal } from "../components/banner/banner-modal";
Expand Down Expand Up @@ -62,7 +63,7 @@ export const RefineBlogLayout = (props: any) => {
"left-0",
)}
>
<BannerSidebar shouldShowBanner={shouldShowBanner} />
{/* <BannerSidebar shouldShowBanner={shouldShowBanner} /> */}
</div>
</div>
<div
Expand All @@ -89,6 +90,7 @@ export const RefineBlogLayout = (props: any) => {
</div>
<BlogFooter />
<BannerModal />
<BackToTopButton />
</CommonLayout>
);
};
2 changes: 2 additions & 0 deletions documentation/src/prepverse-theme/doc-item-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import React from "react";
import { useDocTOCwithTutorial } from "../components/tutorial-toc/index";
import { useCurrentTutorial } from "../hooks/use-current-tutorial";
import { DocBreadcrumbs } from "./doc-breadcrumbs";
import BackToTopButton from '@theme/BackToTopButton'
import { SourceCodeBadge } from "./doc-sourcecode-badge";
import { SwizzleBadge } from "./doc-swizzle-badge";
import { DocTOC } from "./doc-toc";
Expand Down Expand Up @@ -92,6 +93,7 @@ export const DocItemLayout = ({ children }) => {
<DocItemContent>{children}</DocItemContent>
</div>
<DocItemFooter />
<BackToTopButton />
</div>
<div className={clsx("max-w-screen-content", "w-full")}>
<DocItemPaginator />
Expand Down
2 changes: 2 additions & 0 deletions documentation/src/theme/BlogPostPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import BlogLayout from "@theme/BlogLayout";
import BlogPostPageMetadata from "@theme/BlogPostPage/Metadata";
import { BlogTOC } from "../../prepverse-theme/blog-toc";
import Comment from '@site/src/components/blog-comment'

import { BlogPostPageView, PostPaginator } from "../../components/blog";

Expand All @@ -22,6 +23,7 @@ function BlogPostPageContent({ children }) {
<BlogLayout toc={<BlogTOC toc={toc} />}>
<BlogPostPageView>{children}</BlogPostPageView>
<PostPaginator title="Related Articles" posts={relatedPosts} />
<Comment />
</BlogLayout>
);
}
Expand Down

0 comments on commit 90083c8

Please sign in to comment.