├── .eslintignore ├── .eslintrc ├── .gitattributes ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── dependabot.yml └── workflows │ ├── codeql-analysis.yml │ ├── stale.yml │ └── test.yml ├── .gitignore ├── .npmrc ├── .prettierignore ├── .prettierrc ├── .vscode └── settings.json ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── SECURITY.md ├── assets ├── NextJS │ ├── icon │ │ ├── dark │ │ │ ├── nextjs-icon-dark.png │ │ │ └── nextjs-icon-dark.svg │ │ └── light │ │ │ ├── nextjs-icon-light.png │ │ │ └── nextjs-icon-light.svg │ └── logotype │ │ ├── dark │ │ ├── nextjs-logotype-dark.png │ │ └── nextjs-logotype-dark.svg │ │ └── light │ │ ├── nextjs-logotype-light.png │ │ └── nextjs-logotype-light.svg ├── Vercel │ ├── icon │ │ ├── dark │ │ │ ├── vercel-icon-dark.png │ │ │ └── vercel-icon-dark.svg │ │ └── light │ │ │ ├── vercel-icon-light.png │ │ │ └── vercel-icon-light.svg │ └── logotype │ │ ├── dark │ │ ├── vercel-logotype-dark.png │ │ └── vercel-logotype-dark.svg │ │ └── light │ │ ├── vercel-logotype-light.png │ │ └── vercel-logotype-light.svg ├── banner.png ├── banner.svg └── ts-jsdoc.png ├── azure-pipeline.yml ├── bun.lockb ├── changelog.md ├── docs ├── .eslintrc ├── .gitignore ├── app │ ├── api │ │ └── og │ │ │ └── route.tsx │ ├── components │ │ ├── CodeCopyButton.tsx │ │ ├── Footer.tsx │ │ ├── GithubStars.tsx │ │ ├── Hero.tsx │ │ ├── Icons.tsx │ │ ├── Navbar.tsx │ │ ├── Navbar │ │ │ ├── MobileMenu.tsx │ │ │ ├── Navbar.tsx │ │ │ └── NavbarItem.tsx │ │ ├── Providers.tsx │ │ ├── ThemeToggle.tsx │ │ ├── blocks │ │ │ ├── Button.tsx │ │ │ ├── DropdownMenu.tsx │ │ │ └── SocialIcons.tsx │ │ ├── callout.tsx │ │ ├── cards │ │ │ ├── card.tsx │ │ │ ├── cardItem.tsx │ │ │ └── data.tsx │ │ ├── docsMenu │ │ │ ├── But.tsx │ │ │ └── MenuButton.tsx │ │ ├── mdx-card.tsx │ │ ├── mdx-components.tsx │ │ ├── page-header.tsx │ │ ├── pager.tsx │ │ ├── sidebar-nav.tsx │ │ ├── toc.tsx │ │ └── ui │ │ │ ├── Toaster.tsx │ │ │ ├── toast.tsx │ │ │ └── use-toast.ts │ ├── docs │ │ └── [[...slug]] │ │ │ ├── layout.tsx │ │ │ └── page.tsx │ ├── examples │ │ └── page.tsx │ ├── favicon.ico │ ├── layout.tsx │ └── page.tsx ├── assets │ └── fonts │ │ ├── CalSans-SemiBold.ttf │ │ ├── CalSans-SemiBold.woff │ │ ├── CalSans-SemiBold.woff2 │ │ ├── Inter-Bold.ttf │ │ ├── Inter-Regular.ttf │ │ ├── Ranade-Italic.eot │ │ ├── Ranade-Italic.ttf │ │ ├── Ranade-Italic.woff │ │ ├── Ranade-Italic.woff2 │ │ ├── Ranade-Light.eot │ │ ├── Ranade-Light.ttf │ │ ├── Ranade-Light.woff │ │ ├── Ranade-Light.woff2 │ │ ├── Ranade-LightItalic.eot │ │ ├── Ranade-LightItalic.ttf │ │ ├── Ranade-LightItalic.woff │ │ ├── Ranade-LightItalic.woff2 │ │ ├── Ranade-Medium.eot │ │ ├── Ranade-Medium.ttf │ │ ├── Ranade-Medium.woff │ │ ├── Ranade-Medium.woff2 │ │ ├── Ranade-MediumItalic.eot │ │ ├── Ranade-MediumItalic.ttf │ │ ├── Ranade-MediumItalic.woff │ │ ├── Ranade-MediumItalic.woff2 │ │ ├── Ranade-Regular.eot │ │ ├── Ranade-Regular.ttf │ │ ├── Ranade-Regular.woff │ │ ├── Ranade-Regular.woff2 │ │ ├── Ranade-Thin.eot │ │ ├── Ranade-Thin.ttf │ │ ├── Ranade-Thin.woff │ │ ├── Ranade-Thin.woff2 │ │ ├── Ranade-ThinItalic.eot │ │ ├── Ranade-ThinItalic.ttf │ │ ├── Ranade-ThinItalic.woff │ │ ├── Ranade-ThinItalic.woff2 │ │ ├── Satoshi-Black.eot │ │ ├── Satoshi-Black.ttf │ │ ├── Satoshi-Black.woff │ │ ├── Satoshi-Black.woff2 │ │ ├── Satoshi-Bold.eot │ │ ├── Satoshi-Bold.ttf │ │ ├── Satoshi-Bold.woff │ │ ├── Satoshi-Bold.woff2 │ │ ├── Satoshi-Medium.eot │ │ ├── Satoshi-Medium.ttf │ │ ├── Satoshi-Medium.woff │ │ └── Satoshi-Medium.woff2 ├── config │ ├── docs.ts │ └── site.ts ├── content │ └── docs │ │ ├── documentation │ │ ├── additional-path.mdx │ │ ├── code-blocks.mdx │ │ ├── configuration.mdx │ │ ├── custom-transformation.mdx │ │ ├── dynamic-sitemaps.mdx │ │ ├── full-example.mdx │ │ ├── getServerSideSitemap.mdx │ │ ├── getServerSideSitemapIndex.mdx │ │ ├── google-sitemap.mdx │ │ ├── index-sitemap.mdx │ │ ├── installation.mdx │ │ └── typescriptjsdoc.mdx │ │ └── index.mdx ├── contentlayer.config.js ├── env.mjs ├── hooks │ └── use-mounted.ts ├── lib │ ├── toc.ts │ ├── utils.ts │ └── validations │ │ └── og.ts ├── next-sitemap.config.js ├── next.config.js ├── package.json ├── postcss.config.js ├── public │ ├── examples.jpg │ ├── images │ │ └── ts-jsdoc.png │ ├── logo.jpg │ ├── next.svg │ ├── og.jpg │ └── vercel.svg ├── styles │ ├── globals.css │ └── mdx.css ├── tailwind.config.js ├── tsconfig.json └── types │ └── index.d.ts ├── examples ├── amp │ ├── README.md │ ├── next-env.d.ts │ ├── next-sitemap.config.js │ ├── package.json │ ├── pages │ │ ├── about.tsx │ │ └── index.tsx │ └── tsconfig.json ├── app-dir │ ├── .vscode │ │ └── settings.json │ ├── app │ │ ├── (sitemaps) │ │ │ ├── server-sitemap-index.xml │ │ │ │ └── route.ts │ │ │ └── server-sitemap.xml │ │ │ │ └── route.ts │ │ ├── [dynamic] │ │ │ └── page.tsx │ │ ├── layout.tsx │ │ └── page.tsx │ ├── next-env.d.ts │ ├── next-sitemap.config.js │ ├── next.config.js │ ├── package.json │ └── tsconfig.json ├── basic │ ├── .gitignore │ ├── README.md │ ├── next-env.d.ts │ ├── next-sitemap.config.js │ ├── package.json │ ├── pages │ │ ├── [dynamic] │ │ │ └── index.tsx │ │ ├── index.tsx │ │ ├── server-sitemap-index.xml │ │ │ └── index.tsx │ │ └── server-sitemap.xml │ │ │ └── index.tsx │ └── tsconfig.json ├── commonjs │ ├── .gitignore │ ├── README.md │ ├── next-env.d.ts │ ├── next-sitemap.config.js │ ├── package.json │ ├── pages │ │ ├── [dynamic] │ │ │ └── index.tsx │ │ ├── index.tsx │ │ ├── server-sitemap-index.xml │ │ │ └── index.tsx │ │ └── server-sitemap.xml │ │ │ └── index.tsx │ └── tsconfig.json ├── custom-config-file │ ├── .gitignore │ ├── README.md │ ├── awesome-sitemap.config.js │ ├── next-env.d.ts │ ├── package.json │ ├── pages │ │ ├── [dynamic] │ │ │ └── index.tsx │ │ ├── index.tsx │ │ ├── server-sitemap-index.xml │ │ │ └── index.tsx │ │ └── server-sitemap.xml │ │ │ └── index.tsx │ └── tsconfig.json ├── custom-overrides │ ├── .gitignore │ ├── next-env.d.ts │ ├── next-sitemap.config.js │ ├── next.config.js │ ├── package.json │ ├── pages │ │ └── index.tsx │ └── tsconfig.json ├── custom-robots-txt-transformer │ ├── .gitignore │ ├── README.md │ ├── art.js │ ├── next-env.d.ts │ ├── next-sitemap.config.js │ ├── package.json │ ├── pages │ │ ├── [dynamic] │ │ │ └── index.tsx │ │ └── index.tsx │ └── tsconfig.json ├── no-index-sitemaps │ ├── .gitignore │ ├── README.md │ ├── next-env.d.ts │ ├── next-sitemap.config.js │ ├── package.json │ ├── pages │ │ ├── [dynamic] │ │ │ └── index.tsx │ │ └── index.tsx │ └── tsconfig.json ├── static-export │ ├── .gitignore │ ├── README.md │ ├── app │ │ ├── about │ │ │ ├── more │ │ │ │ └── page.tsx │ │ │ └── page.tsx │ │ ├── layout.tsx │ │ └── page.tsx │ ├── next-sitemap.config.js │ ├── next.config.js │ ├── package.json │ ├── public │ │ ├── next.svg │ │ └── vercel.svg │ └── tsconfig.json └── with-next-sitemap-i18n │ ├── README.md │ ├── next-env.d.ts │ ├── next-sitemap.config.js │ ├── next.config.js │ ├── package.json │ ├── pages │ ├── [dynamic] │ │ └── index.tsx │ ├── about.tsx │ ├── index.tsx │ ├── server-sitemap-index.xml │ │ └── index.tsx │ └── server-sitemap.xml │ │ └── index.tsx │ └── tsconfig.json ├── package.json ├── packages └── next-sitemap │ ├── .npmignore │ ├── README.md │ ├── bin │ ├── next-sitemap.cjs │ └── next-sitemap.mjs │ ├── package.json │ ├── src │ ├── __fixtures__ │ │ ├── config.ts │ │ └── manifest.ts │ ├── builders │ │ ├── __tests__ │ │ │ ├── robots-txt-builder │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── generate-robots-txt.test.ts.snap │ │ │ │ └── generate-robots-txt.test.ts │ │ │ ├── sitemap-builder │ │ │ │ ├── __snapshots__ │ │ │ │ │ └── build-sitemap-xml.test.ts.snap │ │ │ │ └── build-sitemap-xml.test.ts │ │ │ └── url-set-builder │ │ │ │ ├── __snapshots__ │ │ │ │ └── absolute-url.test.ts.snap │ │ │ │ ├── absolute-url.test.ts │ │ │ │ ├── create-url-set.test.ts │ │ │ │ └── normalize-sitemap-field.test.ts │ │ ├── exportable-builder.ts │ │ ├── robots-txt-builder.ts │ │ ├── sitemap-builder.ts │ │ └── url-set-builder.ts │ ├── cli.ts │ ├── index.ts │ ├── interface.ts │ ├── logger.ts │ ├── parsers │ │ ├── config-parser.ts │ │ └── manifest-parser.ts │ ├── ssr │ │ ├── response.ts │ │ ├── sitemap-index.ts │ │ └── sitemap.ts │ └── utils │ │ ├── __tests__ │ │ ├── array.test.ts │ │ ├── defaults.test.ts │ │ └── url.test.ts │ │ ├── array.ts │ │ ├── defaults.ts │ │ ├── file.ts │ │ ├── matcher.ts │ │ ├── merge.ts │ │ ├── path.ts │ │ └── url.ts │ └── tsconfig.json ├── tsconfig.json └── turbo.json /.eslintignore: -------------------------------------------------------------------------------- 1 | dist 2 | out 3 | .yarn 4 | .yarnrc.yml 5 | .contentlayer -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@corex"], 3 | "rules": { 4 | "react/react-in-jsx-scope": "off" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto eol=lf -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [iamvishnusankar] 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: iamvishnusankar 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Additional context** 27 | Add any other context about the problem here. 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: iamvishnusankar 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Maintain dependencies for GitHub Actions 4 | - package-ecosystem: 'github-actions' 5 | directory: '/' 6 | schedule: 7 | interval: 'weekly' 8 | 9 | # Maintain dependencies for npm 10 | - package-ecosystem: 'npm' 11 | directory: '/' 12 | schedule: 13 | interval: 'weekly' 14 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: 'CodeQL' 13 | 14 | on: 15 | push: 16 | branches: [master] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [master] 20 | schedule: 21 | - cron: '34 13 * * 6' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: ['typescript'] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Learn more about CodeQL language support at https://git.io/codeql-language-support 38 | 39 | steps: 40 | - name: Checkout repository 41 | uses: actions/checkout@v3 42 | 43 | # Initializes the CodeQL tools for scanning. 44 | - name: Initialize CodeQL 45 | uses: github/codeql-action/init@v2 46 | with: 47 | languages: ${{ matrix.language }} 48 | # If you wish to specify custom queries, you can do so here or in a config file. 49 | # By default, queries listed here will override any specified in a config file. 50 | # Prefix the list here with "+" to use these queries and those in the config file. 51 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 52 | 53 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 54 | # If this step fails, then you should remove it and run the build manually (see below) 55 | - name: Autobuild 56 | uses: github/codeql-action/autobuild@v2 57 | 58 | # ℹ️ Command-line programs to run using the OS shell. 59 | # 📚 https://git.io/JvXDl 60 | 61 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 62 | # and modify them (or add more) to build your code if your project 63 | # uses a compiled language 64 | 65 | #- run: | 66 | # make bootstrap 67 | # make release 68 | 69 | - name: Perform CodeQL Analysis 70 | uses: github/codeql-action/analyze@v2 71 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | # This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time. 2 | # 3 | # You can adjust the behavior by modifying this file. 4 | # For more information, see: 5 | # https://github.com/actions/stale 6 | name: Mark stale issues and pull requests 7 | 8 | on: 9 | schedule: 10 | - cron: '28 4 * * *' 11 | 12 | jobs: 13 | stale: 14 | runs-on: ubuntu-latest 15 | permissions: 16 | issues: write 17 | pull-requests: write 18 | 19 | steps: 20 | - uses: actions/stale@v8 21 | with: 22 | repo-token: ${{ secrets.GITHUB_TOKEN }} 23 | stale-issue-message: 'Closing this issue due to inactivity.' 24 | stale-pr-message: 'Closing this PR due to inactivity. ' 25 | stale-issue-label: 'no-issue-activity' 26 | stale-pr-label: 'no-pr-activity' 27 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: 3 | push: 4 | branches: 5 | - master 6 | # - development 7 | 8 | pull_request: 9 | branches: 10 | - master 11 | 12 | jobs: 13 | test: 14 | strategy: 15 | matrix: 16 | platform: [ubuntu-latest, macos-latest] # windows-latest] 17 | node: ['18', '20'] 18 | runs-on: ${{ matrix.platform }} 19 | steps: 20 | - name: Github Checkout 21 | uses: actions/checkout@v3 22 | 23 | - name: Setup node 24 | uses: actions/setup-node@v3 25 | with: 26 | node-version: ${{ matrix.node }} 27 | 28 | - name: Setup bun 29 | uses: oven-sh/setup-bun@v1 30 | 31 | - name: Setup nextjs cache 32 | uses: actions/cache@v3 33 | with: 34 | path: | 35 | ~/.npm 36 | ${{ github.workspace }}/.next/cache 37 | ${{ github.workspace }}/**/.next/cache 38 | # Generate a new cache whenever packages or source files change. 39 | key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} 40 | # If source files changed but packages didn't, rebuild from a prior cache. 41 | restore-keys: | 42 | ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}- 43 | 44 | - name: Install 45 | run: bun install --immutable --force 46 | 47 | - name: Lint 48 | run: bun run lint 49 | 50 | - name: Test 51 | run: bun run test 52 | env: 53 | CI: true 54 | NEXT_TELEMETRY_DISABLED: 1 55 | 56 | - name: Build 57 | run: bun run build 58 | env: 59 | NEXT_TELEMETRY_DISABLED: 1 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (https://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # TypeScript v1 declaration files 40 | typings/ 41 | 42 | # Optional npm cache directory 43 | .npm 44 | 45 | # Optional eslint cache 46 | .eslintcache 47 | 48 | # Optional REPL history 49 | .node_repl_history 50 | 51 | # Output of 'npm pack' 52 | *.tgz 53 | 54 | # Yarn Integrity file 55 | .yarn-integrity 56 | 57 | # dotenv environment variables file 58 | .env 59 | 60 | # next.js build output 61 | .next 62 | 63 | # Custom 64 | .DS_Store 65 | coverage 66 | dist 67 | junit.xml 68 | tsconfig.tsbuildinfo 69 | **/public/*.xml 70 | **/public/*.txt 71 | .idea 72 | .turbo 73 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | always-auth=true -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .next 2 | public 3 | dist 4 | .vscode 5 | out 6 | .yarn 7 | .yarnrc.yml 8 | .contentlayer -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "semi": false 4 | } 5 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "jest.showCoverageOnLoad": true 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Vishnu Sankar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /assets/NextJS/icon/dark/nextjs-icon-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/assets/NextJS/icon/dark/nextjs-icon-dark.png -------------------------------------------------------------------------------- /assets/NextJS/icon/dark/nextjs-icon-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/NextJS/icon/light/nextjs-icon-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/assets/NextJS/icon/light/nextjs-icon-light.png -------------------------------------------------------------------------------- /assets/NextJS/icon/light/nextjs-icon-light.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/NextJS/logotype/dark/nextjs-logotype-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/assets/NextJS/logotype/dark/nextjs-logotype-dark.png -------------------------------------------------------------------------------- /assets/NextJS/logotype/dark/nextjs-logotype-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /assets/NextJS/logotype/light/nextjs-logotype-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/assets/NextJS/logotype/light/nextjs-logotype-light.png -------------------------------------------------------------------------------- /assets/NextJS/logotype/light/nextjs-logotype-light.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /assets/Vercel/icon/dark/vercel-icon-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/assets/Vercel/icon/dark/vercel-icon-dark.png -------------------------------------------------------------------------------- /assets/Vercel/icon/dark/vercel-icon-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/Vercel/icon/light/vercel-icon-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/assets/Vercel/icon/light/vercel-icon-light.png -------------------------------------------------------------------------------- /assets/Vercel/icon/light/vercel-icon-light.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/Vercel/logotype/dark/vercel-logotype-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/assets/Vercel/logotype/dark/vercel-logotype-dark.png -------------------------------------------------------------------------------- /assets/Vercel/logotype/dark/vercel-logotype-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/Vercel/logotype/light/vercel-logotype-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/assets/Vercel/logotype/light/vercel-logotype-light.png -------------------------------------------------------------------------------- /assets/Vercel/logotype/light/vercel-logotype-light.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /assets/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/assets/banner.png -------------------------------------------------------------------------------- /assets/ts-jsdoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/assets/ts-jsdoc.png -------------------------------------------------------------------------------- /bun.lockb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/bun.lockb -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | ## 4.0.x 2 | 3 | v4.0.x added support for next13.2+ `appDir` via [Custom Route Handlers](https://nextjs.org/blog/next-13-2#custom-route-handlers) 4 | 5 | #### API Changes 6 | 7 | Generating dynamic/server-side sitemaps 8 | 9 | - `getServerSideSitemapIndex`: Generates index sitemaps based on urls provided and returns application/xml response. Supports next13+ route.{ts,js} file. 10 | 11 | - To continue using inside pages directory, import `getServerSideSitemapIndexLegacy` instead. 12 | 13 | - `getServerSideSitemap`: Generates sitemap based on field entires and returns application/xml response. Supports next13+ route.{ts,js} file. 14 | 15 | - To continue using inside pages directory, import `getServerSideSitemapLegacy` instead. 16 | -------------------------------------------------------------------------------- /docs/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next", "next/core-web-vitals"] 3 | } 4 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | /.contentlayer/ 15 | sitemap.xml 16 | 17 | # production 18 | /build 19 | 20 | # misc 21 | .DS_Store 22 | *.pem 23 | 24 | # debug 25 | npm-debug.log* 26 | yarn-debug.log* 27 | yarn-error.log* 28 | 29 | # local env files 30 | .env*.local 31 | 32 | # vercel 33 | .vercel 34 | 35 | # typescript 36 | *.tsbuildinfo 37 | next-env.d.ts 38 | 39 | -------------------------------------------------------------------------------- /docs/app/components/CodeCopyButton.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import { FC, ReactNode, useRef, useState } from 'react' 3 | import clsx from 'clsx' 4 | import { useToast } from '@/app/components/ui/use-toast' 5 | 6 | interface CodeCopyButtonProps { 7 | children: ReactNode 8 | } 9 | 10 | const CodeCopyButton: FC = ({ children }) => { 11 | const textInput = useRef(null) 12 | const [copied, setCopied] = useState(false) 13 | const { toast } = useToast() 14 | const onCopy = () => { 15 | setCopied(true) 16 | toast({ 17 | title: 'Successfully copied to clipboard', 18 | }) 19 | if (textInput.current !== null && textInput.current.textContent !== null) 20 | navigator.clipboard.writeText(textInput.current.textContent) 21 | setTimeout(() => { 22 | setCopied(false) 23 | }, 5000) 24 | } 25 | 26 | return ( 27 | <> 28 |
41 | {children} 42 |
43 | 44 | ) 45 | } 46 | 47 | export default CodeCopyButton 48 | -------------------------------------------------------------------------------- /docs/app/components/Footer.tsx: -------------------------------------------------------------------------------- 1 | const Footer = () => { 2 | return ( 3 | <> 4 |
5 |
6 |

7 | Created by:  8 | 14 | Vishnu Sankar & Contributors.  15 | 16 |

17 |

18 | Font From:  19 | 25 | Fontshare.  26 | 27 |

28 |
29 |
30 | 36 | Website Source.  37 | 38 |
39 |
40 | 41 | ) 42 | } 43 | 44 | export default Footer 45 | -------------------------------------------------------------------------------- /docs/app/components/GithubStars.tsx: -------------------------------------------------------------------------------- 1 | import { siteConfig } from '@/config/site' 2 | import Link from 'next/link' 3 | 4 | interface GithubStarsProps { 5 | stars: string 6 | } 7 | 8 | const GithubStars: React.FC = ({ stars }) => { 9 | return ( 10 |
11 | {stars && ( 12 | 18 |
19 | 25 | 26 | 27 |
28 |
29 |
30 |
31 | {stars} stars on GitHub 32 |
33 |
34 | 35 | )} 36 |

37 | Proudly Open source. MIT license. 38 |

39 |
40 | ) 41 | } 42 | 43 | export default GithubStars 44 | -------------------------------------------------------------------------------- /docs/app/components/Hero.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import CodeCopyButton from './CodeCopyButton' 3 | import Icons from './Icons' 4 | import { Button } from './blocks/Button' 5 | 6 | const Hero = () => { 7 | return ( 8 | <> 9 |
10 |
11 |
12 | Sitemap generator for Next.js application 13 |
14 |

15 | Effortlessly generate sitemaps and robots.txt for your Next.js 16 | application 17 |

18 |

19 | Generate sitemap(s) and robots.txt for all 20 | static/pre-rendered/dynamic/server-side pages. 21 |

22 | 23 |
24 | 27 | yarn add next-sitemap 28 |
29 |
30 |
31 | 32 | ) 33 | } 34 | 35 | export default Hero 36 | -------------------------------------------------------------------------------- /docs/app/components/Icons.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | ArrowRight, 3 | ChevronLeft, 4 | ChevronRight, 5 | Laptop, 6 | Moon, 7 | Sun, 8 | } from 'lucide-react' 9 | 10 | export const Icons = { 11 | ChevronLeft, 12 | ChevronRight, 13 | Sun, 14 | Moon, 15 | Laptop, 16 | ArrowRight, 17 | } 18 | 19 | export default Icons 20 | -------------------------------------------------------------------------------- /docs/app/components/Navbar.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import Link from 'next/link' 3 | import { ThemeToggle } from './ThemeToggle' 4 | import { buttonVariants } from './blocks/Button' 5 | import SocialIcons from './blocks/SocialIcons' 6 | 7 | const Navbar = () => { 8 | return ( 9 |
10 |
11 |
12 | 13 | next-sitemap 14 | 15 | 16 | 17 | Documentation 18 | 19 | 23 | Example 24 | 25 |
26 |
27 | 28 | 29 |
30 | 31 |
32 | 33 | 34 |
35 |
36 |
37 | ) 38 | } 39 | 40 | export default Navbar 41 | -------------------------------------------------------------------------------- /docs/app/components/Navbar/MobileMenu.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import React from 'react' 3 | import { useRouter } from 'next/navigation' 4 | import MenuItem from './NavbarItem' 5 | import SocialIcons from '../blocks/SocialIcons' 6 | 7 | interface MobileMenuProps { 8 | visible?: boolean 9 | } 10 | 11 | const MobileMenu: React.FC = ({ visible }) => { 12 | const router = useRouter() 13 | if (!visible) { 14 | return null 15 | } 16 | 17 | return ( 18 |
19 |
20 | router.push('/')} label="Home" /> 21 | router.push('/docs')} label="Documentation" /> 22 | router.push('/examples')} label="Examples" /> 23 |
24 |
25 |
26 | 27 |
28 |
29 | ) 30 | } 31 | 32 | export default MobileMenu 33 | -------------------------------------------------------------------------------- /docs/app/components/Navbar/Navbar.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import { useRouter } from 'next/navigation' 3 | import { useCallback, useState } from 'react' 4 | import MobileMenu from './MobileMenu' 5 | import MenuItem from './NavbarItem' 6 | 7 | import Icons from '../Icons' 8 | import { ThemeToggle } from '../ThemeToggle' 9 | import SocialIcons from '../blocks/SocialIcons' 10 | 11 | const Navbar = () => { 12 | const [showMobileMenu, setShowMobileMenu] = useState(false) 13 | const toggleMobileMenu = useCallback(() => { 14 | setShowMobileMenu((current) => !current) 15 | }, []) 16 | 17 | const router = useRouter() 18 | return ( 19 | 51 | ) 52 | } 53 | 54 | export default Navbar 55 | -------------------------------------------------------------------------------- /docs/app/components/Navbar/NavbarItem.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | 3 | interface MenuItemProps { 4 | onClick: () => void 5 | label: string 6 | } 7 | 8 | const MenuItem: React.FC = ({ onClick, label }) => { 9 | return ( 10 |
14 | {label} 15 |
16 | ) 17 | } 18 | 19 | export default MenuItem 20 | -------------------------------------------------------------------------------- /docs/app/components/Providers.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import { ThemeProvider } from 'next-themes' 3 | import type { FC, ReactNode } from 'react' 4 | 5 | interface ProvidersProps { 6 | children: ReactNode 7 | } 8 | 9 | const Providers: FC = ({ children }) => { 10 | return ( 11 | 12 | {children} 13 | 14 | ) 15 | } 16 | 17 | export default Providers 18 | -------------------------------------------------------------------------------- /docs/app/components/ThemeToggle.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | 3 | import { useTheme } from 'next-themes' 4 | 5 | import { Icons } from '../components/Icons' 6 | import { Button } from './blocks/Button' 7 | import { 8 | DropdownMenu, 9 | DropdownMenuContent, 10 | DropdownMenuItem, 11 | DropdownMenuTrigger, 12 | } from './blocks/DropdownMenu' 13 | 14 | export function ThemeToggle() { 15 | const { setTheme } = useTheme() 16 | 17 | return ( 18 | 19 | 20 | 25 | 26 | 27 | setTheme('light')}> 28 | 29 | Light 30 | 31 | setTheme('dark')}> 32 | 33 | Dark 34 | 35 | setTheme('system')}> 36 | 37 | System 38 | 39 | 40 | 41 | ) 42 | } 43 | -------------------------------------------------------------------------------- /docs/app/components/blocks/Button.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from '@/lib/utils' 2 | import { cva, VariantProps } from 'class-variance-authority' 3 | import { Loader2 } from 'lucide-react' 4 | import * as React from 'react' 5 | 6 | const buttonVariants = cva( 7 | 'active:scale-95 inline-flex items-center justify-center rounded-md text-sm font-ranadeMedium transition-colors ', 8 | { 9 | variants: { 10 | variant: { 11 | default: 12 | 'bg-slate-900 border text-white hover:bg-neutral-100 hover:text-slate-950 hover:border-black dark:hover:border-neutral-200 dark:bg-slate-200 dark:text-slate-900 dark:hover:bg-slate-950 dark:hover:text-neutral-200', 13 | destructive: 'text-white hover:bg-red-600 dark:hover:bg-red-600', 14 | outline: 15 | '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', 16 | subtle: 17 | 'bg-slate-100 text-slate-900 hover:bg-slate-200 dark:bg-slate-700 dark:text-slate-100', 18 | ghost: 19 | 'bg-transparent hover:bg-neutral-300 dark:hover:bg-slate-800 dark:text-slate-400 data-[state=open]:bg-transparent dark:data-[state=open]:bg-transparent', 20 | 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', 21 | }, 22 | size: { 23 | default: 'h-10 py-2 px-4', 24 | sm: 'h-9 px-2 rounded-md', 25 | lg: 'h-11 px-8 rounded-md', 26 | }, 27 | }, 28 | defaultVariants: { 29 | variant: 'default', 30 | size: 'default', 31 | }, 32 | }, 33 | ) 34 | 35 | export interface ButtonProps 36 | extends React.ButtonHTMLAttributes, 37 | VariantProps { 38 | isLoading?: boolean 39 | } 40 | 41 | const Button = React.forwardRef( 42 | ({ className, children, variant, isLoading, size, ...props }, ref) => { 43 | return ( 44 | 54 | ) 55 | }, 56 | ) 57 | Button.displayName = 'Button' 58 | 59 | export { Button, buttonVariants } 60 | -------------------------------------------------------------------------------- /docs/app/components/blocks/SocialIcons.tsx: -------------------------------------------------------------------------------- 1 | const SocialIcons = () => { 2 | return ( 3 | <> 4 | 39 | 40 | ) 41 | } 42 | 43 | export default SocialIcons 44 | -------------------------------------------------------------------------------- /docs/app/components/callout.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from '@/lib/utils' 2 | 3 | interface CalloutProps { 4 | icon?: string 5 | children?: React.ReactNode 6 | type?: 'default' | 'warning' | 'danger' 7 | } 8 | 9 | export function Callout({ 10 | children, 11 | icon, 12 | type = 'default', 13 | ...props 14 | }: CalloutProps) { 15 | return ( 16 |
26 | {icon && {icon}} 27 |
{children}
28 |
29 | ) 30 | } 31 | -------------------------------------------------------------------------------- /docs/app/components/cards/card.tsx: -------------------------------------------------------------------------------- 1 | import CardItem from './cardItem' 2 | import { exampleData } from './data' 3 | 4 | const Card = () => { 5 | return ( 6 | <> 7 | {exampleData.map((data) => { 8 | return ( 9 |
13 | 18 |
19 | ) 20 | })} 21 | 22 | ) 23 | } 24 | 25 | export default Card 26 | -------------------------------------------------------------------------------- /docs/app/components/cards/cardItem.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | 3 | import React from 'react' 4 | 5 | interface CardItemProps { 6 | href: string 7 | title?: string 8 | description?: string 9 | } 10 | 11 | const CardItem: React.FC = ({ href, title, description }) => { 12 | return ( 13 | 14 |

15 | {title} 16 |

17 |

18 | {description} 19 |

20 |
21 | ) 22 | } 23 | 24 | export default CardItem 25 | -------------------------------------------------------------------------------- /docs/app/components/cards/data.tsx: -------------------------------------------------------------------------------- 1 | export const exampleData = [ 2 | { 3 | title: `Using /app directory`, 4 | description: `Sitemap generated utilizing next-sitemap and the /app directory. `, 5 | href: 'https://github.com/iamvishnusankar/next-sitemap/tree/master/examples/app-dir', 6 | }, 7 | { 8 | title: `Using next-sitemap with static-export`, 9 | description: `Generating sitemap utilizing next-sitemap and static-export`, 10 | href: 'https://github.com/iamvishnusankar/next-sitemap/tree/master/examples/static-export', 11 | }, 12 | { 13 | title: `Generating no index-sitemaps (pages)`, 14 | description: `Generating no index-sitemaps.`, 15 | href: 'https://github.com/iamvishnusankar/next-sitemap/tree/master/examples/no-index-sitemaps', 16 | }, 17 | { 18 | title: `Using next-sitemap with Internationalization Routing (pages)`, 19 | description: `Generating sitemap utilizing next-sitemap and Internationalization (i18n) Routing`, 20 | href: 'https://github.com/iamvishnusankar/next-sitemap/tree/master/examples/with-next-sitemap-i18n', 21 | }, 22 | { 23 | title: `Other Examples`, 24 | description: `Click on it to check the repo for other examples.`, 25 | href: 'https://github.com/iamvishnusankar/next-sitemap/tree/master/examples', 26 | }, 27 | ] 28 | -------------------------------------------------------------------------------- /docs/app/components/docsMenu/But.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import { useCallback, useState } from 'react' 3 | import Icons from '../Icons' 4 | import MenuButton from './MenuButton' 5 | 6 | const But = () => { 7 | const [showMobileMenu, setShowMobileMenu] = useState(false) 8 | const toggleMobileMenu = useCallback(() => { 9 | setShowMobileMenu((current) => !current) 10 | }, []) 11 | 12 | return ( 13 | 31 | ) 32 | } 33 | 34 | export default But 35 | -------------------------------------------------------------------------------- /docs/app/components/docsMenu/MenuButton.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import { docsConfig } from '@/config/docs' 3 | import React from 'react' 4 | import { DocsSidebarNav } from '../sidebar-nav' 5 | 6 | interface MenuButtonProps { 7 | visible?: boolean 8 | } 9 | 10 | const MenuButton: React.FC = ({ visible }) => { 11 | if (!visible) { 12 | return null 13 | } 14 | 15 | return ( 16 |
17 |
18 | 19 |
20 |
21 |
22 | ) 23 | } 24 | 25 | export default MenuButton 26 | -------------------------------------------------------------------------------- /docs/app/components/mdx-card.tsx: -------------------------------------------------------------------------------- 1 | import Link from 'next/link' 2 | 3 | import { cn } from '@/lib/utils' 4 | 5 | interface CardProps extends React.HTMLAttributes { 6 | href?: string 7 | disabled?: boolean 8 | } 9 | 10 | export function MdxCard({ 11 | href, 12 | className, 13 | children, 14 | disabled, 15 | ...props 16 | }: CardProps) { 17 | return ( 18 |
26 |
27 |
28 | {children} 29 |
30 |
31 | {href && ( 32 | 33 | View 34 | 35 | )} 36 |
37 | ) 38 | } 39 | -------------------------------------------------------------------------------- /docs/app/components/page-header.tsx: -------------------------------------------------------------------------------- 1 | import { cn } from '@/lib/utils' 2 | 3 | interface DocsPageHeaderProps extends React.HTMLAttributes { 4 | heading: string 5 | text?: string 6 | } 7 | 8 | export function DocsPageHeader({ 9 | heading, 10 | text, 11 | className, 12 | ...props 13 | }: DocsPageHeaderProps) { 14 | return ( 15 | <> 16 |
17 |

18 | {heading} 19 |

20 | {text && ( 21 |

22 | {text} 23 |

24 | )} 25 |
26 |
27 | 28 | ) 29 | } 30 | -------------------------------------------------------------------------------- /docs/app/components/pager.tsx: -------------------------------------------------------------------------------- 1 | import Link from 'next/link' 2 | import { Doc } from 'contentlayer/generated' 3 | 4 | import { docsConfig } from '@/config/docs' 5 | import { cn } from '@/lib/utils' 6 | 7 | import { buttonVariants } from './blocks/Button' 8 | import Icons from './Icons' 9 | 10 | interface DocsPagerProps { 11 | doc: Doc 12 | } 13 | 14 | export function DocsPager({ doc }: DocsPagerProps) { 15 | const pager = getPagerForDoc(doc) 16 | 17 | if (!pager) { 18 | return null 19 | } 20 | 21 | return ( 22 |
23 | {pager?.prev && ( 24 | 28 | 29 | {pager.prev.title} 30 | 31 | )} 32 | {pager?.next && ( 33 | 37 | {pager.next.title} 38 | 39 | 40 | )} 41 |
42 | ) 43 | } 44 | 45 | export function getPagerForDoc(doc: Doc) { 46 | const flattenedLinks = [null, ...flatten(docsConfig.sidebarNav), null] 47 | const activeIndex = flattenedLinks.findIndex( 48 | (link) => doc.slug === link?.href, 49 | ) 50 | const prev = activeIndex !== 0 ? flattenedLinks[activeIndex - 1] : null 51 | const next = 52 | activeIndex !== flattenedLinks.length - 1 53 | ? flattenedLinks[activeIndex + 1] 54 | : null 55 | return { 56 | prev, 57 | next, 58 | } 59 | } 60 | 61 | export function flatten(links: ({ items?: any[] } | any)[]): any[] { 62 | return links.reduce((flat, link) => { 63 | return flat.concat(link.items ? flatten(link.items) : link) 64 | }, []) 65 | } 66 | -------------------------------------------------------------------------------- /docs/app/components/sidebar-nav.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | import Link from 'next/link' 3 | import { usePathname } from 'next/navigation' 4 | 5 | import { cn } from '@/lib/utils' 6 | import { SidebarNavItem } from '@/types' 7 | 8 | export interface DocsSidebarNavProps { 9 | items: SidebarNavItem[] 10 | } 11 | 12 | export function DocsSidebarNav({ items }: DocsSidebarNavProps) { 13 | const pathname = usePathname() 14 | 15 | return items.length ? ( 16 |
17 | {items.map((item, index) => ( 18 |
19 |

20 | {item.title} 21 |

22 | {item.items ? ( 23 | 28 | ) : null} 29 |
30 | ))} 31 |
32 | ) : null 33 | } 34 | 35 | interface DocsSidebarNavItemsProps { 36 | items: SidebarNavItem[] 37 | pathname: string | null 38 | } 39 | 40 | export function DocsSidebarNavItems({ 41 | items, 42 | pathname, 43 | }: DocsSidebarNavItemsProps) { 44 | return items?.length ? ( 45 |
46 | {items.map((item, index) => 47 | !item.disabled && item.href ? ( 48 | 61 | {item.title} 62 | 63 | ) : ( 64 | 68 | {item.title} 69 | 70 | ), 71 | )} 72 |
73 | ) : null 74 | } 75 | -------------------------------------------------------------------------------- /docs/app/components/ui/Toaster.tsx: -------------------------------------------------------------------------------- 1 | 'use client' 2 | 3 | import { 4 | Toast, 5 | ToastClose, 6 | ToastDescription, 7 | ToastProvider, 8 | ToastTitle, 9 | ToastViewport, 10 | } from '@/app/components/ui/toast' 11 | import { useToast } from '@/app/components/ui/use-toast' 12 | 13 | export function Toaster() { 14 | const { toasts } = useToast() 15 | 16 | return ( 17 | 18 | {toasts.map(function ({ id, title, description, action, ...props }) { 19 | return ( 20 | 21 |
22 | {title && {title}} 23 | {description && ( 24 | {description} 25 | )} 26 |
27 | {action} 28 | 29 |
30 | ) 31 | })} 32 | 33 |
34 | ) 35 | } 36 | -------------------------------------------------------------------------------- /docs/app/docs/[[...slug]]/layout.tsx: -------------------------------------------------------------------------------- 1 | import { docsConfig } from '@/config/docs' 2 | import { DocsSidebarNav } from '@/app/components/sidebar-nav' 3 | import But from '@/app/components/docsMenu/But' 4 | 5 | interface DocsLayoutProps { 6 | children: React.ReactNode 7 | } 8 | 9 | export default function DocsLayout({ children }: DocsLayoutProps) { 10 | return ( 11 | <> 12 |
13 | 14 | 17 |
{children}
18 |
19 | 20 | ) 21 | } 22 | -------------------------------------------------------------------------------- /docs/app/examples/page.tsx: -------------------------------------------------------------------------------- 1 | import { siteExampleConfig } from '@/config/site' 2 | import Card from '../components/cards/card' 3 | import type { Metadata } from 'next' 4 | 5 | export const metadata: Metadata = { 6 | title: 'next-sitemap - Examples', 7 | description: 'Examples where next-sitemap has been utilized.', 8 | alternates: { canonical: '/examples' }, 9 | openGraph: { 10 | type: 'website', 11 | locale: 'en_US', 12 | title: siteExampleConfig.name, 13 | description: siteExampleConfig.description, 14 | siteName: siteExampleConfig.name, 15 | }, 16 | twitter: { 17 | card: 'summary_large_image', 18 | title: siteExampleConfig.name, 19 | description: siteExampleConfig.description, 20 | images: [`/examples.jpg`], 21 | creator: '@iamvishnusankar', 22 | }, 23 | } 24 | 25 | // export const runtime = 'edge' 26 | 27 | const page = () => { 28 | return ( 29 | <> 30 |
31 |
32 |
33 | Working on to transfer examples to /app directory. 34 |
35 |

36 | Find your Example 37 |

38 |

39 | List of examples where next-sitemap has been used. 40 |

41 |
42 |
43 | 44 |
45 |
46 | 47 | ) 48 | } 49 | 50 | export default page 51 | -------------------------------------------------------------------------------- /docs/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iamvishnusankar/next-sitemap/0d69597ca5bbfa1db670a711bf5d5a2eb3bd34fe/docs/app/favicon.ico -------------------------------------------------------------------------------- /docs/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import Footer from './components/Footer' 2 | import Providers from './components/Providers' 3 | import '../styles/globals.css' 4 | import { siteConfig } from '@/config/site' 5 | import Navbar from './components/Navbar/Navbar' 6 | import { Toaster } from '@/app/components/ui/Toaster' 7 | import type { Metadata } from 'next' 8 | 9 | export const metadata: Metadata = { 10 | title: 'next-sitemap', 11 | description: 'Sitemap generator for Next.js application.', 12 | metadataBase: new URL(siteConfig.url), 13 | openGraph: { 14 | type: 'website', 15 | locale: 'en_US', 16 | url: siteConfig.url, 17 | title: siteConfig.name, 18 | description: siteConfig.description, 19 | siteName: siteConfig.name, 20 | }, 21 | twitter: { 22 | card: 'summary_large_image', 23 | title: siteConfig.name, 24 | description: siteConfig.description, 25 | images: [`/og.jpg`], 26 | creator: '@iamvishnusankar', 27 | }, 28 | } 29 | 30 | export default function RootLayout({ 31 | children, 32 | }: { 33 | children: React.ReactNode 34 | }) { 35 | return ( 36 | 37 | 38 | 39 | 40 | 41 | {children} 42 |