Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions apps/docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# deps
/node_modules

# generated content
.contentlayer
.content-collections
.source

# test & build
/coverage
/.next/
/out/
/build
*.tsbuildinfo

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

# others
.env*.local
.vercel
next-env.d.ts
1 change: 1 addition & 0 deletions apps/docs/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20
45 changes: 45 additions & 0 deletions apps/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# docs

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

Run development server:

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

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

## Explore

In the project, you can see:

- `lib/source.ts`: Code for content source adapter, [`loader()`](https://fumadocs.dev/docs/headless/source-api) provides the interface to access your content.
- `app/layout.config.tsx`: Shared options for layouts, optional but preferred to keep.

| Route | Description |
| ------------------------- | ------------------------------------------------------ |
| `app/(home)` | The route group for your landing page and other pages. |
| `app/docs` | The documentation layout and pages. |
| `app/api/search/route.ts` | The Route Handler for search. |

### Fumadocs MDX

A `source.config.ts` config file has been included, you can customise different options like frontmatter schema.

Read the [Introduction](https://fumadocs.dev/docs/mdx) for further details.

## 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
31 changes: 31 additions & 0 deletions apps/docs/app/(home)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { baseOptions } from "@/app/layout.config";
import { HomeLayout } from "fumadocs-ui/layouts/home";
import type { ReactNode } from "react";

export default function Layout({ children }: { children: ReactNode }) {
return (
<HomeLayout
{...baseOptions}
links={[
{
text: "Documentation",
url: "/docs",
},
{
text: "Zapier",
url: "https://changes.page/integrations/zapier",
},
{
text: "GitHub",
url: "https://github.com/techulus/changes-page",
},
{
text: "Support",
url: "https://changes.page/support",
},
]}
>
{children}
</HomeLayout>
);
}
21 changes: 21 additions & 0 deletions apps/docs/app/(home)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Link from "next/link";

export default function HomePage() {
return (
<main className="flex flex-1 flex-col justify-center text-center">
<h1 className="mb-4 text-2xl font-bold">
Changelogs made smarter, faster, and user-focused.
</h1>
<p className="text-fd-muted-foreground">
You can open{" "}
<Link
href="/docs"
className="text-fd-foreground font-semibold underline"
>
/docs
</Link>{" "}
and see the documentation.
</p>
</main>
);
}
4 changes: 4 additions & 0 deletions apps/docs/app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { source } from "@/lib/source";
import { createFromSource } from "fumadocs-core/search/server";

export const { GET } = createFromSource(source);
52 changes: 52 additions & 0 deletions apps/docs/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { source } from "@/lib/source";
import {
DocsPage,
DocsBody,
DocsDescription,
DocsTitle,
} from "fumadocs-ui/page";
import { notFound } from "next/navigation";
import { createRelativeLink } from "fumadocs-ui/mdx";
import { getMDXComponents } from "@/mdx-components";

export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

const MDXContent = page.data.body;

return (
<DocsPage toc={page.data.toc} full={page.data.full}>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDXContent
components={getMDXComponents({
// this allows you to link to other pages with relative file paths
a: createRelativeLink(source, page),
})}
/>
</DocsBody>
</DocsPage>
);
}

export async function generateStaticParams() {
return source.generateParams();
}

export async function generateMetadata(props: {
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

return {
title: page.data.title,
description: page.data.description,
};
}
12 changes: 12 additions & 0 deletions apps/docs/app/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { DocsLayout } from "fumadocs-ui/layouts/docs";
import type { ReactNode } from "react";
import { baseOptions } from "@/app/layout.config";
import { source } from "@/lib/source";

export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout tree={source.pageTree} {...baseOptions}>
{children}
</DocsLayout>
);
}
3 changes: 3 additions & 0 deletions apps/docs/app/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import "tailwindcss";
@import "fumadocs-ui/css/catppuccin.css";
@import "fumadocs-ui/css/preset.css";
25 changes: 25 additions & 0 deletions apps/docs/app/layout.config.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
import Image from "next/image";

/**
* Shared layout configurations
*
* you can customise layouts individually from:
* Home Layout: app/(home)/layout.tsx
* Docs Layout: app/docs/layout.tsx
*/
export const baseOptions: BaseLayoutProps = {
nav: {
title: (
<>
<Image
src="https://changes.page/images/logo.png"
alt="Logo"
width={24}
height={24}
/>
changes.page
</>
),
},
};
18 changes: 18 additions & 0 deletions apps/docs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RootProvider } from "fumadocs-ui/provider";
import { Geist } from "next/font/google";
import type { ReactNode } from "react";
import "./global.css";

const geist = Geist({
subsets: ["latin"],
});

export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" className={geist.className} suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}
23 changes: 23 additions & 0 deletions apps/docs/content/docs/SEO-and-Feeds/feed.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Feed
---

### RSS Feed

All pages have a RSS feed that can be used to subscribe to the page.

```text title="RSS Feed"
GET https://yourpage.changes.page/rss.xml
```

<Callout>Example: https://hey.changes.page/rss.xml</Callout>

### Atom Feed

All pages have a Atom feed that can be used to subscribe to the page.

```text title="Atom Feed"
GET https://yourpage.changes.page/atom.xml
```

<Callout>Example: https://hey.changes.page/atom.xml</Callout>
23 changes: 23 additions & 0 deletions apps/docs/content/docs/SEO-and-Feeds/seo.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: SEO
---

### Sitemap

All pages have a sitemap.xml file that can be used to submit to search engines.

```text title="Sitemap"
GET https://yourpage.changes.page/sitemap.xml
```

<Callout>Example: https://hey.changes.page/sitemap.xml</Callout>

### Robots.txt

All pages have a robots.txt file that is automatically generated based on the page settings.

```text title="Robots.txt"
GET https://yourpage.changes.page/robots.txt
```

<Callout>Example: https://hey.changes.page/robots.txt</Callout>
7 changes: 7 additions & 0 deletions apps/docs/content/docs/api/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
title: APIs
---

## Page APIs

<Card title="Page" href="/docs/api/page" />
72 changes: 72 additions & 0 deletions apps/docs/content/docs/api/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: Page
description: These are APIs that can be used to fetch page data
---

### Get the latest post

This endpoint will return a JSON response of the latest post in the page.

```text title="Request"
GET https://yourpage.changes.page/latest.json
```

```json title="200 OK"
{
"id": "b0cb4fde-8f17-4ee2-b292-196a6f2e748e",
"title": "New UI, pinned post & more!",
"content": "We've made several tweaks to the UI across the app and the most important change is the new editor.",
"type": "announcement",
"created_at": "2022-11-01T11:46:25.719707+00:00"
}
```

<Callout>This can be a pinned post if its the latest one.</Callout>

### Get pinned post

This endpoint will return a JSON response of the pinned post in the page.

```text title="Request" icon="🔍"
GET https://yourpage.changes.page/pinned.json
```

```json title="200 OK"
{
"id": "b0cb4fde-8f17-4ee2-b292-196a6f2e748e",
"title": "New UI, pinned post & more!",
"content": "We've made several tweaks to the UI across the app and the most important change is the new editor.",
"type": "announcement",
"created_at": "2022-11-01T11:46:25.719707+00:00"
}
```

<Callout>This endpoint will return null if there is no pinned post.</Callout>

### Get all posts

This endpoint will return a JSON response of all posts in the page. The response will include at most 50 posts and can be paginated by passing the `offset` parameter.

```text title="Request"
GET https://yourpage.changes.page/changes.json

{
"offset": 10 // Optional, defaults to 0
}
```

```json title="Response: 200 OK"
[
{
"id": "cf8c52a9-27b3-47df-9f22-0c0af15cfaca",
"title": "Unlock Teamwork with Our Latest Feature Update",
"content": "We're kicking off 2025 by introducing one of our most highly requested features!",
"tags": ["announcement", "new"],
"publication_date": "2025-02-14T12:22:16.571+00:00",
"updated_at": "2025-02-14T12:22:17.887817+00:00",
"created_at": "2025-02-14T09:42:52.934045+00:00",
"url": "https://hey.changes.page/post/cf8c52a9-27b3-47df-9f22-0c0af15cfaca/unlock-teamwork-with-our-latest-feature-update",
"plain_text_content": "We're kicking off 2025 by introducing one of our most highly requested features!"
}
]
```
14 changes: 14 additions & 0 deletions apps/docs/content/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Welcome!
description: changelog made smarter, faster, and user-focused.
---

Looking to setup our widget?

<Card title="Setup Widget" href="/docs/widget" />

## Want to deep dive?

Dive a little deeper and start exploring our API reference to get an idea of everything that's possible with the API:

<Card title="API Reference" href="/docs/api/page" />
Loading