EN FR

Chapter 22Reference

Reference

Variables, commands, options, tokens, attributes, error codes, glossary. What you come to look up without wanting to re-read a chapter.

4 min read11 sectionsChapter 22 / 22

Environment variables

All documented in .env.example, the only versioned environment file. Locally: .dev.vars. In production: the host configuration, as runtime secrets. Never the repository.

VariableRequiredRole
EDITOR_KEY_HASHyesargon2id hash of the site key. Without it, no editing is possible — that is the default state.
SESSION_SECRETyesSession cookie signature. 32 characters minimum. Replacing it closes every session.
EDITOR_NAMErecommendedAuthor name for publications. Default: “Éditeur du site”.
EDITOR_EMAILrecommendedAuthor address for publications.
GIT_PROVIDERyesgithub or gitlab (not implemented). Default: github.
GIT_REPOyesowner/repo on GitHub; group/project or numeric id on GitLab.
GIT_BRANCHyesPublishing branch. Default: main.
GIT_TOKENyesWrite token of the machine account. Scoped to that repository only.
GIT_API_BASEnoAlternative API root: self-hosted instance, or the fake local service (http://127.0.0.1:8787).
RATE_LIMITin productionA key-value binding, not a text variable. Without it, counting falls back to memory.

Commands

CommandWhereRole
npm create inline@latest <folder>anywhereCreates a site. Options: --nom, --courriel, --langue.
npm run devsite, repoAstro server alone — layout, without editing.
npm run buildsite, repoProduction build. Fails if content is invalid.
npm run serve:functionssite, repoSite + functions on http://127.0.0.1:8788. This is where you edit.
npm run mock:gitsite, repoFake local Git repository on :8787. Port: MOCK_PORT.
npm run checksite, repoRaw HTML, language parity, logs, secrets.
npm testrepoThe whole suite, build included.
npm run create:siterepoA site's credentials. Options: --nom, --depot, --branche, --auteur, --courriel, --ecrire.
npm run make:keysite, repoA key and its hash — rotation. Shipped with the site since create-inline 1.1.0.
npm run bootstraprepoBootstrapping. Options: --html, --page, --langue, --essai, --sortie.
npm run test:scaffoldrepoSite created from scratch, installed, built, checked.
npm run test:packrepoSame, from publication archives.
npm run pack:core / pack:clirepoBuilds the archives.
npm run release:core / release:clirepoPublishes to the registry.

Integration options

js js
inline({
  locales: ['fr', 'en'],                    // required — reference language first
  support: { email: 'contact@agency.com' }, // shown to the client on /admin and /aide
  theme: 'src/styles/theme.css',            // default
  pages: { admin: true, help: true },       // false to provide your own
})

Style tokens

KeyValuesClass producedVariable expected
sizexs sm base lg xl 2xl 3xl.cms-size-*--size-*
weightthin light regular medium semibold bold.cms-weight-*--weight-*
italictrue false.cms-italic
alignleft center right.cms-align-*
colorprimary secondary muted accent inverse.cms-color-*--color-*

Field types

text text
text      { type, value, style }                                headings, labels, plain paragraphs
richtext  { type, value }                                       emphasis, links, lists — 7 tags
image     { type, kind:'image', src, alt, width, height }        file from src/media
video     { type, kind:'video', provider, videoId, title }       YouTube or Vimeo, never a file

Attributes placed in the HTML

AttributeValue
data-cmsField path, e.g. blocks.hero.title
data-cms-typetext · richtext · media
data-cms-kindimage · video
data-cms-untranslatedtrue if the field comes from the reference language
data-cms-listcollections.{name}
data-cms-itemThe item id
data-cms-templateName of the list it is the model for
data-cms-blankJSON of a blank item
data-cms-fileThe page's content file (on body)
data-cms-locale · data-cms-pageCurrent language and page (on body)
data-cms-localesSite languages: code, address, label (on body)

Naming rules

ObjectShapeExample
Page filelowercase, digits, hyphensour-services.json
Write pathsrc/content/pages/{language}/{page}.jsonsrc/content/pages/en/home.json
Media file[a-z0-9]+(-[a-z0-9]+)*.(jpg|png|webp)bakehouse-at-dawn.webp
Item idone letter, a hyphen, 3+ digitst-001
Language codetwo lowercase lettersen
Commit messageone line, 120 characterscontent(en): home — hero.title

Error codes

Internal codeHTTPMeaning
bad_request400Invalid body or path.
unauthorized401 / 502Missing session (401) or repository refusing access (502).
method_not_allowed405Method not expected on this route.
not_found404 / 502File or repository not found.
conflict409Stale version: someone published in the meantime.
too_large413Size cap exceeded.
unsupported_format415Unrecognised image format or out-of-range dimensions.
invalid_content422Schema, media, ids or markup refused.
429Rate exceeded. retry-after header.
unavailable502The repository did not answer.

Ports

4321npm run devAstro alone
8788npm run serve:functionsSite + functions
8787npm run mock:gitFake Git repository

Glossary

TermWhat it isWhat the client reads
OverlayThe editing interface layered over the page.
Site keyThe shared secret, hashed with argon2id.“your key”
Edit markerSecret-free cookie that triggers loading the overlay.
Optimistic lockVersion comparison before writing.“someone published in the meantime”
VersionOpaque fingerprint of a file's state (blob SHA on GitHub).
PublicationA commit, then a site rebuild.“Publish”
DraftChanges saved in the browser.“unpublished changes”
Style tokenA schema enum value.a button in the bar
BootstrappingExtracting content from an annotated HTML page.

Where to read the code

QuestionFile
What shape is the content?inline-core/src/schema.ts
Which style variants exist?inline-core/src/style-tokens.ts
Who is allowed to write?inline-core/src/server/auth.ts
Which caps, paths, budgets?inline-core/src/server/guard.ts
How do we talk to the repository?inline-core/src/server/git-provider.ts, github.ts
What does publishing do, in order?inline-core/src/server/routes/save.ts
How does the overlay link DOM and JSON?inline-core/src/editor/index.ts
What is placed in the page?inline-core/astro/index.ts
How is a video address read?inline-core/src/video.ts
How does the translation fallback work?inline-core/src/translate.ts