Skip to content

Commit

Permalink
Merge pull request #52 from LakshayGMZ/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
martian0x80 authored Jun 24, 2024
2 parents 49e0f35 + efdca13 commit 63f5344
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
22 changes: 17 additions & 5 deletions app/(endpoints)/ranklist/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,40 @@ import { RanklistSelectDataFields, StudentResults } from "@/types/types";
import { getResult } from "@/app/lib/dataFetchServer";
import { Metadata, ResolvingMetadata } from "next";

function removePageQueryParam(params: RanklistSelectDataFields) {
let u = new URL("https://www.ipusenpai.in/ranklist");
const { page, pageSize, ...rest } = params;
let key: keyof typeof rest;
for (key in rest) {
if (key.toString() !== "pageSize" && key.toString() !== "page") {
u.searchParams.append(key, rest[key]);
}
}
return u.toString();
}

export const runtime = "edge";

export async function generateMetadata(
{ searchParams: params }: any,
parent: ResolvingMetadata,
): Promise<Metadata> {
console.log(params);
return {
title: `Ranklist | IPU Senpai | ${params.programme} |
Semester ${params.semester} | ${params.institute}`,
title: `Ranklist | IPU Senpai | ${params.programme !== undefined ? params.programme + " | " : ""}${params.semester !== undefined ? "Semester " + params.semester + " | " : ""}${params.institute || ""}`,
description:
"Student ranklist. Ranklist of students based on their GPA, percentage, marks, credit marks, etc.",
keywords:
"ipu, ranklist, ggsipu, ipuranklist, open source, btech, bba, cse, it, gpa, sgpa, percentage, marks, results, ipu results",

openGraph: {
title: `Ranklist | IPU Senpai | ${params.programme} |
Semester ${params.semester} | ${params.specialization} | ${params.institute}`,
title: `Ranklist | IPU Senpai | ${params.programme !== undefined ? params.programme + " | " : ""}${params.semester !== undefined ? "Semester " + params.semester + " | " : ""}${params.institute || ""}`,
description:
"Student ranklist. Ranklist of students based on their GPA, percentage, marks, credit marks, etc.",
url: "https://www.ipusenpai.in/ranklist",
},
alternates: {
canonical: removePageQueryParam(params),
},
};
}

Expand Down
1 change: 0 additions & 1 deletion components/search/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export function StudentSubjectDropDown({
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-56">
<DropdownMenuSeparator />
<DropdownMenuRadioGroup value={position} onValueChange={setPosition}>
<DropdownMenuRadioItem value="Student by Name">
Student by Name
Expand Down
4 changes: 2 additions & 2 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://www.ipusenpai.in/manifest.webmanifest</loc><lastmod>2024-06-15T18:08:05.265Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.ipusenpai.in/server-sitemap.xml</loc><lastmod>2024-06-15T18:08:05.265Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.ipusenpai.in/manifest.webmanifest</loc><lastmod>2024-06-24T10:20:32.802Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://www.ipusenpai.in/server-sitemap.xml</loc><lastmod>2024-06-24T10:20:32.805Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>

0 comments on commit 63f5344

Please sign in to comment.