{
  "version": "https://jsonfeed.org/version/1",
  "title": "Marmite 0.4.1",
  "home_page_url": "https://marmite.blog",
  "feed_url": "https://marmite.blog/tag-api.json",
  "description": "Static Site Generator <br> <small>for blogs</small> <br> <small>made with ❤️ and 🦀</small>",
  "items": [
    {
      "id": "https://marmite.blog/content-management-api.html",
      "url": "https://marmite.blog/content-management-api.html",
      "title": "Content Management API",
      "content_html": "<p>When you run marmite with <code>--serve</code>, the built-in server exposes a REST API under <code>/__marmite__/</code> for managing content and configuration programmatically. This API is used by the <a href=\"marmite-toolbar.html\" data-wikilink=\"true\">marmite-toolbar</a> and can also be called directly with <code>curl</code> or any HTTP client.</p>\n<div class=\"markdown-alert markdown-alert-important\">\n<p class=\"markdown-alert-title\">Important</p>\n<p>The API is only available on the local dev server (<code>--serve</code>). It is not part of the generated static site and is not exposed in production deployments.</p>\n</div>\n<h2 id=\"endpoints\">Endpoints<a href=\"#endpoints\" aria-label=\"Link to heading 'Endpoints'\" data-heading-content=\"Endpoints\" class=\"anchor\"></a></h2>\n<h3 id=\"content\">Content<a href=\"#content\" aria-label=\"Link to heading 'Content'\" data-heading-content=\"Content\" class=\"anchor\"></a></h3>\n<h4 id=\"create-content\">Create content<a href=\"#create-content\" aria-label=\"Link to heading 'Create content'\" data-heading-content=\"Create content\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">POST /__marmite__/content\n</code></pre>\n<p>Creates a new markdown file in the content directory.</p>\n<p><strong>Request body (JSON):</strong></p>\n<table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>title</code></td>\n<td>string</td>\n<td>yes</td>\n<td>Content title</td>\n</tr>\n<tr>\n<td><code>tags</code></td>\n<td>string or array</td>\n<td>no</td>\n<td>Comma-separated string or array of tags</td>\n</tr>\n<tr>\n<td><code>page</code></td>\n<td>boolean</td>\n<td>no</td>\n<td>If true, creates a page (no date). Default: false</td>\n</tr>\n<tr>\n<td><code>lang</code></td>\n<td>string</td>\n<td>no</td>\n<td>ISO 639-1 language code</td>\n</tr>\n<tr>\n<td><code>translates</code></td>\n<td>string</td>\n<td>no</td>\n<td>Slug of the content this translates</td>\n</tr>\n<tr>\n<td><code>directory</code></td>\n<td>string</td>\n<td>no</td>\n<td>Subdirectory within the content folder</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Example:</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-console\">$ curl -X POST http://localhost:8000/__marmite__/content \\\n  -H 'Content-Type: application/json' \\\n  -d '{&quot;title&quot;: &quot;Getting Started with Rust&quot;, &quot;tags&quot;: &quot;rust, tutorial&quot;}'\n</code></pre>\n<p><strong>Response (201):</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{\n  <a-s>&quot;file&quot;</a-s>: <a-s>&quot;content/posts/getting-started-with-rust.md&quot;</a-s>,\n  <a-s>&quot;title&quot;</a-s>: <a-s>&quot;Getting Started with Rust&quot;</a-s>,\n  <a-s>&quot;slug&quot;</a-s>: <a-s>&quot;getting-started-with-rust&quot;</a-s>,\n  <a-s>&quot;is_page&quot;</a-s>: <a-co>false</a-co>,\n  <a-s>&quot;date&quot;</a-s>: <a-s>&quot;2026-07-09 12:00:00&quot;</a-s>,\n  <a-s>&quot;tags&quot;</a-s>: <a-s>&quot;rust, tutorial&quot;</a-s>\n}</code></pre>\n<h4 id=\"update-frontmatter\">Update frontmatter<a href=\"#update-frontmatter\" aria-label=\"Link to heading 'Update frontmatter'\" data-heading-content=\"Update frontmatter\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">PATCH /__marmite__/content/{slug}\n</code></pre>\n<p>Updates frontmatter fields of an existing content file. The markdown body is preserved. Set a field to <code>null</code> to remove it.</p>\n<p><strong>Example:</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-console\">$ curl -X PATCH http://localhost:8000/__marmite__/content/my-post \\\n  -H 'Content-Type: application/json' \\\n  -d '{&quot;tags&quot;: &quot;rust, web&quot;, &quot;stream&quot;: &quot;tutorial&quot;, &quot;pinned&quot;: true}'\n</code></pre>\n<p><strong>Response (200):</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{\n  <a-s>&quot;slug&quot;</a-s>: <a-s>&quot;my-post&quot;</a-s>,\n  <a-s>&quot;file&quot;</a-s>: <a-s>&quot;content/posts/my-post.md&quot;</a-s>,\n  <a-s>&quot;frontmatter&quot;</a-s>: {\n    <a-s>&quot;title&quot;</a-s>: <a-s>&quot;My Post&quot;</a-s>,\n    <a-s>&quot;tags&quot;</a-s>: <a-s>&quot;rust, web&quot;</a-s>,\n    <a-s>&quot;stream&quot;</a-s>: <a-s>&quot;tutorial&quot;</a-s>,\n    <a-s>&quot;pinned&quot;</a-s>: <a-co>true</a-co>\n  }\n}</code></pre>\n<h4 id=\"clone-content\">Clone content<a href=\"#clone-content\" aria-label=\"Link to heading 'Clone content'\" data-heading-content=\"Clone content\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">POST /__marmite__/content/{slug}/clone\n</code></pre>\n<p>Copies the entire file (frontmatter and markdown body) to a new file with a different title and slug. The <code>aliases</code> and <code>translates</code> fields are removed from the clone.</p>\n<p><strong>Request body (JSON):</strong></p>\n<table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>title</code></td>\n<td>string</td>\n<td>yes</td>\n<td>Title for the cloned content</td>\n</tr>\n<tr>\n<td><code>slug</code></td>\n<td>string</td>\n<td>no</td>\n<td>Custom slug. If omitted, derived from the title</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Example:</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-console\">$ curl -X POST http://localhost:8000/__marmite__/content/my-post/clone \\\n  -H 'Content-Type: application/json' \\\n  -d '{&quot;title&quot;: &quot;My Post (Copy)&quot;}'\n</code></pre>\n<p><strong>Response (201):</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{\n  <a-s>&quot;slug&quot;</a-s>: <a-s>&quot;my-post-copy&quot;</a-s>,\n  <a-s>&quot;file&quot;</a-s>: <a-s>&quot;content/posts/my-post-copy.md&quot;</a-s>,\n  <a-s>&quot;source&quot;</a-s>: <a-s>&quot;my-post&quot;</a-s>\n}</code></pre>\n<h4 id=\"move--rename-content\">Move / Rename content<a href=\"#move--rename-content\" aria-label=\"Link to heading 'Move / Rename content'\" data-heading-content=\"Move / Rename content\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">POST /__marmite__/content/{slug}/move\n</code></pre>\n<p>Moves or renames a content file. The filename must end with <code>.md</code>. Paths with <code>/</code> are relative to the content directory and intermediate directories are created automatically.</p>\n<p><strong>Request body (JSON):</strong></p>\n<table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Type</th>\n<th>Required</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>filename</code></td>\n<td>string</td>\n<td>yes</td>\n<td>New filename or path (e.g. <code>new-name.md</code> or <code>posts/new-name.md</code>)</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Example:</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-console\">$ curl -X POST http://localhost:8000/__marmite__/content/my-post/move \\\n  -H 'Content-Type: application/json' \\\n  -d '{&quot;filename&quot;: &quot;tutorials/my-post.md&quot;}'\n</code></pre>\n<p><strong>Response (200):</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{\n  <a-s>&quot;slug&quot;</a-s>: <a-s>&quot;my-post&quot;</a-s>,\n  <a-s>&quot;old_file&quot;</a-s>: <a-s>&quot;content/posts/my-post.md&quot;</a-s>,\n  <a-s>&quot;new_file&quot;</a-s>: <a-s>&quot;content/tutorials/my-post.md&quot;</a-s>\n}</code></pre>\n<blockquote>\n<p>The response <code>slug</code> reflects the actual slug the content will render as. If the file has an explicit <code>slug:</code> in frontmatter, that value is returned regardless of the new filename.</p>\n</blockquote>\n<h4 id=\"delete-content\">Delete content<a href=\"#delete-content\" aria-label=\"Link to heading 'Delete content'\" data-heading-content=\"Delete content\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">DELETE /__marmite__/content/{slug}\n</code></pre>\n<p>Deletes the markdown file associated with the given slug.</p>\n<p><strong>Example:</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-console\">$ curl -X DELETE http://localhost:8000/__marmite__/content/my-post\n</code></pre>\n<p><strong>Response (200):</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{\n  <a-s>&quot;slug&quot;</a-s>: <a-s>&quot;my-post&quot;</a-s>,\n  <a-s>&quot;file&quot;</a-s>: <a-s>&quot;content/posts/my-post.md&quot;</a-s>,\n  <a-s>&quot;deleted&quot;</a-s>: <a-co>true</a-co>\n}</code></pre>\n<h3 id=\"configuration\">Configuration<a href=\"#configuration\" aria-label=\"Link to heading 'Configuration'\" data-heading-content=\"Configuration\" class=\"anchor\"></a></h3>\n<h4 id=\"create-config\">Create config<a href=\"#create-config\" aria-label=\"Link to heading 'Create config'\" data-heading-content=\"Create config\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">POST /__marmite__/config\n</code></pre>\n<p>Creates a new <code>marmite.yaml</code> with default values. Returns 409 if the file already exists.</p>\n<h4 id=\"update-config\">Update config<a href=\"#update-config\" aria-label=\"Link to heading 'Update config'\" data-heading-content=\"Update config\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">PATCH /__marmite__/config\n</code></pre>\n<p>Merges fields into the existing <code>marmite.yaml</code>. Set a field to <code>null</code> to remove it from the config.</p>\n<p><strong>Example:</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-console\">$ curl -X PATCH http://localhost:8000/__marmite__/config \\\n  -H 'Content-Type: application/json' \\\n  -d '{&quot;pagination&quot;: 20, &quot;enable_search&quot;: true}'\n</code></pre>\n<p><strong>Response (200):</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{\n  <a-s>&quot;file&quot;</a-s>: <a-s>&quot;marmite.yaml&quot;</a-s>,\n  <a-s>&quot;config&quot;</a-s>: { <a-s>&quot;...merged config...&quot;</a-s> }\n}</code></pre>\n<h3 id=\"site-data\">Site Data<a href=\"#site-data\" aria-label=\"Link to heading 'Site Data'\" data-heading-content=\"Site Data\" class=\"anchor\"></a></h3>\n<h4 id=\"get-aggregated-data\">Get aggregated data<a href=\"#get-aggregated-data\" aria-label=\"Link to heading 'Get aggregated data'\" data-heading-content=\"Get aggregated data\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">GET /__marmite__/data\n</code></pre>\n<p>Returns aggregated site data useful for building tools and editors. Includes lists of all tags, streams, series, authors, languages, content slugs, the full site config, and build stats.</p>\n<p><strong>Response (200):</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{\n  <a-s>&quot;tags&quot;</a-s>: [<a-s>&quot;docs&quot;</a-s>, <a-s>&quot;rust&quot;</a-s>, <a-s>&quot;tutorial&quot;</a-s>],\n  <a-s>&quot;streams&quot;</a-s>: [<a-s>&quot;guide&quot;</a-s>, <a-s>&quot;news&quot;</a-s>],\n  <a-s>&quot;series&quot;</a-s>: [<a-s>&quot;python-tutorial&quot;</a-s>],\n  <a-s>&quot;authors&quot;</a-s>: [<a-s>&quot;alice&quot;</a-s>],\n  <a-s>&quot;languages&quot;</a-s>: [<a-s>&quot;en&quot;</a-s>, <a-s>&quot;pt&quot;</a-s>],\n  <a-s>&quot;iso_languages&quot;</a-s>: [<a-s>&quot;aa&quot;</a-s>, <a-s>&quot;ab&quot;</a-s>, <a-s>&quot;...all ISO 639-1 codes...&quot;</a-s>],\n  <a-s>&quot;slugs&quot;</a-s>: [<a-s>&quot;about&quot;</a-s>, <a-s>&quot;hello-world&quot;</a-s>, <a-s>&quot;my-post&quot;</a-s>],\n  <a-s>&quot;post_count&quot;</a-s>: <a-n>25</a-n>,\n  <a-s>&quot;page_count&quot;</a-s>: <a-n>3</a-n>,\n  <a-s>&quot;elapsed_time&quot;</a-s>: <a-n>0.6</a-n>,\n  <a-s>&quot;marmite_version&quot;</a-s>: <a-s>&quot;0.4.1&quot;</a-s>,\n  <a-s>&quot;config&quot;</a-s>: { <a-s>&quot;...full marmite.yaml config...&quot;</a-s> }\n}</code></pre>\n<h3 id=\"dev-server-assets\">Dev Server Assets<a href=\"#dev-server-assets\" aria-label=\"Link to heading 'Dev Server Assets'\" data-heading-content=\"Dev Server Assets\" class=\"anchor\"></a></h3>\n<p>These endpoints serve the <a href=\"marmite-toolbar.html\" data-wikilink=\"true\">marmite-toolbar</a> assets and are injected automatically into HTML pages during <code>--serve</code> mode.</p>\n<table>\n<thead>\n<tr>\n<th>Endpoint</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>GET /__marmite__/toolbar.js</code></td>\n<td>Toolbar JavaScript</td>\n</tr>\n<tr>\n<td><code>GET /__marmite__/toolbar.css</code></td>\n<td>Toolbar stylesheet</td>\n</tr>\n<tr>\n<td><code>GET /__marmite__/livereload.js</code></td>\n<td>Live reload script (with <code>--watch</code>)</td>\n</tr>\n<tr>\n<td><code>WS /__marmite__/livereload</code></td>\n<td>Live reload WebSocket (with <code>--watch</code>)</td>\n</tr>\n</tbody>\n</table>\n<h3 id=\"content-metadata\">Content Metadata<a href=\"#content-metadata\" aria-label=\"Link to heading 'Content Metadata'\" data-heading-content=\"Content Metadata\" class=\"anchor\"></a></h3>\n<p>When running with <code>--serve</code>, marmite generates a metadata JSON file for each content page:</p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">GET /{slug}.metadata.json\n</code></pre>\n<p><strong>Response:</strong></p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{\n  <a-s>&quot;frontmatter&quot;</a-s>: {\n    <a-s>&quot;title&quot;</a-s>: <a-s>&quot;My Post&quot;</a-s>,\n    <a-s>&quot;slug&quot;</a-s>: <a-s>&quot;my-post&quot;</a-s>,\n    <a-s>&quot;date&quot;</a-s>: <a-s>&quot;2026-07-09 12:00:00&quot;</a-s>,\n    <a-s>&quot;tags&quot;</a-s>: [<a-s>&quot;rust&quot;</a-s>, <a-s>&quot;tutorial&quot;</a-s>],\n    <a-s>&quot;...all frontmatter fields...&quot;</a-s>\n  },\n  <a-s>&quot;source_path&quot;</a-s>: <a-s>&quot;posts/my-post.md&quot;</a-s>,\n  <a-s>&quot;last_updated&quot;</a-s>: <a-s>&quot;2026-07-09T12:00:00+00:00&quot;</a-s>\n}</code></pre>\n<h3 id=\"content-body\">Content Body<a href=\"#content-body\" aria-label=\"Link to heading 'Content Body'\" data-heading-content=\"Content Body\" class=\"anchor\"></a></h3>\n<h4 id=\"read-content-body\">Read content body<a href=\"#read-content-body\" aria-label=\"Link to heading 'Read content body'\" data-heading-content=\"Read content body\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">GET /__marmite__/content/{slug}/body\n</code></pre>\n<p>Returns the raw markdown body and frontmatter separately. Used by the <a href=\"marmite-editor.html\" data-wikilink=\"true\">marmite-editor</a>.</p>\n<p>Response:</p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{\n  <a-s>&quot;slug&quot;</a-s>: <a-s>&quot;my-post&quot;</a-s>,\n  <a-s>&quot;frontmatter&quot;</a-s>: {<a-s>&quot;title&quot;</a-s>: <a-s>&quot;My Post&quot;</a-s>, <a-s>&quot;tags&quot;</a-s>: <a-s>&quot;rust, web&quot;</a-s>, <a-s>&quot;...&quot;</a-s>: <a-s>&quot;...&quot;</a-s>},\n  <a-s>&quot;body&quot;</a-s>: <a-s>&quot;# My Post\\n\\nContent here...&quot;</a-s>,\n  <a-s>&quot;source_path&quot;</a-s>: <a-s>&quot;content/my-post.md&quot;</a-s>\n}</code></pre>\n<h4 id=\"write-content-body\">Write content body<a href=\"#write-content-body\" aria-label=\"Link to heading 'Write content body'\" data-heading-content=\"Write content body\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">PUT /__marmite__/content/{slug}/body\nContent-Type: application/json\n\n{&quot;body&quot;: &quot;# Updated\\n\\nNew content...&quot;, &quot;frontmatter&quot;: {&quot;title&quot;: &quot;Updated Title&quot;}}\n</code></pre>\n<p>The <code>frontmatter</code> field is optional. When provided, the specified fields are merged into the existing frontmatter. The body is written as-is without adding or removing frontmatter delimiters (the function handles serialization).</p>\n<h3 id=\"raw-file-access\">Raw File Access<a href=\"#raw-file-access\" aria-label=\"Link to heading 'Raw File Access'\" data-heading-content=\"Raw File Access\" class=\"anchor\"></a></h3>\n<h4 id=\"read-file\">Read file<a href=\"#read-file\" aria-label=\"Link to heading 'Read file'\" data-heading-content=\"Read file\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">GET /__marmite__/file/{path}\n</code></pre>\n<p>Reads any text file in the project directory. Binary files (images, fonts, archives) are rejected. Path traversal outside the project directory is blocked.</p>\n<p>Response:</p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{<a-s>&quot;path&quot;</a-s>: <a-s>&quot;content/_hero.md&quot;</a-s>, <a-s>&quot;content&quot;</a-s>: <a-s>&quot;&gt;&gt;&gt; Welcome to my site &gt;&gt;&gt;&quot;</a-s>}</code></pre>\n<h4 id=\"write-file\">Write file<a href=\"#write-file\" aria-label=\"Link to heading 'Write file'\" data-heading-content=\"Write file\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">PUT /__marmite__/file/{path}\nContent-Type: application/json\n\n{&quot;content&quot;: &quot;&gt;&gt;&gt; Updated hero content &gt;&gt;&gt;&quot;}\n</code></pre>\n<h3 id=\"file-tree\">File Tree<a href=\"#file-tree\" aria-label=\"Link to heading 'File Tree'\" data-heading-content=\"File Tree\" class=\"anchor\"></a></h3>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">GET /__marmite__/files\n</code></pre>\n<p>Lists all files in the project directory (excluding the output folder and hidden files). Each entry includes flags for whether the file is editable, a content file with a slug, or a fragment.</p>\n<p>Response:</p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{\n  <a-s>&quot;files&quot;</a-s>: [\n    {<a-s>&quot;path&quot;</a-s>: <a-s>&quot;content/my-post.md&quot;</a-s>, <a-s>&quot;slug&quot;</a-s>: <a-s>&quot;my-post&quot;</a-s>, <a-s>&quot;editable&quot;</a-s>: <a-co>true</a-co>},\n    {<a-s>&quot;path&quot;</a-s>: <a-s>&quot;content/_hero.md&quot;</a-s>, <a-s>&quot;editable&quot;</a-s>: <a-co>true</a-co>, <a-s>&quot;fragment&quot;</a-s>: <a-co>true</a-co>},\n    {<a-s>&quot;path&quot;</a-s>: <a-s>&quot;marmite.yaml&quot;</a-s>, <a-s>&quot;editable&quot;</a-s>: <a-co>true</a-co>},\n    {<a-s>&quot;path&quot;</a-s>: <a-s>&quot;static/custom.css&quot;</a-s>, <a-s>&quot;editable&quot;</a-s>: <a-co>true</a-co>},\n    {<a-s>&quot;path&quot;</a-s>: <a-s>&quot;content/media/photo.jpg&quot;</a-s>}\n  ]\n}</code></pre>\n<h3 id=\"raw-config-access\">Raw Config Access<a href=\"#raw-config-access\" aria-label=\"Link to heading 'Raw Config Access'\" data-heading-content=\"Raw Config Access\" class=\"anchor\"></a></h3>\n<h4 id=\"read-config\">Read config<a href=\"#read-config\" aria-label=\"Link to heading 'Read config'\" data-heading-content=\"Read config\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">GET /__marmite__/config\n</code></pre>\n<p>Returns the raw YAML content of <code>marmite.yaml</code>.</p>\n<p>Response:</p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{<a-s>&quot;file&quot;</a-s>: <a-s>&quot;/path/to/marmite.yaml&quot;</a-s>, <a-s>&quot;yaml&quot;</a-s>: <a-s>&quot;name: My Site\\ntagline: ...&quot;</a-s>}</code></pre>\n<h4 id=\"write-config\">Write config<a href=\"#write-config\" aria-label=\"Link to heading 'Write config'\" data-heading-content=\"Write config\" class=\"anchor\"></a></h4>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner\">PUT /__marmite__/config\nContent-Type: application/json\n\n{&quot;yaml&quot;: &quot;name: My Site\\ntagline: Updated\\n...&quot;}\n</code></pre>\n<p>The YAML is validated before writing. Returns 400 with an error message if the YAML is malformed.</p>\n<h2 id=\"error-responses\">Error responses<a href=\"#error-responses\" aria-label=\"Link to heading 'Error responses'\" data-heading-content=\"Error responses\" class=\"anchor\"></a></h2>\n<p>All endpoints return JSON error responses:</p>\n<pre class=\"marmite-code\"><code class=\"marmite-code-inner language-json\">{<a-s>&quot;error&quot;</a-s>: <a-s>&quot;description of the error&quot;</a-s>}</code></pre>\n<table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>400</td>\n<td>Bad request (missing fields, invalid JSON)</td>\n</tr>\n<tr>\n<td>404</td>\n<td>Content or config not found</td>\n</tr>\n<tr>\n<td>405</td>\n<td>HTTP method not allowed</td>\n</tr>\n<tr>\n<td>409</td>\n<td>Conflict (config already exists)</td>\n</tr>\n<tr>\n<td>500</td>\n<td>Server error (file write failed)</td>\n</tr>\n</tbody>\n</table>\n<blockquote>\n<p>Please consider giving a ☆ on Marmite <a href=\"https://github.com/rochacbruno/marmite\">Github</a> repository, that helps a lot!</p>\n</blockquote>\n<!-- Contents from _markdown_footer.md are appended to every content -->\n<!-- _references.md is a file to gather all references together \nthis file is appended to every raw markdown.\n-->\n",
      "summary": "\"Marmite exposes a local REST API during --serve mode for creating, editing, moving, cloning, and deleting content, plus managing site configuration.\"",
      "date_published": "2026-07-09T12:00:00-00:00",
      "image": "media/content-management-api.banner.jpg",
      "authors": [
        {
          "name": "Bruno Rocha",
          "url": "https://go.rocha.social/@bruno",
          "avatar": "https://github.com/rochacbruno.png"
        }
      ],
      "tags": [
        "docs",
        "features",
        "api",
        "server"
      ],
      "language": "en"
    }
  ]
}