Skip to content

Commit

Permalink
Merge pull request #22 from bryan308/migrate-fumadocsv14
Browse files Browse the repository at this point in the history
Migrate fumadocsv14
  • Loading branch information
bryan308 authored Nov 23, 2024
2 parents 6e3c47a + 5984c58 commit 5700062
Show file tree
Hide file tree
Showing 85 changed files with 6,739 additions and 9,660 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next/core-web-vitals", "next/typescript"]
}
40 changes: 12 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
# deps
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage
# generated content
.contentlayer
.content-collections
.source

# next.js
# test & build
/coverage
/.next/
/out/

# production
/build
*.tsbuildinfo

# misc
.DS_Store
*.pem

# debug
/.pnp
.pnp.js
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
# others
.env*.local
.env

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# content collections
.content-collections
.source

# Contentlayer
.contentlayer
next-env.d.ts
182 changes: 0 additions & 182 deletions CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Introduction
# ca-resources

Welcome to **CA Resources**!
This is a Next.js application generated with
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).

It is a website designed to improve productivity, especially for web development, among other fields in education. It provides the most valuable resources and guides.
Run development server:

```bash
npm run dev
# or
pnpm dev
# or
yarn dev
```

Open http://localhost:3000 with your browser to see the result.

## Learn More

To learn more about Next.js and Fumadocs, take a look at the following
resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
- [Fumadocs](https://fumadocs.vercel.app) - learn about Fumadocs
14 changes: 9 additions & 5 deletions app/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import type { ReactNode } from "react"
import { HomeLayout } from "fumadocs-ui/home-layout"
import { baseOptions } from "../layout.config"
import type { ReactNode } from 'react';
import { HomeLayout } from 'fumadocs-ui/layouts/home';
import { baseOptions } from '@/app/layout.config';

export default function Layout({ children }: { children: ReactNode }): React.ReactElement {
return <HomeLayout {...baseOptions}>{children}</HomeLayout>
export default function Layout({
children,
}: {
children: ReactNode;
}): React.ReactElement {
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
}
2 changes: 1 addition & 1 deletion app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function HomePage() {
numSquares={50}
maxOpacity={0.1}
duration={2}
repeatDelay={1}
repeatdelay={1}
className={cn(
"[mask-image:radial-gradient(500px_circle_at_center,white,transparent)]",
"inset-x-0 inset-y-[-30%] h-[200%] skew-y-12"
Expand Down
41 changes: 3 additions & 38 deletions app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,4 @@
import { guides } from "@/app/source"
// import { resourcesData } from "@/data/resources"
import { createSearchAPI } from "fumadocs-core/search/server"
import { guides } from "@/lib/source"
import { createFromSource } from "fumadocs-core/search/server"

export const { GET } = createSearchAPI("advanced", {
indexes: guides.getPages().map((page) => ({
title: page.data.title,
structuredData: page.data.structuredData,
id: page.url,
url: page.url,
})),
})

// TODO include resources in search
// const resourcePages = Object.keys(resourcesData).flatMap((key) =>
// resourcesData[key].resourcesList.map((resource) => ({
// title: resource.title,
// structuredData: resource.structuredData,
// id: resource.title.toLowerCase().replace(/\s+/g, "-"),
// url: resource.links.map((link) => link.url).join(","),
// }))
// )

// export const { GET } = createSearchAPI("advanced", {
// indexes: [
// ...guides.getPages().map((page) => ({
// title: page.data.title,
// structuredData: page.data.structuredData, // Guides have structuredData
// id: page.url,
// url: page.url,
// })),
// ...resourcePages.map((resource) => ({
// title: resource.title,
// structuredData: resource.structuredData, // Resources now have structuredData
// id: resource.id,
// url: resource.url,
// })),
// ],
// })
export const { GET } = createFromSource(guides)
Loading

0 comments on commit 5700062

Please sign in to comment.