-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(backend): add gitea backend (#6808)
* feat(backend): add gitea backend * fix: cleanups, fixes, tests * fix: docs group * chore(naming): adapt gitea backend to new naming * fix: lint, build --------- Co-authored-by: Martin Jagodic <[email protected]> Co-authored-by: Anze Demsar <[email protected]>
- Loading branch information
1 parent
1b3bd98
commit 0d89a58
Showing
49 changed files
with
2,194 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
backend: | ||
name: gitea | ||
app_id: a582de8c-2459-4e5f-b671-80f99a0592cc | ||
branch: master | ||
repo: owner/repo | ||
|
||
media_folder: static/media | ||
public_folder: /media | ||
collections: | ||
- name: posts | ||
label: Posts | ||
label_singular: 'Post' | ||
folder: content/posts | ||
create: true | ||
slug: '{{year}}-{{month}}-{{day}}-{{slug}}' | ||
fields: | ||
- label: Template | ||
name: template | ||
widget: hidden | ||
default: post | ||
- label: Title | ||
name: title | ||
widget: string | ||
- label: 'Cover Image' | ||
name: 'image' | ||
widget: 'image' | ||
required: false | ||
- label: Publish Date | ||
name: date | ||
widget: datetime | ||
- label: Description | ||
name: description | ||
widget: text | ||
- label: Category | ||
name: category | ||
widget: string | ||
- label: Body | ||
name: body | ||
widget: markdown | ||
- label: Tags | ||
name: tags | ||
widget: list | ||
- name: pages | ||
label: Pages | ||
label_singular: 'Page' | ||
folder: content/pages | ||
create: true | ||
slug: '{{slug}}' | ||
fields: | ||
- label: Template | ||
name: template | ||
widget: hidden | ||
default: page | ||
- label: Title | ||
name: title | ||
widget: string | ||
- label: Draft | ||
name: draft | ||
widget: boolean | ||
default: true | ||
- label: Body | ||
name: body | ||
widget: markdown |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
|
||
<title>Decap CMS Development Test</title> | ||
</head> | ||
<body> | ||
<script src="/dist/decap-cms.js"></script> | ||
<script> | ||
var PostPreview = createClass({ | ||
render: function() { | ||
var entry = this.props.entry; | ||
return h( | ||
'div', | ||
{}, | ||
h('div', { className: 'cover' }, h('h1', {}, entry.getIn(['data', 'title']))), | ||
h('p', {}, h('small', {}, 'Written ' + entry.getIn(['data', 'date']))), | ||
h('div', { className: 'text' }, this.props.widgetFor('body')), | ||
); | ||
}, | ||
}); | ||
|
||
var PagePreview = createClass({ | ||
render: function() { | ||
var entry = this.props.entry; | ||
return h( | ||
'div', | ||
{}, | ||
h('div', { className: 'cover' }, h('h1', {}, entry.getIn(['data', 'title']))), | ||
h('p', {}, h('small', {}, 'Written ' + entry.getIn(['data', 'date']))), | ||
h('div', { className: 'text' }, this.props.widgetFor('body')), | ||
); | ||
}, | ||
}); | ||
|
||
CMS.registerPreviewTemplate('posts', PostPreview); | ||
CMS.registerPreviewTemplate('pages', PagePreview); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "decap-cms-backend-gitea", | ||
"description": "Gitea backend for Decap CMS", | ||
"version": "3.0.2", | ||
"repository": "https://github.com/decaporg/decap-cms/tree/master/packages/decap-cms-backend-gitea", | ||
"bugs": "https://github.com/decaporg/decap-cms/issues", | ||
"license": "MIT", | ||
"module": "dist/esm/index.js", | ||
"main": "dist/decap-cms-backend-gitea.js", | ||
"keywords": [ | ||
"decap-cms", | ||
"backend", | ||
"gitea" | ||
], | ||
"sideEffects": false, | ||
"scripts": { | ||
"develop": "yarn build:esm --watch", | ||
"build": "cross-env NODE_ENV=production webpack", | ||
"build:esm": "cross-env NODE_ENV=esm babel src --out-dir dist/esm --ignore \"**/__tests__\" --root-mode upward --extensions \".js,.jsx,.ts,.tsx\"" | ||
}, | ||
"dependencies": { | ||
"js-base64": "^3.0.0", | ||
"semaphore": "^1.1.0" | ||
}, | ||
"peerDependencies": { | ||
"@emotion/react": "^11.11.1", | ||
"@emotion/styled": "^11.11.0", | ||
"immutable": "^3.7.6", | ||
"lodash": "^4.17.11", | ||
"decap-cms-lib-auth": "^3.0.0", | ||
"decap-cms-lib-util": "^3.0.0", | ||
"decap-cms-ui-default": "^3.0.0", | ||
"prop-types": "^15.7.2", | ||
"react": "^16.8.4 || ^17.0.0" | ||
} | ||
} |
Oops, something went wrong.