Documentation
Guides

Everything Forge gives you

Complete list of what Forge generates and includes automatically. Every item below is active the moment you call app.Content(forge.NewModule(...)).

Routes and feeds

  • List routeGET /{prefix} returns all Published items as JSON or HTML
  • Detail routeGET /{prefix}/{slug} returns a single Published item
  • RSS feedGET /{prefix}/feed.xml plus aggregate GET /feed.xml
  • Sitemap entriesGET /{prefix}/sitemap.xml merged into GET /sitemap.xml; regenerated on every publish, update, and delete
  • SEO meta tags<title>, <meta description>, canonical URL in every <head>
  • Open Graph tagsog:title, og:image, og:type, article:published_time and more
  • Twitter Cardstwitter:card, twitter:title, twitter:image
  • AI index formats/llms.txt compact index, /llms-full.txt Markdown corpus, per-item /aidoc token-efficient endpoint
  • Content negotiation — one URL returns HTML to browsers, JSON to APIs, and AI-optimised format to agents; no extra code

Storage

  • Database table — derived from your struct; works with PostgreSQL, SQLite, and MySQL
  • SQLRepo — production SQL repository with automatic table naming and upserts
  • SeqRepository — lazy streaming interface for large datasets (iter.Seq2)

Rendering

  • Markdown rendering (forge_markdown) — including HTML passthrough for trusted blocks
  • Trusted HTML (forge_html) — verbatim emission of pre-rendered HTML fields
  • Field semantics in MCP schemaforge_format and forge_description struct tags; AI agents understand field intent without extra prompting

Lifecycle

  • Draft / Scheduled / Published / Archived enforcement — hardwired, cannot be disabled
  • Scheduled publishing — automatic Scheduled → Published transition at ScheduledAt; no external cron
  • 404 on everything non-Published — guests, search engines, and AI crawlers see nothing until explicitly published

Access control

  • Role-based access — Guest → Author → Editor → Admin enforced per module per operation
  • Struct-tag validationforge:"required,min=3" enforced identically for HTTP, API, and MCP calls
  • Token management — named revocable tokens with role scoping; ensureBootstrap auto-creates the first admin token on first start
  • ErrLastAdmin guard — cannot revoke the last admin token

Navigation

  • NavTree — first-class navigation abstraction (NavModeDB / NavModeCode)
  • 4 MCP nav toolslist_nav_items, create_nav_item, update_nav_item, delete_nav_item

MCP tools (forge-mcp)

Per content type, automatically derived — no manual definition:

  • create_[type] — Author+
  • update_[type] — Author+
  • publish_[type] — Author+
  • schedule_[type] — Author+
  • archive_[type] — Author+
  • delete_[type] — Author+
  • list_[type]s — Editor+
  • get_[type] — Editor+

Template infrastructure

  • Shared partialsApp.Partials + MustParseTemplate
  • HeadAssets — favicons, stylesheets, preconnect, scripts injected via forge:head on every page
  • ContextFunc — per-request extra data passed to module templates
  • Static file servingApp.Static serves from embedded FS in production (immutable cache headers) and from disk in development

SEO and structured data

  • JSON-LD — Article, Product, FAQ, HowTo, Event, Recipe, Review, Organisation rich results
  • OGDefaults — site-wide fallback OG image and Twitter handles
  • AppSchema — site-wide Organisation/WebSite JSON-LD on every page
  • Robots<meta name="robots"> set per lifecycle status; configurable AI crawler policy

Drift and config

  • File-based configurationkey = value format, fail-fast at startup
  • /_health endpoint — returns framework version and status; exempt from HTTPS redirect
  • Zero third-party dependencies — pure stdlib; driver is always your choice
  • Cookie compliance/.well-known/cookies.json declares all cookies with category and consent requirements
  • Redirect tracking — automatic 301 on slug rename, 410 Gone on archive/delete

forge-media (3 lines to wire)

  • Upload, serve, list, and delete files
  • Alt text enforced on image uploads (WCAG 1.1.1)
  • MCP tools for AI-agent file management

Developer and AI-agent experience

  • Typed MCP tools derived directly from your content type — no manual schema definition
  • Field semantics — AI agents understand what each field means without extra prompting
  • Agents operate under the same access rules as humans — no special bypass
  • forge-cliinit, content CRUD, token management, and media operations from the terminal
  • Go codebase designed to be readable and extensible by AI agents