-
Notifications
You must be signed in to change notification settings - Fork 0
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
100 changed files
with
6,293 additions
and
4,038 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
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 |
---|---|---|
@@ -1,46 +1,46 @@ | ||
import globby from "globby"; | ||
import { MetadataRoute } from "next"; | ||
import globby from 'globby' | ||
import { MetadataRoute } from 'next' | ||
|
||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> { | ||
const pages = await globby([ | ||
"pages/*.tsx", | ||
"pages/*/*.tsx", | ||
"!pages/api", | ||
"!pages/404.tsx", | ||
"!pages/sitemap.ts", | ||
"!pages/_app.tsx", | ||
"!pages/_document.tsx", | ||
"!pages/pdf-to-word.tsx", | ||
"!pages/color-magic.tsx", | ||
]); | ||
const urls: MetadataRoute.Sitemap = []; | ||
'pages/*.tsx', | ||
'pages/*/*.tsx', | ||
'!pages/api', | ||
'!pages/404.tsx', | ||
'!pages/sitemap.ts', | ||
'!pages/_app.tsx', | ||
'!pages/_document.tsx', | ||
'!pages/pdf-to-word.tsx', | ||
'!pages/color-magic.tsx', | ||
]) | ||
const urls: MetadataRoute.Sitemap = [] | ||
pages.map((page) => { | ||
const path = page | ||
.replace("pages", "") | ||
.replace("data", "") | ||
.replace(".tsx", "") | ||
.replace(".mdx", ""); | ||
.replace('pages', '') | ||
.replace('data', '') | ||
.replace('.tsx', '') | ||
.replace('.mdx', '') | ||
|
||
const excludedPaths = [/^\/[^/]*\/index$/]; // Regular expressions to match paths like /blogs/index, /category/index, etc. | ||
const excludedPaths = [/^\/[^/]*\/index$/] // Regular expressions to match paths like /blogs/index, /category/index, etc. | ||
|
||
const isExcluded = excludedPaths.some((regex) => regex.test(path)); | ||
const isExcluded = excludedPaths.some((regex) => regex.test(path)) | ||
|
||
let route = path; | ||
let route = path | ||
|
||
if (path === "/index") { | ||
route = ""; | ||
if (path === '/index') { | ||
route = '' | ||
} else if (isExcluded) { | ||
route = path.replace(/\/index$/, ""); | ||
route = path.replace(/\/index$/, '') | ||
} else { | ||
route = path; | ||
route = path | ||
} | ||
|
||
urls.push({ | ||
url: `https://topological-materials.vercel.app${route}`, | ||
lastModified: new Date(), | ||
}); | ||
return; | ||
}); | ||
}) | ||
return | ||
}) | ||
|
||
return urls; | ||
return urls | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/** @type {import('next-sitemap').IConfig} */ | ||
module.exports = { | ||
siteUrl: process.env.SITE_URL || "https://topological-materials.vercel.app", | ||
siteUrl: process.env.SITE_URL || 'https://topological-materials.vercel.app', | ||
generateRobotsTxt: true, // (optional) | ||
// ...other options | ||
}; | ||
} |
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
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
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 |
---|---|---|
@@ -1,23 +1,25 @@ | ||
import "../src/styles/index.css"; | ||
import { ThemeProvider } from "@/components/common/providers"; | ||
import { Inter } from "next/font/google"; | ||
import { Header } from "@/components/common/Header"; | ||
import { Toaster } from "@/components/ui/toaster"; | ||
import { Meta } from "@/components/meta"; | ||
import { Inter } from 'next/font/google' | ||
|
||
const inter = Inter({ subsets: ["latin"] }); | ||
import { Header } from '@/components/common/Header' | ||
import { ThemeProvider } from '@/components/common/providers' | ||
import { Meta } from '@/components/meta' | ||
import { Toaster } from '@/components/ui/toaster' | ||
|
||
import '../src/styles/index.css' | ||
|
||
const inter = Inter({ subsets: ['latin'] }) | ||
|
||
function MyApp({ Component, pageProps }) { | ||
return ( | ||
<div className={inter.className}> | ||
<Meta /> | ||
<ThemeProvider attribute="class" defaultTheme="system" enableSystem> | ||
<ThemeProvider attribute='class' defaultTheme='system' enableSystem> | ||
<Header /> | ||
<Component {...pageProps} /> | ||
<Toaster /> | ||
</ThemeProvider> | ||
</div> | ||
); | ||
) | ||
} | ||
|
||
export default MyApp; | ||
export default MyApp |
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction | ||
|
||
export default function handler(req, res) { | ||
res.status(200).json({ name: "John Doe" }); | ||
res.status(200).json({ name: 'John Doe' }) | ||
} |
Oops, something went wrong.