-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ Add magnetic button 🧲 * 🐛 iframe before effect button * 🚚 move vscode settings to root * ✨ add variants to search * 🔍 add title to website links * 🎨 simplify text effects and improve button imports * ➖ clean up package dependencies * ✨ introduce changelog using mdx * ✨ add brand new UI and new github button component * ✅ Update with new component and new menu
- Loading branch information
1 parent
abbbcd2
commit b9d520e
Showing
35 changed files
with
2,107 additions
and
1,900 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
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
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 |
---|---|---|
@@ -0,0 +1,114 @@ | ||
import { | ||
eachDayOfInterval, | ||
format, | ||
formatDistanceToNow, | ||
formatISO, | ||
parseISO, | ||
} from "date-fns"; | ||
|
||
import { compileMDX, type CompileMDXResult } from "next-mdx-remote/rsc"; | ||
import { promises as fs } from "node:fs"; | ||
import path from "node:path"; | ||
|
||
interface Frontmatter { | ||
title: string; | ||
} | ||
|
||
export default async function ProjectPage() { | ||
const filenames = await fs.readdir( | ||
path.join(process.cwd(), "src/changelogs"), | ||
); | ||
|
||
// const rangeOfAllDays = eachDayOfInterval({ | ||
// start: new Date(2024, 10, 1), // 1st November 2024 (no changelogs before that) | ||
// end: new Date(), // Today | ||
// }); | ||
|
||
const contentMap: { date: Date; content: string }[] = []; | ||
|
||
for (const file of filenames) { | ||
const isoDate = parseISO(file.replace(/\.mdx$/, "")); | ||
// const IsoDate = formatISO(date, { representation: "date" }); | ||
|
||
const filePath = path.join(process.cwd(), `src/changelogs/${file}`); | ||
try { | ||
const content = await fs.readFile(filePath, "utf-8"); | ||
contentMap.push({ date: isoDate, content }); | ||
} catch (error) { | ||
// @ts-ignore | ||
if (error.code === "ENOENT") { | ||
console.log(`No changelog found for ${file}`); | ||
// Continue without throwing the error | ||
} else { | ||
// For other errors, you might still want to handle them | ||
console.error(`Error reading file ${filePath}:`, error); | ||
throw error; // Re-throw if it's a different kind of error | ||
} | ||
} | ||
} | ||
|
||
const finalContentMap: { data: CompileMDXResult<Frontmatter>; date: Date }[] = | ||
[]; | ||
|
||
for (const content of contentMap) { | ||
const data = await compileMDX<Frontmatter>({ | ||
source: content, | ||
options: { | ||
parseFrontmatter: true, | ||
}, | ||
components: { | ||
// Your Components here | ||
}, | ||
}); | ||
finalContentMap.push({ data, date: content.date }); | ||
console.log(data.content); | ||
console.log(data.frontmatter); | ||
} | ||
|
||
const changelogs = await Promise.all( | ||
filenames.map(async (filename) => { | ||
const content = await fs.readFile( | ||
path.join(process.cwd(), "src/changelogs", filename), | ||
"utf-8", | ||
); | ||
const { frontmatter, content: contentMDX } = | ||
await compileMDX<Frontmatter>({ | ||
source: content, | ||
options: { | ||
parseFrontmatter: true, | ||
}, | ||
}); | ||
return { | ||
filename, | ||
filenameWithoutExtension: filename.replace(".mdx", ""), | ||
content: contentMDX, | ||
date: parseISO(filename.replace(".mdx", "")), | ||
...frontmatter, | ||
}; | ||
}), | ||
); | ||
|
||
return ( | ||
<div className="cuicui-default-style"> | ||
<h1>Changelog</h1> | ||
<section className="space-y-12"> | ||
{changelogs.map(({ content, date, title }) => { | ||
return ( | ||
<article | ||
key={date.toISOString()} | ||
className="[&_ul]:text-neutral-600 [&_ul]:dark:text-neutral-400" | ||
> | ||
<h5 className="m-0">{format(date, "do MMMM yyyy")}</h5> | ||
<p className="text-neutral-500 tracking-tight text-sm"> | ||
{formatDistanceToNow(date, { addSuffix: true })} | ||
</p> | ||
<span className=" bg-neutral-400/30 w-full h-px inline-flex m-0" /> | ||
<h4 className="text-2xl">{title}</h4> | ||
{content} | ||
</article> | ||
); | ||
})} | ||
</section> | ||
</div> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
title: New UI, Search and Changelog | ||
--- | ||
|
||
#### New component | ||
|
||
- Magnetic background button and magnetic button | ||
- Markdown component to render markdown content server site and client side easily with next-mdx-remote | ||
- Github Stars Button which now replace the old one on the site | ||
|
||
#### Website modifications | ||
|
||
|
||
##### Brand new design | ||
|
||
With the new Github Star Button and a much cleaner Gradient Container, the website has a new look and feel. The new design is more modern and more aligned with the Cuicui brand. | ||
The badges have also been updated to be more consistent with the new design. | ||
|
||
##### New features | ||
|
||
- Introduce the [changelog](/changelog) page to list most of the changelogs | ||
- Remove the update tags as the changelog page would be the main source of truth | ||
- Add components to search results and redefined the section and categories which would result in a better search experience | ||
|
||
|
||
##### SEO | ||
|
||
- Add title to most of the website links |
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
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
Oops, something went wrong.