Quick Start Guide
This section provides an overview of Quick Start Guide.
Follow these simple instructions to set up your project efficiently and begin creating content without delay!:
Documentation
-
Configure Routing
- Open the
@lib/route-config.ts
file and add your routing pages:export const ROUTES: EachRoute[] = [ // Add new route below { title: "Fundamentals", href: "/fundamentals", noLink: true, // Set to true to prevent routing items: [ // All the sub-sections under `fundamentals` { title: "HTTP Server", href: "/http-server" }, ], }, ];
- Open the
-
Create Content Structure
- Navigate to the
@content/docs
directory and create a folder namedfundamentals
, as defined in theroute-config
file. Within this folder, create a subfolder namedhttp-server
, and inside that, create anindex.mdx
file that will render when you navigate to/fundamentals/http-server
:root ├── content/docs │ └── fundamentals │ └── http-server │ └── index.mdx
- Navigate to the
-
Write Your Markdown Content
- Start writing your markdown content inside the
index.mdx
file. Be sure to include frontmatter at the beginning of the file, which is used for the page title and description:--- title: HTTP Server description: This section is about HTTP Server. --- <!-- Here goes your markdown content -->
- Start writing your markdown content inside the
-
Run Your Application
- Ensure your application is running. Navigate to
http://localhost:3000/docs/fundamentals/http-server
to view your content. You should also see it in the left panel, allowing you to navigate to other pages.
- Ensure your application is running. Navigate to
Blogs
To get started with blogs, follow these steps:
-
Navigate to the
@content/blogs
directory and create a file with a unique name prefixed with.mdx
, then start writing the markdown content inside. -
Make sure to add the following frontmatter to format data for the blogs properly:
--- title: "Building a Recursive File System with React: A Deep Dive" description: "Explore how to create a recursive file system in React. This blog post provides a comprehensive guide on building a file system where folders and files can be nested, added, renamed, and deleted." date: 02-09-2024 authors: - avatar: "https://ui.shadcn.com/avatars/02.png" handle: nisabmohd username: Nisab Mohd handleUrl: "https://github.com/nisabmohd" cover: "https://img.freepik.com/premium-vector/many-monsters-various-colors-doodle-come-bless-birthday-happy_577083-84.jpg?w=826" --- <!-- Your blog markdown content -->
-
Navigate to your local development server at
http://localhost:3000/blog
, where you will see your blog listed and sorted based on date. You can navigate to any blog to read it.
Explore Further
This section serves as your starting point for exploring the application. By following the steps above, you can quickly and easily set up your content. For more customization and control, please refer to the following pages.
LFS Usage Configuration
- Why you need to do this?
By default, Git LFS will append .git/info/lfs to the end of a Git remote url to build the LFS server URL it will use:
Git Remote: https://git-server.com/foo/bar
LFS Server: https://git-server.com/foo/bar.git/info/lfs
Git Remote: https://git-server.com/foo/bar.git
LFS Server: https://git-server.com/foo/bar.git/info/lfs
see more details at LFS doc
Because Mega uses a monorepo with multiple layers of paths, LFS by default appends parameters to the request path. However, Axum’s support for wildcard paths is not sufficiently robust, making it difficult to include wildcards (*)
in nested routes. Adapting wildcard (*)
routes has become a challenging task.
Therefore, we need to manually configure the LFS server’s address so that all requests start from the server’s root route. This simplifies the implementation of this part of the work.
- Configure LFS Server URL for a Specific Repository
Go to your repository folder, set:
git config lfs.url https://git.gitmega.dev
Or manually edit the .git/config file in your repository and add or modify the lfs.url entry:
[remote "origin"]
url = https://git.gitmega.dev/your-repo.git
[lfs]
url = https://git.gitmega.dev
- Set a Global LFS Server URL
To specify a global LFS server URL for all repositories, update your global Git configuration:
git config --global lfs.url https://git.gitmega.dev
Alternatively, directly edit the global configuration file ~/.gitconfig and add:
[lfs]
url = https://git.gitmega.dev
Note:
If you choose to modify the global configuration, remember to remove the global LFS server configuration after testing Mega to ensure that the original SCM LFS service (e.g., GitHub) functions properly.