Skip to content

Commit 646292d

Browse files
committed
Change main routes for google indexing
1 parent ba2abfc commit 646292d

File tree

8 files changed

+208
-83
lines changed

8 files changed

+208
-83
lines changed

app/categories/page.tsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
"use client";
2+
3+
import { Grid2, useMediaQuery, useTheme } from "@mui/material";
4+
import { CreateCategoryButton, CategoriesList } from "@/components/categories";
5+
import { SearchInput } from "@/components/inputs";
6+
import { MainLayout } from "@/components/MainLayout";
7+
import { FiltersModal } from "@/components/modals";
8+
import { CATEGORY_TYPE } from "@/types";
9+
import { useGetLabels } from "@/api";
10+
11+
const Categories = () => {
12+
const theme = useTheme();
13+
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
14+
useGetLabels({ labelType: CATEGORY_TYPE });
15+
16+
return (
17+
<MainLayout title="Categories">
18+
<Grid2
19+
container
20+
justifyContent="space-between"
21+
direction={{ xs: "column-reverse", sm: "row" }}
22+
alignItems="center"
23+
gap={2}
24+
flexWrap="nowrap"
25+
>
26+
<CreateCategoryButton fullWidth={isMobile} />
27+
28+
<Grid2
29+
container
30+
alignItems="center"
31+
gap={2}
32+
ml={{ xs: 0, sm: "auto" }}
33+
flexWrap="nowrap"
34+
width={{ xs: "100%", sm: "auto" }}
35+
>
36+
<SearchInput />
37+
38+
<FiltersModal labelType={CATEGORY_TYPE} />
39+
</Grid2>
40+
</Grid2>
41+
42+
<CategoriesList />
43+
</MainLayout>
44+
);
45+
};
46+
47+
export default Categories;

app/login/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { useState } from "react";
88
import { Button, Form, TextInput, Link } from "@/components";
99
import { FieldValues } from "react-hook-form";
1010
import { useSnackbar } from "notistack";
11+
import { CATEGORIES_ROUTE } from "@/types";
1112

1213
const schema = z.object({
1314
email: z
@@ -21,7 +22,7 @@ const Login = () => {
2122
const [isLoading, setIsLoading] = useState(false);
2223
const { enqueueSnackbar } = useSnackbar();
2324
const searchParams = useSearchParams();
24-
const callbackUrl = searchParams.get("callbackUrl") || "/";
25+
const callbackUrl = searchParams.get("callbackUrl") || CATEGORIES_ROUTE;
2526

2627
const onSubmit = async (data: FieldValues) => {
2728
setIsLoading(true);
@@ -35,7 +36,7 @@ const Login = () => {
3536
if (res?.error) {
3637
enqueueSnackbar(`${res?.error}`, { variant: "error" });
3738
} else {
38-
window.location.assign("/");
39+
window.location.assign(CATEGORIES_ROUTE);
3940
}
4041
} catch (err) {
4142
enqueueSnackbar(`${err}`, { variant: "error" });

app/page.tsx

Lines changed: 148 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,158 @@
1-
"use client";
1+
import { Metadata } from "next";
2+
import { Container, Typography, List, ListItem, Box } from "@mui/material";
3+
import { Button } from "@/components/buttons";
4+
import Link from "next/link";
5+
import Image from "next/legacy/image";
6+
import { CATEGORIES_ROUTE } from "@/types";
7+
import { authConfig } from "@/configs";
8+
import { getServerSession } from "next-auth";
29

3-
import { Grid2, useMediaQuery, useTheme } from "@mui/material";
4-
import { CreateCategoryButton, CategoriesList } from "@/components/categories";
5-
import { SearchInput } from "@/components/inputs";
6-
import { MainLayout } from "@/components/MainLayout";
7-
import { FiltersModal } from "@/components/modals";
8-
import { CATEGORY_TYPE } from "@/types";
9-
import { useGetLabels } from "@/api";
10+
export const metadata: Metadata = {
11+
title: "About My Lib - Your Personal Code Library",
12+
description:
13+
"My Lib is a simple and efficient way to store, organize, and reuse code snippets, scripts, configurations, and more. Create your own personal library with frontend, backend, and any programming languages.",
14+
robots: "index, follow",
15+
};
1016

11-
const Home = () => {
12-
const theme = useTheme();
13-
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
14-
useGetLabels({ labelType: CATEGORY_TYPE });
17+
const LandingPage = async () => {
18+
const session = await getServerSession(authConfig);
19+
const userId = session?.user?.id;
1520

1621
return (
17-
<MainLayout title="Categories">
18-
<Grid2
19-
container
20-
justifyContent="space-between"
21-
direction={{ xs: "column-reverse", sm: "row" }}
22-
alignItems="center"
23-
gap={2}
24-
flexWrap="nowrap"
25-
>
26-
<CreateCategoryButton fullWidth={isMobile} />
27-
28-
<Grid2
29-
container
30-
alignItems="center"
31-
gap={2}
32-
ml={{ xs: 0, sm: "auto" }}
33-
flexWrap="nowrap"
34-
width={{ xs: "100%", sm: "auto" }}
22+
<Container maxWidth="lg" sx={{ py: 8 }}>
23+
<Typography component="h1" variant="h2" my={3} textAlign="center">
24+
My Lib: Your Universal Code & Knowledge Organizer for IT Professionals
25+
</Typography>
26+
27+
<Typography fontSize={18}>
28+
My Lib is an intuitive platform built for developers, DevOps engineers,
29+
IT specialists, and anyone working with code or technical information.
30+
More than just a snippet manager, it’s a versatile workspace to organize
31+
your knowledge
32+
</Typography>
33+
34+
<Box display="flex" gap={3} justifyContent="center" my={5}>
35+
{userId ? (
36+
<Button
37+
size="large"
38+
variant="contained"
39+
href={CATEGORIES_ROUTE}
40+
component={Link}
41+
sx={{ width: "20%", height: 40 }}
42+
>
43+
Continue
44+
</Button>
45+
) : (
46+
<Button
47+
size="large"
48+
variant="contained"
49+
href="/login"
50+
component={Link}
51+
sx={{ width: "20%", height: 40 }}
52+
>
53+
Sign in
54+
</Button>
55+
)}
56+
</Box>
57+
58+
<Typography variant="h2" my={3} textAlign="center">
59+
What Makes My Lib Indispensable?
60+
</Typography>
61+
62+
<Typography fontSize={18} mb={2}>
63+
🚀 Build Your Personal Code Library Save code snippets in any language
64+
(JavaScript, Python, Go, SQL, etc.) for frontend, backend, mobile
65+
development, or automation tasks. The built-in code editor with syntax
66+
highlighting ensures a seamless coding experience.
67+
</Typography>
68+
69+
<Typography fontSize={18} mb={2}>
70+
📂 Organize Beyond Code Store server configurations, instructions,
71+
documentation, checklists, bookmarks, and even images. The rich text
72+
editor lets you format content, add tables, lists, and embed media.
73+
</Typography>
74+
75+
<Typography fontSize={18} mb={2}>
76+
🏷️ Instant Access with Categories & Labels Sort data into customizable
77+
categories and apply labels for precise filtering. Examples: “Docker
78+
Configs, “React Hooks, “SQL Templates.
79+
</Typography>
80+
81+
<Typography fontSize={18}>
82+
🔍 Find Anything in Seconds Search by category names, labels, or content
83+
within code items—no more digging through messy folders, old projects,
84+
or dozens of repositories. Stop wasting time scrolling through forums or
85+
GitHub to rediscover solutions you’ve already used. With My Lib, every
86+
piece of code, configuration, or knowledge you’ve saved is just a quick
87+
search away.
88+
</Typography>
89+
90+
<Box display={{ xs: "none", md: "block" }}>
91+
<Typography component="h3" variant="h2" my={5} textAlign="center">
92+
Example of usage:
93+
</Typography>
94+
95+
<Typography variant="h4" mb={2}>
96+
Home page with categories:
97+
</Typography>
98+
99+
<Box height={560} width={1} position="relative" overflow="hidden">
100+
<Image
101+
src="/about/categories.png"
102+
alt="Categories example"
103+
objectFit="contain"
104+
layout="fill"
105+
quality={100}
106+
/>
107+
</Box>
108+
109+
<Typography variant="h4" my={2}>
110+
Code items inside category:
111+
</Typography>
112+
113+
<Box
114+
height={560}
115+
width={1}
116+
position="relative"
117+
mt={2}
118+
overflow="hidden"
35119
>
36-
<SearchInput />
120+
<Image
121+
src="/about/code-items-styles.png"
122+
alt="Code items example"
123+
objectFit="contain"
124+
layout="fill"
125+
quality={100}
126+
/>
127+
</Box>
128+
</Box>
37129

38-
<FiltersModal labelType={CATEGORY_TYPE} />
39-
</Grid2>
40-
</Grid2>
130+
<Typography component="h4" variant="h2" my={3} textAlign="center">
131+
Key Features
132+
</Typography>
41133

42-
<CategoriesList />
43-
</MainLayout>
134+
<List sx={{ fontSize: 18 }}>
135+
<ListItem>
136+
Create custom categories like Components, Configs, Helpers, Styles.
137+
</ListItem>
138+
<ListItem>
139+
Assign labels (e.g., FE, BE, env, MUI) for easy filtering.
140+
</ListItem>
141+
<ListItem>Search categories by name for quick access.</ListItem>
142+
<ListItem>
143+
Add rich descriptions with a powerful editor supporting text
144+
formatting, code snippets, images, links, and more.
145+
</ListItem>
146+
<ListItem>
147+
Use Monaco Editor for syntax highlighting and better coding
148+
experience.
149+
</ListItem>
150+
<ListItem>
151+
Fast filter and search code items by tags and names.
152+
</ListItem>
153+
</List>
154+
</Container>
44155
);
45156
};
46157

47-
export default Home;
158+
export default LandingPage;

app/registration/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Button, Form, TextInput, Link } from "@/components";
77
import { fetchService } from "@/services";
88
import { useSnackbar } from "notistack";
99
import { signIn } from "next-auth/react";
10+
import { CATEGORIES_ROUTE } from "@/types";
1011

1112
const schema = z
1213
.object({
@@ -47,7 +48,7 @@ const Registration = () => {
4748
});
4849

4950
if (!result?.error && result?.status === 200) {
50-
window.location.assign("/");
51+
window.location.assign(CATEGORIES_ROUTE);
5152

5253
enqueueSnackbar("Sign up successful. Welcome to My lib", {
5354
variant: "success",

components/Header.tsx

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,12 @@ import {
1717
} from "@mui/material";
1818
import { useGetUser } from "@/hooks";
1919
import { useColorMode } from "@/providers";
20-
import { usePathname } from "next/navigation";
21-
import { ABOUT_PAGE_ROUTE } from "@/types";
20+
import { CATEGORIES_ROUTE } from "@/types";
2221

2322
export const Header = () => {
2423
const { userName, userImage, userId, userEmail } = useGetUser();
2524
const [anchorElUser, setAnchorElUser] = useState<null | HTMLElement>(null);
2625
const { theme, toggleTheme } = useColorMode();
27-
const pathName = usePathname();
28-
const isAboutPage = pathName === ABOUT_PAGE_ROUTE;
2926

3027
const onOpenUserMenu = (event: MouseEvent<HTMLElement>) => {
3128
setAnchorElUser(event.currentTarget);
@@ -50,7 +47,7 @@ export const Header = () => {
5047
variant="h6"
5148
noWrap
5249
component={Link}
53-
href="/"
50+
href={userId ? CATEGORIES_ROUTE : "/"}
5451
color="primary"
5552
sx={{
5653
display: "flex",
@@ -103,7 +100,7 @@ export const Header = () => {
103100
<Typography
104101
component={Link}
105102
width={1}
106-
href={ABOUT_PAGE_ROUTE}
103+
href="/"
107104
color="primary"
108105
>
109106
About
@@ -118,19 +115,6 @@ export const Header = () => {
118115
</Menu>
119116
</Box>
120117
)}
121-
122-
{!userId && !isAboutPage && (
123-
<Box sx={{ flexGrow: 0 }}>
124-
<Typography
125-
component={Link}
126-
width={1}
127-
href={ABOUT_PAGE_ROUTE}
128-
color="primary"
129-
>
130-
About
131-
</Typography>
132-
</Box>
133-
)}
134118
</Toolbar>
135119
</Container>
136120
</AppBar>

middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export { default } from "next-auth/middleware";
22

33
export const config = {
4-
matcher: ["/", "/code-items/:path*"],
4+
matcher: ["/categories", "/code-items/:path*"],
55
};

next-sitemap.config.js

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,14 @@ module.exports = {
33
siteUrl: "https://my-lib-pro.netlify.app",
44
generateRobotsTxt: true,
55
outDir: "./public",
6-
exclude: ["/", "/code-items*", "/login", "/registration"],
6+
exclude: ["/categories", "/code-items*", "/login", "/registration"],
77
robotsTxtOptions: {
88
policies: [
99
{
1010
userAgent: "*",
11-
allow: "/about",
12-
disallow: ["/", "/code-items*", "/login", "/registration"],
11+
allow: "/",
12+
disallow: ["/categories", "/code-items*", "/login", "/registration"],
1313
},
1414
],
1515
},
16-
17-
transform: async (config, path) => {
18-
const defaultEntry = {
19-
loc: path,
20-
changefreq: "monthly",
21-
priority: 0.5,
22-
lastmod: new Date().toISOString(),
23-
};
24-
25-
if (path === "/about") {
26-
return {
27-
...defaultEntry,
28-
changefreq: "monthly",
29-
priority: 0.9,
30-
};
31-
}
32-
33-
return defaultEntry;
34-
},
3516
};

types/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ export const LIGHT_TEXT = "light-text";
1919
export const DARK_TEXT = "dark-text";
2020

2121
// Routes
22-
export const ABOUT_PAGE_ROUTE = "/about";
22+
export const CATEGORIES_ROUTE = "/categories";

0 commit comments

Comments
 (0)