一款以 Markdown 为先的 CMS,使用 Go 编写,具有主题、插件和集成的管理员用户界面
Foundry is a Markdown-first CMS written in Go. It keeps content in files, renders through themes, includes a Quill-powered rich text editor in the admin UI, and extends through both first-class compiled Go plugins and out-of-process RPC plugins.
The project is aimed at teams that want a file-based workflow without giving up CMS-style features such as taxonomies, theme-owned custom fields, feeds, plugin hooks, and an admin surface.
See more of Foundry here: Foundry Screenshots
public/No - Foundry is a Markdown-first, file-based CMS that supports two equally first-class runtime shapes:
foundry build, which writes the rendered site (and frontend SDK artifacts under public/__foundry/) to the public/ directory. Use this if you want a static deployment behind a CDN or object storage.foundry serve, foundry serve-standalone, or foundry service install, which runs Foundry as a long-running process with the themeable admin UI mounted at /__admin and a live JSON API under /__foundry.Either model is fully supported. Content is stored the same way in both cases: Markdown files with frontmatter under the content/ directory (pages under content/pages/, posts under content/posts/, media under content/images/, content/videos/, content/audio/, and content/documents/). That means you can move between static and server modes without changing how content is authored or versioned in Git.
If your goal is to manage content and publish a static site, Foundry fits that model well. If you also need a live API surface, an admin UI, or incremental rebuilds during development, those are first-class too.
Content is exposed as JSON via two options:
1. Live API
/__foundry/api/*2. Static JSON
public/__foundry/*.jsonThe fastest way to get the project running locally is via Docker:
sh scripts/docker-init.sh
docker compose up -d --buildThe default docker-compose.yml is local-development oriented:
data/ and public/ on named Docker volumes.env when presentscripts/docker-init.sh creates a .env file with random local secrets for local useFor a harder production shape, use docker-compose.prod.yml:
export FOUNDRY_ADMIN_SESSION_SECRET="$(openssl rand -hex 32)"
export FOUNDRY_ADMIN_TOTP_SECRET_KEY="$(openssl rand -base64 32)"
docker compose -f docker-compose.prod.yml up -d --buildThe production compose setup:
no-new-privileges/tmpcontent/, themes/, plugins/, data/, and public/Before using the production overlay in anything real, update
content/config/site.docker.prod.yaml so base_url matches your deployed
HTTPS origin.
Otherwise, see the Getting Started section for how to install the foundry command, run Foundry locally, or run it in portable standalone mode without Docker.
Foundry will run on http://localhost:8080/ by default, and the admin panel
is reachable at http://localhost:8080/__admin. The default login on a
new install is admin:admin.
Production note: set admin.session_secret in content/config/site.yaml or
FOUNDRY_ADMIN_SESSION_SECRET in the environment. Foundry stores only hashed
session tokens at rest, and an explicit session secret strengthens that hashing.
…Managed runtime integrations are optional and provider-neutral. See
docs/managed-runtime-boundary.md for the
configuration and Cloud boundary.
For portable content and media transfers, see
docs/content-bundles.md.
Foundry keeps a clean separation between content loading, route assignment, rendering, and runtime orchestration.
The main pipeline is:
config -> content/data load -> site graph -> route assignment
-> dependency graph -> renderer -> build output or preview serverTwo graph types matter:
SiteGraph: the in-memory representation of documents, routes, taxonomies, config, and loaded dataDependencyGraph: the rebuild graph used to decide which outputs must be regenerated after a changeThe dependency graph includes taxonomy archive outputs, so incremental rebuilds can target both document pages and taxonomy pages.
Foundry uses:
go fmt for Go codeprettier for JS, CSS, HTML, and Markdown assets/docsInstall the formatter tooling once:
npm installThen run:
make fmt
make fmt-web
make fmt-allFoundry now includes local-only browser coverage using Playwright for:
Install the tooling once:
npm install
npx playwright installThen run:
make test-e2eUseful variants:
npm run test:e2e
npm run test:e2e:full
npm run test:e2e:headed
npm run test:e2e:uiNotes:
content/, data/, public/, and backup output are isolated from the repo during the runmake test-e2e and npm run test:e2e:full run pre/post cleanup so e2e-* documents, media, users, backups, and lifecycle artifacts do not accumulateadmin/admin, but you can override credentials with:FOUNDRY_E2E_ADMIN_USERFOUNDRY_E2E_ADMIN_PASSFoundry now ships two official framework-agnostic JavaScript SDKs under sdk/:
sdk/adminsdk/frontendThey exist to give admin frontends, plugin UIs, and JS-powered themes a supported client contract instead of forcing each consumer to hand-roll fetch logic against unstable internal endpoints.
The Admin SDK targets the authenticated admin API under admin.path + /api.
The Frontend SDK targets the public Foundry platform surface under /__foundry, with a live JSON API in preview/server mode and generated static artifacts under public/__foundry/ for built sites.
The shared SDK core handles:
The current official browser entrypoints are:
/__foundry/sdk/admin/index.js
/__foundry/sdk/frontend/index.jsExample:
import { createAdminClient } from '/__foundry/sdk/admin/index.js';
import { createFrontendClient } from '/__foundry/sdk/frontend/index.js';
const admin = createAdminClient({ baseURL: '/__admin' });
const frontend = createFrontendClient({ mode: 'auto' });Current capability discovery endpoints:
/api/capabilities/__foundry/api/capabilitiesBuilt sites also emit frontend SDK data artifacts under:
public/__foundry/
capabilities.json
site.json
navigation.json
routes.json
collections.json
search.json
preview.json
content/.json
sdk/...The shipped themes use these SDKs too:
/__foundry/sdk/admin/index.js/theme/js/foundry-theme.jsPlugin-defned admin pages and widgets can also target a stable shell contract now. A plugin can declare admin page and widget bundles in plugin.yaml, Foundry exposes those bundles under /extensions//..., and the default admin shell will automatically import them when their page or widget slot is active. Admin pages can also declare nav_group (dashboard, content, manage, or admin) so they land in the right sidebar group. The shell dispatches foundry:admin-extension-page and foundry:admin-extension-widget and exposes window.FoundryAdmin so plugin code can mount against a supported runtime surface instead of private admin internals. The built-in Extensions admin page itself uses a separate route, /a-extensions, so it does not collide with the plugin asset namespace.
Foundry now treats themes and plugins as different security surfaces.
theme.yaml -> securityplugin.yaml -> permissionsTheme security currently covers:
Plugin permissions currently cover declaration and visibility, not true sandboxing.
In-process plugins are still trusted Go code today, but Foundry now also has a
working out-of-process RPC host for the first migrated hook family
(OnContext). Foundry can now:
foundry plugin security foundry plugin validate --security for explicit security validationruntime.mode: rpc plugins out of process when they use the supported RPC protocol and hook familySee the full authoring guides for details:
docs/themes/ for theme.yaml -> securitydocs/plugins/ for plugin.yaml -> permissionsdocs/plugins/ also includes the full structured permission reference for plugin authorsPlugin runtime metadata now supports a real runtime block. The current RPC
host supports the context hook family over a JSON RPC transport, with a
sanitized environment and no host-granted filesystem, network, or process
capability channels. Broader hook migration and stronger OS-level sandboxing
still build on that foundation.
1.22 or newerPATH that includes $(go env GOPATH)/bin if you install with go installInstall the CLI:
go install github.com/sphireinc/foundry/cmd/foundry@latestVerify the install:
foundry versionThat prints runtime-aware version metadata, including the current version, commit, build date, install mode, target platform, and executable path.
If you are working from a local checkout instead of a global install, you can run:
go run ./cmd/foundry versionFoundry expects a file-based project layout. The quickest way to get running is to start with this shape:
content/
con暂无开放 Issues,或尚未同步最近议题。