mirror of
https://github.com/DeveloLongScript/MHSF.git
synced 2026-05-07 14:54:58 -05:00
chore: adding achievement documentation
along with this, i added brand new `lastUpdated` and `folder` fields for the docs 👀
This commit is contained in:
parent
7059a47ec0
commit
700d1caadc
@ -1,42 +1,54 @@
|
|||||||
import { defineDocumentType, makeSource } from "contentlayer/source-files";
|
import { defineDocumentType, makeSource } from "contentlayer/source-files";
|
||||||
import rehypeSlug from "rehype-slug";
|
import rehypeSlug from "rehype-slug";
|
||||||
import GithubSlugger from "github-slugger"
|
import GithubSlugger from "github-slugger";
|
||||||
|
|
||||||
export const Docs = defineDocumentType(() => ({
|
export const Docs = defineDocumentType(() => ({
|
||||||
name: "Docs",
|
name: "Docs",
|
||||||
filePathPattern: `**/*.mdx`,
|
filePathPattern: `**/*.mdx`,
|
||||||
contentType: "mdx",
|
contentType: "mdx",
|
||||||
fields: {
|
fields: {
|
||||||
title: {
|
title: {
|
||||||
type: "string",
|
type: "string",
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
},
|
folder: {
|
||||||
computedFields: {
|
type: "string",
|
||||||
url: {
|
required: false,
|
||||||
type: "string",
|
},
|
||||||
resolve: (docs) => `/docs/${docs._raw.flattenedPath}`,
|
lastUpdated: {
|
||||||
},
|
type: "string",
|
||||||
toc: {
|
required: false,
|
||||||
type: "json",
|
},
|
||||||
resolve: async (doc) => {
|
},
|
||||||
const headingsRegex = /\n(?<flag>#{1,6})\s+(?<content>.+)/g;
|
computedFields: {
|
||||||
const slugger = new GithubSlugger()
|
url: {
|
||||||
const headings = Array.from(doc.body.raw.matchAll(headingsRegex)).map(
|
type: "string",
|
||||||
({ groups }) => {
|
resolve: (docs) => `/docs/${docs._raw.flattenedPath}`,
|
||||||
const flag = groups?.flag;
|
},
|
||||||
const content = groups?.content;
|
toc: {
|
||||||
return {
|
type: "json",
|
||||||
level: flag.length,
|
resolve: async (doc) => {
|
||||||
text: content,
|
const headingsRegex = /\n(?<flag>#{1,6})\s+(?<content>.+)/g;
|
||||||
slug: content ? slugger.slug(content) : undefined
|
const slugger = new GithubSlugger();
|
||||||
};
|
const headings = Array.from(doc.body.raw.matchAll(headingsRegex)).map(
|
||||||
}
|
({ groups }) => {
|
||||||
);
|
const flag = groups?.flag;
|
||||||
return headings;
|
const content = groups?.content;
|
||||||
},
|
return {
|
||||||
},
|
level: flag.length,
|
||||||
},
|
text: content,
|
||||||
|
slug: content ? slugger.slug(content) : undefined,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
);
|
||||||
|
return headings;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export default makeSource({ contentDirPath: "docs", documentTypes: [Docs], mdx: {rehypePlugins: [rehypeSlug]} });
|
export default makeSource({
|
||||||
|
contentDirPath: "docs",
|
||||||
|
documentTypes: [Docs],
|
||||||
|
mdx: { rehypePlugins: [rehypeSlug] },
|
||||||
|
});
|
||||||
|
|||||||
@ -1,10 +1,34 @@
|
|||||||
---
|
---
|
||||||
title: "Achievement Collection"
|
title: "Achievement Collection"
|
||||||
|
folder: "Advanced"
|
||||||
---
|
---
|
||||||
|
|
||||||
|
import { formalNames } from "@/config/achievements"
|
||||||
|
|
||||||
# Achievements
|
# Achievements
|
||||||
Achievements are a page that every server gets which contains certain requirements which could be embedded in an servers history.
|
Achievements are a page that every server gets which contains certain requirements which could be embedded in an servers history.
|
||||||
|
|
||||||
<Separator/>
|
<Separator/>
|
||||||
|
|
||||||
Achievements are *not* collected instantly, and are actually collected every 12 hours. (this is not timezone dependent) There are currently 5 possible achievements to get, ranging from easiest to hardest.
|
These achievements are accessable using the "Achievements" tab on the left of any server page.
|
||||||
|
Achievements are *not* collected instantly, and are collected every 12 hours when the server is online (this is not timezone dependent).
|
||||||
|
There are currently {Object.keys(formalNames).length} possible achievements to get, ranging from easiest to hardest.
|
||||||
|
|
||||||
|
## 1 thousand favorites achievement
|
||||||
|
After getting 1 thousand favorites on MHSF, and your server is online during the achievement collection, *you will get this achievement showing* when you got **1,000 users to favorite your server**.
|
||||||
|
<AchievementPreview title="has1kFavorites"/>
|
||||||
|
|
||||||
|
## 1 thousand total joins achievement
|
||||||
|
After getting 1 thousand total joins on Minehut, and your server is online during the achievement collection, *you will get this achievement showing* when you got **1,000 users to join your server**.
|
||||||
|
<br/> Here is a preview:
|
||||||
|
<AchievementPreview title="has1kTotalJoins"/>
|
||||||
|
|
||||||
|
## 100 thousand favorites achievement
|
||||||
|
After getting 100 thousand favorites on MHSF, and your server is online during the achievement collection, *you will get this achievement showing* when you got **100 thousand users to favorite your server**.
|
||||||
|
<br/> Here is a preview:
|
||||||
|
<AchievementPreview title="has100kFavorites"/>
|
||||||
|
|
||||||
|
## 1 thousand total joins achievement
|
||||||
|
After getting 100 thousand total joins on Minehut, and your server is online during the achievement collection, *you will get this achievement showing* when you got **100 thousand users to join your server**.
|
||||||
|
<br/> Here is a preview:
|
||||||
|
<AchievementPreview title="has100kTotalJoins"/>
|
||||||
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Using the Command-bar"
|
title: "Using the Command-bar"
|
||||||
|
folder: "Advanced"
|
||||||
---
|
---
|
||||||
|
|
||||||
# Using the Command-bar
|
# Using the Command-bar
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Troubleshooting: Making external servers on Minehut"
|
title: "Troubleshooting: Making external servers on Minehut"
|
||||||
|
folder: "Advanced"
|
||||||
---
|
---
|
||||||
|
|
||||||
# External Servers on Minehut
|
# External Servers on Minehut
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Tech-stack"
|
title: "Tech-stack"
|
||||||
|
folder: "Advanced"
|
||||||
---
|
---
|
||||||
|
|
||||||
# Teck Stack of MHSF
|
# Teck Stack of MHSF
|
||||||
|
|||||||
@ -16,7 +16,7 @@ Wrappers usually communicate using an API that was provided by the service its s
|
|||||||
## Why to use MHSF
|
## Why to use MHSF
|
||||||
|
|
||||||
- **Faster response times** MHSF is completely ad-free, and as a result of being open-source, constantly tries to cut down on unnecessary things slowing down the page.
|
- **Faster response times** MHSF is completely ad-free, and as a result of being open-source, constantly tries to cut down on unnecessary things slowing down the page.
|
||||||
- **Open-source & no tracking** As a result of being open-source, MHSF will never track or sell your to advertisers. Anybody can look at the code, and can be verified to be completely secure.
|
- **Open-source & no tracking** As a result of being open-source, MHSF will never track or sell your data to advertisers. Anybody can look at the code, and can be verified to be completely secure.
|
||||||
- **Make your server stand out** Server owners can configure after appropriate verification banners, Discord widgets, descriptions & color schemes.
|
- **Make your server stand out** Server owners can configure after appropriate verification banners, Discord widgets, descriptions & color schemes.
|
||||||
- **Customize your experience** Filters, sorts & different spacing settings can make your experience just how you like it while you are browsing servers.
|
- **Customize your experience** Filters, sorts & different spacing settings can make your experience just how you like it while you are browsing servers.
|
||||||
- **Better & more intuitive UX/UI** UI is a big point for MHSF, using UI designed to be more user friendly, and to be more straight-forward then Minehut's
|
- **Better & more intuitive UX/UI** UI is a big point for MHSF, using UI designed to be more user friendly, and to be more straight-forward then Minehut's
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Customization"
|
title: "Customization"
|
||||||
|
folder: "Guides"
|
||||||
---
|
---
|
||||||
|
|
||||||
# Customize your server
|
# Customize your server
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Linking your account"
|
title: "Linking your account"
|
||||||
|
folder: "Guides"
|
||||||
---
|
---
|
||||||
|
|
||||||
# Linking your Minecraft account
|
# Linking your Minecraft account
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Own a server"
|
title: "Own a server"
|
||||||
|
folder: "Guides"
|
||||||
---
|
---
|
||||||
|
|
||||||
# Owning a server
|
# Owning a server
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
title: "Reporting a server"
|
title: "Reporting a server"
|
||||||
|
folder: "Guides"
|
||||||
---
|
---
|
||||||
|
|
||||||
# Reporting a server
|
# Reporting a server
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
---
|
---
|
||||||
title: "External Content Agreement"
|
title: "External Content Agreement"
|
||||||
|
folder: "Legal"
|
||||||
|
lastUpdated: "Sep. 10th 2024"
|
||||||
---
|
---
|
||||||
|
|
||||||
# External Content Agreement (ECA)
|
# External Content Agreement (ECA)
|
||||||
|
|||||||
@ -36,6 +36,8 @@ const PostLayout = ({ params }: { params: { slug: string[] } }) => {
|
|||||||
<main className="relative py-6 lg:gap-10 lg:py-8 xl:grid xl:grid-cols-[1fr_300px]">
|
<main className="relative py-6 lg:gap-10 lg:py-8 xl:grid xl:grid-cols-[1fr_300px]">
|
||||||
<div className="mx-auto w-full min-w-0">
|
<div className="mx-auto w-full min-w-0">
|
||||||
<div className="pb-12 pt-8 prose dark:prose-invert">
|
<div className="pb-12 pt-8 prose dark:prose-invert">
|
||||||
|
{doc.folder && <span>{doc.folder}</span>}{" "}
|
||||||
|
{doc.lastUpdated && <span> - last updated {doc.lastUpdated}</span>}{" "}
|
||||||
<MDXContent
|
<MDXContent
|
||||||
components={{
|
components={{
|
||||||
Separator,
|
Separator,
|
||||||
|
|||||||
@ -3,9 +3,9 @@ import type { Achievement } from "@/lib/types/achievement";
|
|||||||
import { useEffectOnce } from "@/lib/useEffectOnce";
|
import { useEffectOnce } from "@/lib/useEffectOnce";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Card, CardContent } from "../ui/card";
|
import { Card, CardContent } from "../ui/card";
|
||||||
import { Medal, Sparkle, Sparkles, Users } from "lucide-react";
|
|
||||||
import { Skeleton } from "../ui/skeleton";
|
import { Skeleton } from "../ui/skeleton";
|
||||||
import A from "../misc/Link";
|
import A from "../misc/Link";
|
||||||
|
import { formalNames } from "@/config/achievements";
|
||||||
|
|
||||||
export default function AchievementList({ server }: { server: string }) {
|
export default function AchievementList({ server }: { server: string }) {
|
||||||
const [achievements, setAchievements] = useState<
|
const [achievements, setAchievements] = useState<
|
||||||
@ -79,44 +79,7 @@ export default function AchievementList({ server }: { server: string }) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const formalNames = {
|
|
||||||
mostJoined: {
|
|
||||||
title:
|
|
||||||
"At one time, <b>this server had the most players on the platform!</b>",
|
|
||||||
description:
|
|
||||||
"This is awarded to servers that had the number 1 permission at the time of the achievements getting resolved.",
|
|
||||||
color: "#9aedff",
|
|
||||||
icon: Medal,
|
|
||||||
},
|
|
||||||
has1kFavorites: {
|
|
||||||
title: "This server has more than <b>1,000 favorites on MHSF!</b>",
|
|
||||||
description:
|
|
||||||
"This is awarded to servers that had 1,000 favorites at the time of the achievements getting resolved.",
|
|
||||||
color: "#d064ff",
|
|
||||||
icon: Sparkle,
|
|
||||||
},
|
|
||||||
has1kTotalJoins: {
|
|
||||||
title: "This server has more than <b>1,000 total joins on Minehut!</b>",
|
|
||||||
description:
|
|
||||||
"This is awarded to servers that had 1,000 total joins at the time of the achievements getting resolved.",
|
|
||||||
color: "#aefa1f",
|
|
||||||
icon: Users,
|
|
||||||
},
|
|
||||||
has100kFavorites: {
|
|
||||||
title: "This server has more than <b>100,000 favorites on MHSF!</b>",
|
|
||||||
description:
|
|
||||||
"This is awarded to servers that had 100,000 favorites at the time of the achievements getting resolved.",
|
|
||||||
color: "#fa5b07",
|
|
||||||
icon: Sparkles,
|
|
||||||
},
|
|
||||||
has100kTotalJoins: {
|
|
||||||
title: "This server has more than <b>100,000 total joins on Minehut!</b>",
|
|
||||||
description:
|
|
||||||
"This is awarded to servers that had 100,000 total joins at the time of the achievements getting resolved.",
|
|
||||||
color: "#bdcffa",
|
|
||||||
icon: Users,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
type WithInterval<K> = K & {
|
type WithInterval<K> = K & {
|
||||||
interval: number;
|
interval: number;
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import { Book, ExternalLink, NotebookText } from "lucide-react";
|
import { Book, ExternalLink, NotebookText } from "lucide-react";
|
||||||
import type { SVGProps } from "react";
|
import type { SVGProps } from "react";
|
||||||
|
import { Card, CardContent } from "../ui/card";
|
||||||
|
import { formalNames } from "@/config/achievements";
|
||||||
|
|
||||||
type MDXElementType = {
|
type MDXElementType = {
|
||||||
[key: string]: (props: any) => JSX.Element;
|
[key: string]: (props: any) => JSX.Element;
|
||||||
@ -21,9 +23,40 @@ const Discord = (props: SVGProps<SVGSVGElement>) => (
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
|
function AchievementPreview({ title }: { title: string }) {
|
||||||
|
const Icon = formalNames[title].icon;
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<Card>
|
||||||
|
<CardContent className="pt-4">
|
||||||
|
<span
|
||||||
|
className="flex items-center"
|
||||||
|
style={{ color: formalNames[title].color }}
|
||||||
|
>
|
||||||
|
<Icon size={16} className="mr-2" />
|
||||||
|
<span
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: formalNames[title].title,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
|
<p>{formalNames[title].description}</p>
|
||||||
|
<span className="text-sm text-muted-foreground">
|
||||||
|
Achieved on {new Date().getMonth()}/{new Date().getDate()}/
|
||||||
|
{new Date().getFullYear()}{" "}
|
||||||
|
<span className="text-muted-foreground/70">
|
||||||
|
{new Date().toLocaleTimeString()}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export const MDXElements: MDXElementType = {
|
export const MDXElements: MDXElementType = {
|
||||||
Discord,
|
Discord,
|
||||||
|
AchievementPreview,
|
||||||
Book: (props) => <Book {...props} />,
|
Book: (props) => <Book {...props} />,
|
||||||
Notebook: (props) => <NotebookText {...props} />,
|
Notebook: (props) => <NotebookText {...props} />,
|
||||||
ExternalLink: (props) => <ExternalLink {...props} />,
|
ExternalLink: (props) => <ExternalLink {...props} />,
|
||||||
|
|||||||
57
src/config/achievements.ts
Normal file
57
src/config/achievements.ts
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import {
|
||||||
|
type LucideProps,
|
||||||
|
Medal,
|
||||||
|
Sparkle,
|
||||||
|
Sparkles,
|
||||||
|
Users,
|
||||||
|
} from "lucide-react";
|
||||||
|
import type { ForwardRefExoticComponent, RefAttributes } from "react";
|
||||||
|
|
||||||
|
export const formalNames: FormalNames = {
|
||||||
|
mostJoined: {
|
||||||
|
title:
|
||||||
|
"At one time, <b>this server had the most players on the platform!</b>",
|
||||||
|
description:
|
||||||
|
"This is awarded to servers that had the number 1 permission at the time of the achievements getting resolved.",
|
||||||
|
color: "#9aedff",
|
||||||
|
icon: Medal,
|
||||||
|
},
|
||||||
|
has1kFavorites: {
|
||||||
|
title: "This server has more than <b>1,000 favorites on MHSF!</b>",
|
||||||
|
description:
|
||||||
|
"This is awarded to servers that had 1,000 favorites at the time of the achievements getting resolved.",
|
||||||
|
color: "#d064ff",
|
||||||
|
icon: Sparkle,
|
||||||
|
},
|
||||||
|
has1kTotalJoins: {
|
||||||
|
title: "This server has more than <b>1,000 total joins on Minehut!</b>",
|
||||||
|
description:
|
||||||
|
"This is awarded to servers that had 1,000 total joins at the time of the achievements getting resolved.",
|
||||||
|
color: "#aefa1f",
|
||||||
|
icon: Users,
|
||||||
|
},
|
||||||
|
has100kFavorites: {
|
||||||
|
title: "This server has more than <b>100,000 favorites on MHSF!</b>",
|
||||||
|
description:
|
||||||
|
"This is awarded to servers that had 100,000 favorites at the time of the achievements getting resolved.",
|
||||||
|
color: "#fa5b07",
|
||||||
|
icon: Sparkles,
|
||||||
|
},
|
||||||
|
has100kTotalJoins: {
|
||||||
|
title: "This server has more than <b>100,000 total joins on Minehut!</b>",
|
||||||
|
description:
|
||||||
|
"This is awarded to servers that had 100,000 total joins at the time of the achievements getting resolved.",
|
||||||
|
color: "#bdcffa",
|
||||||
|
icon: Users,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
interface FormalNames {
|
||||||
|
[key: string]: {
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
color: string;
|
||||||
|
icon: ForwardRefExoticComponent<
|
||||||
|
Omit<LucideProps, "ref"> & RefAttributes<SVGSVGElement>
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user