diff --git a/aria/.eslintrc.json b/aria/.eslintrc.json new file mode 100644 index 000000000..372241854 --- /dev/null +++ b/aria/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": ["next/core-web-vitals", "next/typescript"] +} diff --git a/aria/.gitignore b/aria/.gitignore new file mode 100644 index 000000000..d44b53b1f --- /dev/null +++ b/aria/.gitignore @@ -0,0 +1,42 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +# package manager +package-lock.json + +# IDE +.idea +.vscode \ No newline at end of file diff --git a/aria/LICENSE b/aria/LICENSE new file mode 100644 index 000000000..ab7a1dac9 --- /dev/null +++ b/aria/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Mohd. Nisab + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/aria/README.md b/aria/README.md new file mode 100644 index 000000000..84abdf728 --- /dev/null +++ b/aria/README.md @@ -0,0 +1,100 @@ +## AriaDocs - Documentation Template + +This feature-packed documentation template, built with Next.js, offers a sleek and responsive design, perfect for all your project documentation needs. + + + +
+ +Here are all versions of the AriaDocs template, each crafted for specific use cases: + + +- **Advanced Docs:** A comprehensive template offering extensive features for in-depth documentation needs. Perfect for larger projects that require detailed explanations and advanced configurations. + [Explore the Advanced Docs](https://github.com/nisabmohd/Aria-Docs/tree/master) + +- **Lite Version:** A streamlined, no-frills template perfect for straightforward documentation needs. + [Explore the Lite Version](https://github.com/nisabmohd/Aria-Docs/tree/minimal-docs) + +- **Version with Versioning:** A powerful option for projects that require historical documentation tracking. Manage multiple versions of your docs effortlessly. + [Check out the Versioning Feature](https://github.com/nisabmohd/Aria-Docs/tree/version_docs) + +- **i18n Support Version (WIP):** Designed for international audiences, this version will offer comprehensive multilingual support. + [Preview the i18n Support](https://github.com/nisabmohd/Aria-Docs/tree/i18n-support) + +### Quick Start + +You can create a new Ariadocs project using the command: + +```plaintext +npx create-aria-doc +``` + +### Expected Output + +When you run the CLI, you can expect an output similar to this: + +``` +Creating a new Ariadocs project in /path/to/your/project from the master branch... +Cloning Master (Full Documentation)... +Ariadocs project successfully created in /path/to/your/project! + +Next steps: +1. Navigate to your project directory: + cd +2. Install dependencies: + // To support React 19, package maintainers will need to test and update their packages to include React 19 as a peer dependency. This is already in progress. + npm install --force +3. Start the development server: + npm run dev +``` + +## Getting Started + +First, run the development server: + +```plaintext +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. + +[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/nisabmohd/Aria-Docs) + +## Key Features + +| **Feature** | **Description** | +|-------------------------------|----------------------------------------------------------| +| MDX Support | Write interactive documentation with MDX. | +| Nested Pages | Organize content in a nested, hierarchical structure. | +| Blog Section | Include a dedicated blog section. | +| Table of Contents | Auto-generated TOC for easy navigation. | +| Pagination | Split content across multiple pages. | +| Syntax Highlighting | Highlight code for better readability. | +| Code Line Highlighting & Titles | Highlight specific lines with descriptive titles. | +| Interactive Code Blocks | Language-specific and interactive code display. | +| Custom Components | Embed custom, reusable components in your docs. | +| Light & Dark Mode | Toggle between light and dark themes. | +| Search Functionality | Quickly find content with a built-in search. | +| Code Switcher | Switch between code languages or variations. | +| Code Copy | Copy code blocks with a single click. | +| TOC Observer Highlight | Highlight active sections in the TOC as you scroll. | +| Static Site Generation | Generate a static, high-performance site. | +| SEO-Optimized | Structured for optimal search engine indexing. | + + +## Additional Themes + +halloween +halloween +halloween \ No newline at end of file diff --git a/aria/app/blog/[slug]/page.tsx b/aria/app/blog/[slug]/page.tsx new file mode 100644 index 000000000..166727e5d --- /dev/null +++ b/aria/app/blog/[slug]/page.tsx @@ -0,0 +1,112 @@ +import { Typography } from "@/components/typography"; +import { buttonVariants } from "@/components/ui/button"; +import { Author, getAllBlogStaticPaths, getBlogForSlug } from "@/lib/markdown"; +import { ArrowLeftIcon } from "lucide-react"; +import Link from "next/link"; +import { notFound } from "next/navigation"; +import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; +import { formatDate } from "@/lib/utils"; +import Image from "next/image"; + +type PageProps = { + params: Promise<{ slug: string }>; +}; + +export async function generateMetadata(props: PageProps) { + const params = await props.params; + + const { + slug + } = params; + + const res = await getBlogForSlug(slug); + if (!res) return null; + const { frontmatter } = res; + return { + title: frontmatter.title, + description: frontmatter.description, + }; +} + +export async function generateStaticParams() { + const val = await getAllBlogStaticPaths(); + if (!val) return []; + return val.map((it) => ({ slug: it })); +} + +export default async function BlogPage(props: PageProps) { + const params = await props.params; + + const { + slug + } = params; + + const res = await getBlogForSlug(slug); + if (!res) notFound(); + return ( +
+ + Back to blog + +
+

+ {formatDate(res.frontmatter.date)} +

+

+ {res.frontmatter.title} +

+
+

Posted by

+ +
+
+
+
+ cover +
+ {res.content} +
+
+ ); +} + +function Authors({ authors }: { authors: Author[] }) { + return ( +
+ {authors.map((author) => { + return ( + + + + + {author.username.slice(0, 2).toUpperCase()} + + +
+

{author.username}

+

+ @{author.handle} +

+
+ + ); + })} +
+ ); +} diff --git a/aria/app/blog/layout.tsx b/aria/app/blog/layout.tsx new file mode 100644 index 000000000..6211155f1 --- /dev/null +++ b/aria/app/blog/layout.tsx @@ -0,0 +1,9 @@ +import { PropsWithChildren } from "react"; + +export default function BlogLayout({ children }: PropsWithChildren) { + return ( +
+ {children} +
+ ); +} diff --git a/aria/app/blog/page.tsx b/aria/app/blog/page.tsx new file mode 100644 index 000000000..7202d2c33 --- /dev/null +++ b/aria/app/blog/page.tsx @@ -0,0 +1,96 @@ +import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; +import { Author, BlogMdxFrontmatter, getAllBlogs } from "@/lib/markdown"; +import { formatDate2, stringToDate } from "@/lib/utils"; +import { Metadata } from "next"; +import Image from "next/image"; +import Link from "next/link"; + +export const metadata: Metadata = { + title: "AriaDocs - Blog", +}; + +export default async function BlogIndexPage() { + const blogs = (await getAllBlogs()).sort( + (a, b) => stringToDate(b.date).getTime() - stringToDate(a.date).getTime() + ); + return ( +
+
+

+ The latest blogs of this product +

+

+ All the latest blogs and news, straight from the team. +

+
+
+ {blogs.map((blog) => ( + + ))} +
+
+ ); +} + +function BlogCard({ + date, + title, + description, + slug, + cover, + authors, +}: BlogMdxFrontmatter & { slug: string }) { + return ( + +

{title}

+
+ {title} +
+

{description}

+
+

+ Published on {formatDate2(date)} +

+ +
+ + ); +} + +function AvatarGroup({ users, max = 4 }: { users: Author[]; max?: number }) { + const displayUsers = users.slice(0, max); + const remainingUsers = Math.max(users.length - max, 0); + + return ( +
+ {displayUsers.map((user, index) => ( + + + + {user.username.slice(0, 2).toUpperCase()} + + + ))} + {remainingUsers > 0 && ( + + +{remainingUsers} + + )} +
+ ); +} diff --git a/aria/app/docs/[[...slug]]/page.tsx b/aria/app/docs/[[...slug]]/page.tsx new file mode 100644 index 000000000..f28ba38f8 --- /dev/null +++ b/aria/app/docs/[[...slug]]/page.tsx @@ -0,0 +1,63 @@ +import DocsBreadcrumb from "@/components/docs-breadcrumb"; +import Pagination from "@/components/pagination"; +import Toc from "@/components/toc"; +import { page_routes } from "@/lib/routes-config"; +import { notFound } from "next/navigation"; +import { getDocsForSlug } from "@/lib/markdown"; +import { Typography } from "@/components/typography"; + +type PageProps = { + params: Promise<{ slug: string[] }>; +}; + +export default async function DocsPage(props: PageProps) { + const params = await props.params; + + const { + slug = [] + } = params; + + const pathName = slug.join("/"); + const res = await getDocsForSlug(pathName); + + if (!res) notFound(); + return ( +
+
+ + +

{res.frontmatter.title}

+

+ {res.frontmatter.description} +

+
{res.content}
+ +
+
+ +
+ ); +} + +export async function generateMetadata(props: PageProps) { + const params = await props.params; + + const { + slug = [] + } = params; + + const pathName = slug.join("/"); + const res = await getDocsForSlug(pathName); + if (!res) return null; + const { frontmatter } = res; + return { + title: frontmatter.title, + description: frontmatter.description, + }; +} + +export function generateStaticParams() { + return page_routes.map((item) => ({ + slug: item.href.split("/").slice(1), + })); +} diff --git a/aria/app/docs/layout.tsx b/aria/app/docs/layout.tsx new file mode 100644 index 000000000..ef73ca474 --- /dev/null +++ b/aria/app/docs/layout.tsx @@ -0,0 +1,14 @@ +import { Leftbar } from "@/components/leftbar"; + +export default function DocsLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( +
+ +
{children}
+
+ ); +} diff --git a/aria/app/error.tsx b/aria/app/error.tsx new file mode 100644 index 000000000..8a8ae0bc4 --- /dev/null +++ b/aria/app/error.tsx @@ -0,0 +1,44 @@ +"use client"; // Error components must be Client Components + +import { Button, buttonVariants } from "@/components/ui/button"; +import Link from "next/link"; +import { useEffect } from "react"; + +export default function Error({ + error, + reset, +}: { + error: Error & { digest?: string }; + reset: () => void; +}) { + useEffect(() => { + console.error(error); + }, [error]); + + return ( +
+
+

Oops!

+

+ Something went wrong {":`("} +

+

+ We're sorry, but an error occurred while processing your request. +

+
+
+ + + Back to homepage + +
+
+ ); +} diff --git a/aria/app/favicon.ico b/aria/app/favicon.ico new file mode 100644 index 000000000..5cf201a68 Binary files /dev/null and b/aria/app/favicon.ico differ diff --git a/aria/app/layout.tsx b/aria/app/layout.tsx new file mode 100644 index 000000000..232a10953 --- /dev/null +++ b/aria/app/layout.tsx @@ -0,0 +1,59 @@ +import type { Metadata } from "next"; +import { ThemeProvider } from "@/components/contexts/theme-provider"; +import { Navbar } from "@/components/navbar"; +import { Space_Mono, Space_Grotesk } from "next/font/google"; +import { Footer } from "@/components/footer"; +import "@/styles/globals.css"; + +import { GoogleAnalytics } from '@next/third-parties/google' + +const GeistSans = Space_Grotesk({ + subsets: ["latin"], + variable: "--font-geist-sans", + display: "swap", + weight: "400", +}); + +const GeistMono = Space_Mono({ + subsets: ["latin"], + variable: "--font-geist-mono", + display: "swap", + weight: "400", +}); + +export const metadata: Metadata = { + title: "Mega - Redefining Open Source with Monolithic and Decentralized", + metadataBase: new URL("https://gitmega.dev/"), + description: + "Mega is an unofficial open source implementation of Google Piper. It is a monorepo & monolithic codebase management system that supports Git. Mega is designed to manage large-scale codebases, streamline development, and foster collaboration.", +}; + +export default function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { + return ( + + + + +
+ {children} +
+