Skip to content

Commit

Permalink
feat(docs): remove default nx landing page and make docs homepage bas…
Browse files Browse the repository at this point in the history
…e route
  • Loading branch information
MFarabi619 authored and HasithDeAlwis committed Oct 18, 2024
1 parent 92bcc08 commit 6806ce6
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 1,024 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export default async function Page({
}

const MDX = page.data.exports.default
const path = `src/content/docs/${page.file.path}`
const path = `src/content/(docs)/${page.file.path}`
const gitHubRepoUrl = packageJson.repository.url.replace(/\.git$/, '') // Remove .git suffix

const footer = (
<>
<a
href={`${gitHubRepoUrl}/blob/main/apps/docs/${path}`}
href={`${gitHubRepoUrl}/blob/main/apps/(docs)/${path}`}
target="_blank"
rel="noreferrer noopener"
className="inline-flex items-center justify-center rounded-md font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border bg-fd-secondary text-fd-secondary-foreground hover:bg-fd-secondary/80 h-9 px-3 text-xs gap-1.5"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const baseOptions: HomeLayoutProps = {
<span className="text-lg font-bold">cuHacking DevDocs</span>
</>
),
url: '/docs',
url: '/',
},
githubUrl: 'https://github.com/cuhacking/hackathon',
links: [
Expand Down Expand Up @@ -83,7 +83,7 @@ export const docsOptions: DocsLayoutProps = {
options={pages.map(page => ({
title: page.title,
description: page.description,
url: `/docs/${page.url}`,
url: `/${page.url}`,
icon: (
<page.icon
className="size-9 shrink-0 rounded-md bg-gradient-to-t from-background/80 p-1.5"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const pages = [
]

export const { getPage, getPages, pageTree } = loader({
baseUrl: '/docs',
baseUrl: '/',
rootDir: 'docs',
icon(icon) {
if (!icon) {
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createSearchAPI } from 'fumadocs-core/search/server'
import { getPages } from '../../../app/docs/source'
import { getPages } from '../../../app/(docs)/source'

export const { GET } = createSearchAPI('advanced', {
indexes: getPages().map(page => ({
Expand Down
Loading

0 comments on commit 6806ce6

Please sign in to comment.