Skip to content

Commit a800703

Browse files
maxprilutskiyclaude
andcommitted
refactor: rebrand as markdoc-nextjs-localization-example
Strip Cal.com references from the demo content and rebrand the repo as a generic example showing how to localize a Next.js App Router site authored in Markdoc with Lingo.dev. - Replace Cal.com brand/copy in navbar, hero, sidebar, home, blog - Replace calcom-v6-4 changelog with hello-markdoc walkthrough post - Prune unused ui.json nav/CTA keys; remove stub href="#" links - Swap Cal Sans font for Space Grotesk - Rewrite README to match ios/android example structure - Add .github/workflows/translate.yml for Lingo.dev CI Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 53b7d13 commit a800703

36 files changed

Lines changed: 583 additions & 12194 deletions

.github/workflows/translate.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Translate
2+
on:
3+
push:
4+
branches: [main]
5+
permissions:
6+
contents: write
7+
jobs:
8+
translate:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Lingo.dev
13+
uses: lingodotdev/lingo.dev@main
14+
with:
15+
api-key: ${{ secrets.LINGODOTDEV_API_KEY }}

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- BEGIN:nextjs-agent-rules -->
22
# This is NOT the Next.js you know
33

4-
This version has breaking changes APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
4+
This version has breaking changes APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices.
55
<!-- END:nextjs-agent-rules -->

README.md

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,55 @@
1-
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
1+
# Next.js Markdoc Localization Example
22

3-
## Getting Started
3+
Demonstrates automated localization for a Next.js App Router site that authors long-form content in [Markdoc](https://markdoc.dev) and UI strings in JSON, using [Lingo.dev](https://lingo.dev) CLI and GitHub Actions.
44

5-
First, run the development server:
5+
> **Full walkthrough:** [lingo.dev/en/guides/markdoc-nextjs-localization](https://lingo.dev/en/guides/markdoc-nextjs-localization)
66
7-
```bash
8-
npm run dev
9-
# or
10-
yarn dev
11-
# or
12-
pnpm dev
13-
# or
14-
bun dev
15-
```
7+
## What's inside
8+
9+
- `src/app/[lang]/` – Next.js App Router, locale-scoped routes
10+
- `src/content/en/pages/*.md`, `src/content/en/blog/*.md` – source Markdoc content (English)
11+
- `src/content/en/ui.json` – source UI-string catalog
12+
- `src/markdoc.schema.ts` – custom Markdoc tag schema wired to React components
13+
- `src/proxy.ts` – middleware that redirects bare paths to the visitor's best-matching locale
14+
- `i18n.json` – Lingo.dev CLI configuration (two buckets: `markdoc`, `json`)
15+
- `.github/workflows/translate.yml` – GitHub Actions workflow
1616

17-
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
17+
## Quick start
1818

19-
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
19+
1. Fork this repo
20+
2. Add `LINGODOTDEV_API_KEY` to **Settings > Secrets and variables > Actions**
21+
3. Push a change to any file under `src/content/en/`
22+
4. Translations appear automatically via commit to main
2023

21-
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
24+
## How it works
2225

23-
## Learn More
26+
The Lingo.dev CLI reads the source Markdoc files and `ui.json`, identifies new or changed entries using a lockfile, translates the delta through a configured localization engine, and writes per-locale files into `src/content/[locale]/`. Frontmatter, Markdoc custom tags, and JSON shape are preserved – only translatable text changes. The GitHub Actions workflow runs this on every push to main.
2427

25-
To learn more about Next.js, take a look at the following resources:
28+
Next.js routes under `src/app/[lang]/` load the matching locale's files at request time. A middleware inspects the `Accept-Language` header and redirects bare paths like `/` or `/blog/hello-markdoc` to the best-matching locale.
2629

27-
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28-
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
30+
## Locales
2931

30-
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
32+
- **Source:** `en`
33+
- **Targets:** `es`, `fr`, `de`
3134

32-
## Deploy on Vercel
35+
## Running locally
36+
37+
```bash
38+
pnpm install
39+
pnpm dev
40+
```
41+
42+
Open `http://localhost:3000` – you'll be redirected to `/en`, `/es`, `/fr`, or `/de` based on your browser's `Accept-Language`.
43+
44+
To translate locally:
45+
46+
```bash
47+
pnpm lingo
48+
```
3349

34-
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
50+
## Links
3551

36-
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
52+
- [Guide: Next.js App Router Localization with Markdoc](https://lingo.dev/en/guides/markdoc-nextjs-localization)
53+
- [Lingo.dev CLI docs](https://lingo.dev/en/docs/cli)
54+
- [GitHub Actions integration](https://lingo.dev/en/docs/integrations/github)
55+
- [Create a free account](https://lingo.dev)

i18n.lock

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)