From 0f676e064c684a4d8a55e15943c7437feab5cbcd Mon Sep 17 00:00:00 2001 From: LinuxSquare Date: Tue, 2 Apr 2024 20:49:42 +0200 Subject: [PATCH] add decapcms --- static/admin/config.yml | 110 ++++++++++++++++++++++++++++ static/admin/index.html | 13 ++++ static/blog/assets/data/.gitkeep | 0 static/blog/assets/uploads/.gitkeep | 0 static/blog/posts/.gitkeep | 0 5 files changed, 123 insertions(+) create mode 100644 static/admin/config.yml create mode 100644 static/admin/index.html create mode 100644 static/blog/assets/data/.gitkeep create mode 100644 static/blog/assets/uploads/.gitkeep create mode 100644 static/blog/posts/.gitkeep diff --git a/static/admin/config.yml b/static/admin/config.yml new file mode 100644 index 0000000..120f900 --- /dev/null +++ b/static/admin/config.yml @@ -0,0 +1,110 @@ +backend: + name: gitea + repo: Noveria/noveria.org + app_id: + api_root: https://codeberg.org/api/v1 + base_url: https://codeberg.org + auth_endpoint: https://codeberg.org/login/oauth/authorize + branch: main + +site_url: https://noveria.org + +publish_mode: simple +media_folder: static/blog/assets/uploads + +collections: # A list of collections the CMS should be able to edit + - name: 'posts' # Used in routes, ie.: /admin/collections/:slug/edit + label: 'Posts' # Used in the UI + label_singular: 'Post' # Used in the UI, ie: "New Post" + description: > + The description is a great place for tone setting, high level information, and editing + guidelines that are specific to a collection. + folder: 'static/blog/posts' + slug: '{{year}}-{{month}}-{{day}}-{{slug}}' + summary: '{{title}} -- {{year}}/{{month}}/{{day}}' + create: true # Allow users to create new documents in this collection + view_filters: + - label: Posts With Index + field: title + pattern: 'This is post #' + - label: Posts Without Index + field: title + pattern: front matter post + - label: Drafts + field: draft + pattern: true + view_groups: + - label: Year + field: date + pattern: \d{4} + - label: Drafts + field: draft + fields: # The fields each document in this collection have + - { label: 'Title', name: 'title', widget: 'string', tagname: 'h1' } + - { + label: 'Publish Date', + name: 'date', + widget: 'datetime', + date_format: 'YYYY-MM-DD', + time_format: 'HH:mm', + format: 'YYYY-MM-DD HH:mm', + } + - name: authors + label: Authors + label_singular: 'Author' + widget: list + fields: + - { label: 'Name', name: 'name', widget: 'string', hint: 'First and Last' } + - { label: 'Description', name: 'description', widget: 'markdown' } + - label: 'Cover Image' + name: 'image' + widget: 'image' + required: false + tagname: '' + + - { label: 'Body', name: 'body', widget: 'markdown', hint: 'Main content goes here.' } + + - name: 'settings' + label: 'Settings' + delete: false # Prevent users from deleting documents in this collection + editor: + preview: false + files: + - name: 'general' + label: 'Site Settings' + file: 'static/blog/assets/data/settings.json' + description: 'General Site Settings' + fields: + - { label: 'Global title', name: 'site_title', widget: 'string' } + - label: 'Post Settings' + name: posts + widget: 'object' + fields: + - { + label: 'Number of posts on frontpage', + name: front_limit, + widget: number, + min: 1, + max: 10, + } + - { label: 'Default Author', name: author, widget: string } + - { + label: 'Default Thumbnail', + name: thumb, + widget: image, + class: 'thumb', + required: false, + } + + - name: 'authors' + label: 'Authors' + file: 'static/blog/assets/data/authors.yml' + description: 'Author descriptions' + fields: + - name: authors + label: Authors + label_singular: 'Author' + widget: list + fields: + - { label: 'Name', name: 'name', widget: 'string', hint: 'First and Last' } + - { label: 'Description', name: 'description', widget: 'markdown' } diff --git a/static/admin/index.html b/static/admin/index.html new file mode 100644 index 0000000..790f7a8 --- /dev/null +++ b/static/admin/index.html @@ -0,0 +1,13 @@ + + + + + + + Content Manager + + + + + + diff --git a/static/blog/assets/data/.gitkeep b/static/blog/assets/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/static/blog/assets/uploads/.gitkeep b/static/blog/assets/uploads/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/static/blog/posts/.gitkeep b/static/blog/posts/.gitkeep new file mode 100644 index 0000000..e69de29