cms: dateibasiert + Editor im Decap/Sveltia-Look
- CMS liest/schreibt jetzt die echten content/**/*.md (gray-matter) statt DB: alle bestehenden Beiträge, Seiten und Rubriken erscheinen und sind editierbar. Supabase nur noch für Login. - Admin neu: Collections-Sidebar (Beiträge/Seiten/Rubriken), an OPENBUREAU-Theme angeglichen (Newsreader-Serif, Creme, Terracotta, dunkle Topbar). - Alle Frontmatter-Felder inkl. Farb-Dropdown mit Farbpunkten (Palette aus custom.css), Layout, Tags, summary, cover_image, external, toc, draft. - Markdown-Toolbar: Fett/Kursiv/Unterstrichen/H2/H3/Link/Bild-Upload/Liste/Zitat/Code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -17,7 +17,7 @@ async function call(path, options = {}) {
|
||||
return json;
|
||||
}
|
||||
|
||||
// Datei-Upload: kein JSON, der Browser setzt den multipart-Header selbst.
|
||||
// Datei-Upload (multipart): Browser setzt den Header selbst.
|
||||
async function uploadFile(file) {
|
||||
const { data } = await supabase.auth.getSession();
|
||||
const token = data?.session?.access_token;
|
||||
@@ -34,10 +34,11 @@ async function uploadFile(file) {
|
||||
}
|
||||
|
||||
export const api = {
|
||||
listPosts: () => call('/posts'),
|
||||
createPost: (post) => call('/posts', { method: 'POST', body: JSON.stringify(post) }),
|
||||
updatePost: (id, post) => call(`/posts/${id}`, { method: 'PUT', body: JSON.stringify(post) }),
|
||||
preview: (id) => call(`/preview/${id}`, { method: 'POST' }),
|
||||
publish: (id) => call(`/publish/${id}`, { method: 'POST' }),
|
||||
list: () => call('/content'),
|
||||
read: (path) => call(`/content/entry?path=${encodeURIComponent(path)}`),
|
||||
save: (path, frontmatter, body) =>
|
||||
call('/content/entry', { method: 'PUT', body: JSON.stringify({ path, frontmatter, body }) }),
|
||||
preview: (path) => call('/preview', { method: 'POST', body: JSON.stringify({ path }) }),
|
||||
publish: (path) => call('/publish', { method: 'POST', body: JSON.stringify({ path }) }),
|
||||
upload: uploadFile,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user