add CMS
This commit is contained in:
149
static/admin/collections.js
Normal file
149
static/admin/collections.js
Normal file
@ -0,0 +1,149 @@
|
||||
const PostCollection = {
|
||||
name: "posts",
|
||||
label: "Artikel",
|
||||
description: "Hier könnt ihr die Artikel der Schülerzeitung bearbeiten.",
|
||||
icon: "news",
|
||||
folder: "content/de/blog",
|
||||
create: true,
|
||||
editor: {
|
||||
preview: true,
|
||||
frame: true,
|
||||
size: "half",
|
||||
},
|
||||
filter: {
|
||||
field: "type",
|
||||
value: "blog",
|
||||
// pattern: "^((?!_index.md).)*$"
|
||||
},
|
||||
summary_fields: ["title", "date", "draft", "author"],
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
label: "Titel",
|
||||
widget: "string",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "draft",
|
||||
label: "Entwurf",
|
||||
widget: "boolean",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: "date",
|
||||
label: "Datum",
|
||||
widget: "datetime",
|
||||
date_format: "dd.MM.yyyy",
|
||||
time_format: false,
|
||||
format: "yyyy-MM-dd",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "author",
|
||||
label: "Autor",
|
||||
widget: "string",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
label: "Beschreibung",
|
||||
widget: "text",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: "thumbnail",
|
||||
label: "Titelbild",
|
||||
widget: "image",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "tags",
|
||||
label: "Tags",
|
||||
widget: "list",
|
||||
delimiter: ",",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: "type",
|
||||
widget: "hidden",
|
||||
default: "blog",
|
||||
},
|
||||
{
|
||||
name: "body",
|
||||
label: "Inhalt",
|
||||
widget: "markdown",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const PagesCollection = {
|
||||
name: "pages",
|
||||
label: "Seiten",
|
||||
description: "Hier könnt ihr die Zusatzseiten der Website bearbeiten.",
|
||||
icon: "page",
|
||||
folder: "content/de/page",
|
||||
create: true,
|
||||
editor: {
|
||||
preview: true,
|
||||
frame: true,
|
||||
size: "half",
|
||||
},
|
||||
summary_fields: ["title", "date", "draft", "description"],
|
||||
fields: [
|
||||
{
|
||||
name: "title",
|
||||
label: "Titel",
|
||||
widget: "string",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "draft",
|
||||
label: "Entwurf",
|
||||
widget: "boolean",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: "date",
|
||||
label: "Datum",
|
||||
widget: "datetime",
|
||||
date_format: "dd.MM.yyyy",
|
||||
time_format: false,
|
||||
format: "yyyy-MM-dd",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "author",
|
||||
label: "Autor",
|
||||
widget: "string",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: "description",
|
||||
label: "Beschreibung",
|
||||
widget: "text",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: "thumbnail",
|
||||
label: "Titelbild",
|
||||
widget: "image",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: "keywords",
|
||||
label: "Schlüsselwörter",
|
||||
widget: "list",
|
||||
delimiter: ",",
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
name: "body",
|
||||
label: "Inhalt",
|
||||
widget: "markdown",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export { PostCollection, PagesCollection };
|
38
static/admin/config.js
Normal file
38
static/admin/config.js
Normal file
@ -0,0 +1,38 @@
|
||||
import { PagesCollection, PostCollection } from "./collections.js";
|
||||
|
||||
const config = {
|
||||
backend: {
|
||||
name: "gitea",
|
||||
repo: "gcg/schuelerzeitung",
|
||||
branch: "main",
|
||||
api_root: "https://git.cantorgymnasium.de/api/v1",
|
||||
base_url: "https://oauth.cantorgymnasium.de",
|
||||
commit_messages: {
|
||||
create: "{{collection}} {{slug}} erstellt",
|
||||
update: "{{collection}} {{slug}} aktualisiert",
|
||||
delete: "{{collection}} {{slug}} gelöscht",
|
||||
updateMedia: "{{path}} hochgeladen",
|
||||
deleteMedia: "{{path}} gelöscht",
|
||||
},
|
||||
},
|
||||
local_backend: true,
|
||||
media_folder: "/static",
|
||||
public_folder: "/",
|
||||
media_library: {
|
||||
max_file_size: 10240000,
|
||||
folder_support: true,
|
||||
},
|
||||
site_url: "https://schuelerzeitung-gcg.de",
|
||||
locale: "de",
|
||||
slug: {
|
||||
encoding: "ascii",
|
||||
clean_accents: true,
|
||||
sanitize_replacement: "-",
|
||||
},
|
||||
collections: [
|
||||
PostCollection,
|
||||
PagesCollection
|
||||
],
|
||||
};
|
||||
|
||||
export default config;
|
Reference in New Issue
Block a user