Skip to content

Add Insights blog (Markdown-based, bilingual EN/MN) - #266

Merged
Puturbold merged 4 commits into
mainfrom
feat/insights-blogs
Jun 5, 2026
Merged

Add Insights blog (Markdown-based, bilingual EN/MN)#266
Puturbold merged 4 commits into
mainfrom
feat/insights-blogs

Conversation

@Puturbold

Copy link
Copy Markdown
Collaborator

What

Adds an Insights tab backed by Markdown files, with optional bilingual (EN/MN) posts.

Insights blog

  • New /insights index and /insights/[slug] article pages, rendered at build time from Markdown in frontend/content/insights/.
  • Drop a .md file in that folder and it publishes automatically (newest date first). Front matter carries title/date/author/thumbnail/linkedin; excerpt is taken from front matter or derived from the first paragraph.
  • _TEMPLATE.md documents the format (ignored at build because it starts with _).
  • NavBar/Footer link to the new tab; i18n strings added under public/en|mn/insights.json.

Bilingual support (latest commit)

  • A post is English by default (my-post.md). Add a sibling my-post.mn.md to provide a Mongolian version.
  • The loader returns per-language fields (en + optional mn); the index cards and article page show the variant matching the site language toggle, falling back to English when no translation exists.
  • Shared fields (date, author, thumbnail, linkedin) come from the English file, so they aren't repeated.
  • Includes a Mongolian translation of the rangelands-from-space sample post.

Notes for reviewers

  • content/insights.ts uses Node fs and is only called from getStaticProps/getStaticPaths, so it never reaches the browser bundle.
  • This branch also carries the earlier "Fix dependency vulnerabilities (safe) + add ONBOARDING.md" commit, so the diff vs main includes those lockfile/package.json changes and ONBOARDING.md.

🤖 Generated with Claude Code

Puturbold and others added 2 commits June 4, 2026 00:11
Adds an Insights section (replacing the /test placeholder). Posts are
authored as Markdown files in frontend/content/insights/ — drop a .md file
in that folder and it publishes automatically (newest date first). Hand
writers the _TEMPLATE.md sample to fill in.

- frontend/content/insights/: one .md per post (front matter: title,
  author, date, thumbnail, linkedin, excerpt; then a Markdown body). Files
  starting with "_" (e.g. _TEMPLATE.md) are ignored.
- frontend/src/content/insights.ts: server-side loader (gray-matter),
  called only from getStaticProps/getStaticPaths.
- frontend/src/content/dates.ts: client-safe, deterministic date formatter.
- pages/insights.tsx (card grid) and pages/insights/[slug].tsx (article,
  body rendered via react-markdown + remark-gfm) — both statically generated.
- New `insights` i18n namespace (en/mn); NavBar + Footer point to /insights.
- Adds deps: gray-matter, react-markdown, remark-gfm.

Verified: next build prerenders /insights and each post; dev server returns
200 with bold/list/blockquote rendered and _TEMPLATE excluded; screenshots
confirm the index grid and article render.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Posts can now ship a Mongolian translation alongside the English file:
add a sibling `<slug>.mn.md` with localized title/excerpt/body. The
content loader returns per-language fields (en + optional mn), and the
index and article pages pick the variant matching the site language
toggle, falling back to English when no translation exists. Shared
fields (date, author, thumbnail, linkedin) come from the English file.

Includes a Mongolian translation of the rangelands-from-space sample
post, a template note documenting the convention, and an inline image
in the sample post.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Puturbold
Puturbold force-pushed the feat/insights-blogs branch from 8cfe6fb to c33a8d4 Compare June 4, 2026 04:11
Sync the lockfile with the upgraded dependencies now on main plus the
Insights deps (gray-matter, react-markdown, remark-gfm). The previously
committed lockfile predated the major dependency bumps; `npm ci` now
resolves cleanly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Puturbold
Puturbold merged commit d098f69 into main Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant