From 0dedc852afe2be18bdc973485296e4bf97095671 Mon Sep 17 00:00:00 2001 From: Colin-XKL Date: Tue, 21 Sep 2021 17:27:53 +0800 Subject: [PATCH] add netlify cms --- static/admin/config.yml | 49 +++++++++++++++++++++++++++++++++++++++++ static/admin/index.html | 15 +++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 static/admin/config.yml create mode 100644 static/admin/index.html diff --git a/static/admin/config.yml b/static/admin/config.yml new file mode 100644 index 0000000..1888531 --- /dev/null +++ b/static/admin/config.yml @@ -0,0 +1,49 @@ +backend: + name: github + repo: Colin-XKL/Colinx-Blog +# This line should *not* be indented +publish_mode: editorial_workflow +# These lines should *not* be indented +media_folder: "static/images/uploads" # Media files will be stored in the repo under static/images/uploads +public_folder: "/images/uploads" # The src attribute for uploaded media will begin with /images/uploads +slug: + encoding: "unicode" + clean_accents: true + sanitize_replacement: "_" +collections: + - name: "blog" # Used in routes, e.g., /admin/collections/blog + label: "Blog" # Used in the UI + folder: "content/posts" # The path to the folder where the documents are stored + create: true # Allow users to create new documents in this collection + format: "frontmatter" + slug: "{{year}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md + fields: # The fields for each document, usually in front matter + - { label: "Title", name: "title", widget: "string" } + - { + label: "Date", + name: "date", + widget: "datetime", + date_format: "YYYY-MM-DD", + time_format: "HH:mm", + preview: false, + } + - { + label: "Last Mod Date", + name: "lastmod", + widget: "datetime", + date_format: "YYYY-MM-DD", + time_format: "HH:mm", + preview: false, + required: false, + } + - { + label: "Featured Image", + name: "cover", + widget: "image", + required: false, + } + - { label: "Description", name: "description", widget: "text" } + - { label: "Draft", name: "draft", widget: "boolean", default: false } + - { label: "Categories", name: "categories", widget: "list" } + - { label: "Tags", name: "tags", widget: "list" } + - { label: "Body", name: "body", widget: "markdown" } diff --git a/static/admin/index.html b/static/admin/index.html new file mode 100644 index 0000000..86303d8 --- /dev/null +++ b/static/admin/index.html @@ -0,0 +1,15 @@ + + + + + + + Document + + + + + + + + \ No newline at end of file