-
-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
5,653 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. | ||
|
||
## Learn More | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
|
||
## 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. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"use client"; | ||
import { FC, ReactNode, useRef, useState } from "react"; | ||
import clsx from "clsx"; | ||
|
||
interface CodeCopyButtonProps { | ||
children: ReactNode; | ||
} | ||
|
||
const CodeCopyButton: FC<CodeCopyButtonProps> = ({ children }) => { | ||
const textInput = useRef<HTMLDivElement>(null); | ||
const [copied, setCopied] = useState(false); | ||
const onCopy = () => { | ||
setCopied(true); | ||
if (textInput.current !== null && textInput.current.textContent !== null) | ||
navigator.clipboard.writeText(textInput.current.textContent); | ||
setTimeout(() => { | ||
setCopied(false); | ||
}, 5000); | ||
}; | ||
|
||
return ( | ||
<> | ||
<div | ||
ref={textInput} | ||
onClick={onCopy} | ||
className={clsx("rounded border-2 bg-black p-1 dark:bg-gray-800", { | ||
"border border-green-500 text-green-500 hover:dark:bg-black rounded-lg p-2 hover:cursor-pointer": | ||
copied, | ||
"border border-gray-950 dark:border-neutral-300 hover:dark:bg-black bg-inherit rounded-lg p-2 hover:cursor-pointer": | ||
!copied, | ||
})} | ||
> | ||
<code lang="bash">{children}</code> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default CodeCopyButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { FC } from "react"; | ||
|
||
interface FooterProps {} | ||
|
||
const Footer: FC<FooterProps> = ({}) => { | ||
return ( | ||
<> | ||
<div className="bg-neutral-200 dark:bg-slate-900 flex flex-col md:flex-row justify-evenly items-center p-3 border-t border-slate-300 dark:border-slate-700 text-sm"> | ||
<div className="flex flex-row max-md:flex-col"> | ||
<p className=" px-2"> | ||
Created by: | ||
<a | ||
href="https://iamvishnusankar.com" | ||
target="_blank" | ||
className="hover:underline hover:cursor-pointer" | ||
> | ||
Vishnu Sankar. | ||
</a> | ||
</p> | ||
<p className=" max-md:my-2 px-2"> | ||
Website Created by: | ||
<a | ||
href="https://shreyas-chaliha.vercel.app" | ||
target="_blank" | ||
className="hover:underline hover:cursor-pointer" | ||
> | ||
Trace. | ||
</a> | ||
</p> | ||
</div> | ||
<div className=" flex flex-row"> | ||
Source: | ||
<a | ||
href="https://github.com/iamvishnusankar/next-sitemap" | ||
target="_blank" | ||
className="hover:underline hover:cursor-pointer" | ||
> | ||
Package. | ||
</a> | ||
<p className="hover:underline hover:cursor-pointer px-2"> | ||
<a | ||
href=" https://github.com/trace2798/website" | ||
target="_blank" | ||
className="hover:underline hover:cursor-pointer" | ||
> | ||
Website. | ||
</a> | ||
</p> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"use client"; | ||
import { FC } from "react"; | ||
import CodeCopyButton from "./CodeCopyButton"; | ||
import { Button } from "./blocks/Button"; | ||
import Icons from "./Icons"; | ||
|
||
interface HeroProps {} | ||
|
||
const Hero: FC<HeroProps> = ({}) => { | ||
return ( | ||
<> | ||
<main className="flex bg-neutral-200 dark:bg-slate-900 relative min-h-[94.5vh] max-w-screen overflow-hidden flex-col items-center justify-center p-8 xl:p-24 max-md:mt-16"> | ||
<div className="lg:mx-[20vw] text-center flex flex-col items-center"> | ||
<div className="border border-slate-500 dark:bg-slate-800 rounded-xl w-fit p-1 px-3 text-sm capitalize"> | ||
Sitemap generator for Next.js application | ||
</div> | ||
<h1 className="mt-3 font-bold text-4xl lg:text-6xl dark:bg-gradient-to-tl dark:from-indigo-900 dark:to-purple-500 bg-clip-text text-transparent bg-gradient-to-bl from-slate-900 to-gray-500"> | ||
Effortlessly generate sitemaps and robots.txt for your Next.js | ||
application | ||
</h1> | ||
<h2 className="mx-[10vw] mt-5 text-base md:text-xl text-gray-600 dark:text-gray-400"> | ||
Generate sitemap(s) and robots.txt for all | ||
static/pre-rendered/dynamic/server-side pages. | ||
</h2> | ||
|
||
<div className="flex flex-col md:flex-row justify-evenly mt-7 mx-[10vw] w-3/4"> | ||
<Button className="max-md:mb-10"> | ||
Explore Documentation <Icons.ArrowRight className="h-4" /> | ||
</Button> | ||
<CodeCopyButton> npm i next-sitemap </CodeCopyButton> | ||
</div> | ||
</div> | ||
</main> | ||
</> | ||
); | ||
}; | ||
|
||
export default Hero; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { ChevronLeft, ChevronRight, Moon, Sun, Laptop, ArrowRight } from 'lucide-react' | ||
|
||
export const Icons = { | ||
ChevronLeft, | ||
ChevronRight, | ||
Sun, | ||
Moon, | ||
Laptop, | ||
ArrowRight | ||
} | ||
|
||
export default Icons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Link from "next/link"; | ||
import { ThemeToggle } from "./ThemeToggle"; | ||
import { buttonVariants } from "./blocks/Button"; | ||
import SocialIcons from "./blocks/SocialIcons"; | ||
|
||
const Navbar = async () => { | ||
return ( | ||
<div className="fixed backdrop-blur-sm bg-neutral-200 dark:bg-slate-900 z-50 top-0 left-0 right-0 h-20 border-b border-slate-300 dark:border-slate-700 shadow-sm flex items-center justify-between"> | ||
<div className="container max-w-7xl mx-auto w-full flex justify-between items-center font-satoshiBold"> | ||
<div> | ||
<Link href="/" className={buttonVariants({ variant: "link" })}> | ||
next-sitemap | ||
</Link> | ||
|
||
<Link | ||
href="/docs" | ||
className={buttonVariants({ variant: "link" })} | ||
> | ||
Documentation | ||
</Link> | ||
<Link | ||
href="/examples" | ||
className={buttonVariants({ variant: "link" })} | ||
> | ||
Example | ||
</Link> | ||
</div> | ||
<div className="md:hidden flex"> | ||
<SocialIcons /> | ||
<ThemeToggle /> | ||
</div> | ||
|
||
<div className="hidden md:flex gap-4"> | ||
<SocialIcons /> | ||
<ThemeToggle /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Navbar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use client"; | ||
import { ThemeProvider } from "next-themes"; | ||
import type { FC, ReactNode } from "react"; | ||
|
||
interface ProvidersProps { | ||
children: ReactNode; | ||
} | ||
|
||
const Providers: FC<ProvidersProps> = ({ children }) => { | ||
return ( | ||
<ThemeProvider attribute="class" defaultTheme="system" enableSystem> | ||
{children} | ||
</ThemeProvider> | ||
); | ||
}; | ||
|
||
export default Providers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use client' | ||
|
||
import * as React from 'react' | ||
import { useTheme } from 'next-themes' | ||
|
||
import { Icons } from '../components/Icons' | ||
import { Button } from './blocks/Button' | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuItem, | ||
DropdownMenuTrigger, | ||
} from './blocks/DropdownMenu' | ||
|
||
export function ThemeToggle() { | ||
const { setTheme } = useTheme() | ||
|
||
return ( | ||
<DropdownMenu> | ||
<DropdownMenuTrigger asChild> | ||
<Button variant='ghost' size='sm'> | ||
<Icons.Sun className='rotate-0 scale-100 transition-all hover:text-slate-900 dark:-rotate-90 dark:scale-0 dark:text-slate-400 dark:hover:text-slate-100' /> | ||
<Icons.Moon className='absolute rotate-90 scale-0 transition-all hover:text-slate-900 dark:rotate-0 dark:scale-100 dark:text-slate-400 dark:hover:text-slate-100' /> | ||
<span className='sr-only'>Toggle theme</span> | ||
</Button> | ||
</DropdownMenuTrigger> | ||
<DropdownMenuContent align='end' forceMount> | ||
<DropdownMenuItem onClick={() => setTheme('light')}> | ||
<Icons.Sun className='mr-2 h-4 w-4' /> | ||
<span>Light</span> | ||
</DropdownMenuItem> | ||
<DropdownMenuItem onClick={() => setTheme('dark')}> | ||
<Icons.Moon className='mr-2 h-4 w-4' /> | ||
<span>Dark</span> | ||
</DropdownMenuItem> | ||
<DropdownMenuItem onClick={() => setTheme('system')}> | ||
<Icons.Laptop className='mr-2 h-4 w-4' /> | ||
<span>System</span> | ||
</DropdownMenuItem> | ||
</DropdownMenuContent> | ||
</DropdownMenu> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { cn } from "@/lib/utils"; | ||
import { cva, VariantProps } from "class-variance-authority"; | ||
import { Loader2 } from "lucide-react"; | ||
import * as React from "react"; | ||
|
||
const buttonVariants = cva( | ||
"active:scale-95 inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors ", | ||
{ | ||
variants: { | ||
variant: { | ||
default: | ||
"bg-slate-900 text-white hover:bg-slate-800 dark:bg-slate-200 dark:text-slate-900 dark:hover:bg-slate-100", | ||
destructive: "text-white hover:bg-red-600 dark:hover:bg-red-600", | ||
outline: | ||
"bg-slate-900 text-white hover:bg-slate-800 dark:bg-slate-200 dark:text-slate-900 dark:hover:bg-slate-100 border border-slate-200 dark:border-slate-700", | ||
subtle: | ||
"bg-slate-100 text-slate-900 hover:bg-slate-200 dark:bg-slate-700 dark:text-slate-100", | ||
ghost: | ||
"bg-transparent hover:bg-slate-100 dark:hover:bg-slate-800 dark:text-slate-400 data-[state=open]:bg-transparent dark:data-[state=open]:bg-transparent", | ||
link: "bg-transparent dark:bg-transparent underline-offset-4 hover:underline text-slate-900 dark:text-slate-100 hover:bg-transparent dark:hover:bg-transparent", | ||
}, | ||
size: { | ||
default: "h-10 py-2 px-4", | ||
sm: "h-9 px-2 rounded-md", | ||
lg: "h-11 px-8 rounded-md", | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: "default", | ||
size: "default", | ||
}, | ||
} | ||
); | ||
|
||
export interface ButtonProps | ||
extends React.ButtonHTMLAttributes<HTMLButtonElement>, | ||
VariantProps<typeof buttonVariants> { | ||
isLoading?: boolean; | ||
} | ||
|
||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( | ||
({ className, children, variant, isLoading, size, ...props }, ref) => { | ||
return ( | ||
<button | ||
className={cn(buttonVariants({ variant, size, className }))} | ||
ref={ref} | ||
disabled={isLoading} | ||
{...props} | ||
> | ||
{isLoading ? <Loader2 className="mr-2 h-4 w-4 animate-spin" /> : null} | ||
|
||
{children} | ||
</button> | ||
); | ||
} | ||
); | ||
Button.displayName = "Button"; | ||
|
||
export { Button, buttonVariants }; |
Oops, something went wrong.