This is a standalone Next.js blog template for publishing GEOFlow blog content. It reads blog settings, categories, authors, and articles from the GEOFlow Blog API, then renders a public blog site with article lists, article detail pages, category pages, archives, search, multilingual routes, SEO metadata, and sitemap output.
- GEOFlow Blog API integration for settings, catalog data, article lists, and article detail pages.
- Home page with site profile, search, article list, featured articles, hot articles, categories, and optional carousel slides.
- Article detail pages with markdown rendering, cover images, author info, tags, related articles, article ads, and structured data.
- Category pages with paginated article lists and category navigation.
- Archive pages grouped by publish month, including paginated month archives.
- Multilingual blog routes for English, Chinese, and Japanese by default.
- Language switcher that links translated articles when the API provides
source_title_idrelationships. - Light and dark theme toggle stored in the browser.
- Preview mode when server API credentials are not configured. You can enter API config in the browser and preview without changing
.env. - SEO support for metadata, Open Graph images, robots.txt, sitemap.xml, and JSON-LD.
- Node.js 20 or newer.
- pnpm 10.
- A GEOFlow API token with blog read permission.
Install dependencies:
pnpm installCreate a local environment file:
cp .env.example .env.localEdit .env.local:
GEOFLOW_API_BASE_URL=https://autogeoflow.com
GEOFLOW_API_TOKEN=gf_xxx
NEXT_PUBLIC_SITE_URL=https://example.com
GEOFLOW_BLOG_LANGUAGE_CODE=["en","zh","ja"]
GEOFLOW_BLOG_DEFAULT_LANGUAGE_CODE=enStart the development server:
pnpm devOpen http://localhost:3000.
| Variable | Required | Description |
|---|---|---|
GEOFLOW_API_BASE_URL |
Yes for production | GEOFlow API base URL. Example: https://autogeoflow.com. |
GEOFLOW_API_TOKEN |
Yes for production | Blog read token used by server-side API requests. |
NEXT_PUBLIC_SITE_URL |
Recommended | Public site URL used for canonical URLs, sitemap URLs, and absolute links. |
GEOFLOW_BLOG_LANGUAGE_CODE |
Optional | Supported languages. Accepts a JSON array or comma-separated list. Default: ["en","zh","ja"]. |
GEOFLOW_BLOG_DEFAULT_LANGUAGE_CODE |
Optional | Default blog language. Default: first configured language. |
If GEOFLOW_API_BASE_URL or GEOFLOW_API_TOKEN is missing, the app shows preview mode. Preview mode stores the API base URL and token in localStorage for the current browser only.
| Route | Purpose |
|---|---|
/ |
Home page, search, latest articles, featured articles, hot articles, and categories. |
/article/[slug] |
Article detail page. |
/category/[slug] |
Category article list. |
/archive |
Archive index grouped by year and month. |
/archive/[year]/[month] |
Monthly archive with pagination. |
/sitemap.xml |
Dynamic sitemap generated from articles, categories, archives, and languages. |
/robots.txt |
Robots rules and sitemap location. |
Non-default language pages use the language prefix, for example /zh, /zh/article/example-slug, or /ja/archive.
app/ Next.js routes, metadata, sitemap, and robots output
components/ Blog UI components
lib/ GEOFlow API client, language helpers, metadata helpers, and format utilities
public/ Static assets if you add any
.env.example Example runtime configuration
pnpm dev # Start local development
pnpm build # Build for production
pnpm start # Start the production build
pnpm lint # Run ESLint- Configure all production environment variables on your hosting platform.
- Set
NEXT_PUBLIC_SITE_URLto the final public domain. - Use a GEOFlow token with only the permissions needed for blog reading.
- Run
pnpm buildbefore deployment to catch configuration or TypeScript issues.