add decapcms
This commit is contained in:
parent
f6c545a946
commit
0f676e064c
5 changed files with 123 additions and 0 deletions
110
static/admin/config.yml
Normal file
110
static/admin/config.yml
Normal file
|
@ -0,0 +1,110 @@
|
||||||
|
backend:
|
||||||
|
name: gitea
|
||||||
|
repo: Noveria/noveria.org
|
||||||
|
app_id: <fill-me-out>
|
||||||
|
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' }
|
13
static/admin/index.html
Normal file
13
static/admin/index.html
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<meta name="robots" content="noindex" />
|
||||||
|
<title>Content Manager</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- Include the script that builds the page and powers Decap CMS -->
|
||||||
|
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
0
static/blog/assets/data/.gitkeep
Normal file
0
static/blog/assets/data/.gitkeep
Normal file
0
static/blog/assets/uploads/.gitkeep
Normal file
0
static/blog/assets/uploads/.gitkeep
Normal file
0
static/blog/posts/.gitkeep
Normal file
0
static/blog/posts/.gitkeep
Normal file
Loading…
Reference in a new issue