static-cms/README.md

139 lines
4.4 KiB
Markdown
Raw Normal View History

2022-09-30 08:34:29 -04:00
<div align="center">
2022-10-02 20:06:20 -04:00
<img src="static-cms-logo.png" width="500px" />
2022-10-02 20:06:20 -04:00
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/StaticJsCMS/static-cms/blob/main/LICENSE)
[![npm latest package](https://img.shields.io/npm/v/@staticcms/core/latest.svg)](https://www.npmjs.com/package/@staticcms/core)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/StaticJsCMS/static-cms/blob/main/CONTRIBUTING.md)
2022-09-30 06:13:47 -06:00
</div>
2022-10-02 20:58:20 -04:00
[staticjscms.github.io/static-cms](https://staticjscms.github.io/static-cms/)
A CMS for static site generators. Give users a simple way to edit
and add content to any site built with a static site generator.
2022-10-11 07:51:47 -04:00
> **DISCLAIMER**: This package/repository is under heavy development and as such is very unstable at current. A stable release is targeted for the end of Novemeber and will be labeled `1.0.0`. Documentation may not be completely accurate prior to the `1.0.0` release.
## Community Chat
## How It Works
2016-06-05 12:48:28 -07:00
2022-10-02 20:06:20 -04:00
Static CMS is a single-page app that you pull into the `/admin` part of your site.
2016-06-05 12:48:28 -07:00
It presents a clean UI for editing content stored in a Git repository.
You setup a YAML config to describe the content model of your site, and typically
tweak the main layout of the CMS a bit to fit your own site.
When a user navigates to `/admin/` they'll be prompted to log in, and once authenticated
2017-03-17 16:12:25 +00:00
they'll be able to create new content or edit existing content.
2016-09-20 11:29:45 -03:00
2022-10-02 20:58:20 -04:00
Read more about Static CMS [Core Concepts](https://staticjscms.github.io/static-cms/docs/intro/).
2016-09-20 11:29:45 -03:00
2017-02-08 16:29:15 -02:00
# Installation and Configuration
2016-09-20 11:29:45 -03:00
2022-10-02 20:06:20 -04:00
The Static CMS can be used in two different ways.
2016-09-20 11:29:45 -03:00
2019-10-24 03:58:41 +10:00
* A Quick and easy install, that requires you to create a single HTML file and a configuration file. All the CMS JavaScript and CSS are loaded from a CDN.
To learn more about this installation method, refer to the [Quick Start Guide](https://staticjscms.github.io/static-cms/docs/start-with-a-template/)
* A complete, more complex install, that gives you more flexibility but requires that you use a static site builder with a build system that supports npm packages.
2017-01-22 13:09:20 +00:00
2022-10-02 20:06:20 -04:00
# static-cms-core
2022-09-30 06:13:47 -06:00
## Installation
2022-10-02 20:06:20 -04:00
`npm install @staticcms/core`
2022-09-30 06:13:47 -06:00
## Setup
```tsx
import React from 'react';
import {
AzureBackend,
BitbucketBackend,
BooleanWidget,
CodeWidget,
ColorStringWidget,
DateTimeWidget,
FileWidget,
GitGatewayBackend,
GitHubBackend,
GitLabBackend,
imageEditorComponent,
ImageWidget,
ListWidget,
MapWidget,
MarkdownWidget,
2022-10-02 20:06:20 -04:00
StaticCmsCore as CMS,
2022-09-30 06:13:47 -06:00
NumberWidget,
ObjectWidget,
ProxyBackend,
RelationWidget,
SelectWidget,
StringWidget,
TestBackend,
TextWidget,
locales,
Icon,
images
2022-10-02 20:06:20 -04:00
} from '@static-cms/static-cms-core';
2022-09-30 06:13:47 -06:00
// Register all the things
CMS.registerBackend('git-gateway', GitGatewayBackend);
CMS.registerBackend('azure', AzureBackend);
CMS.registerBackend('github', GitHubBackend);
CMS.registerBackend('gitlab', GitLabBackend);
CMS.registerBackend('bitbucket', BitbucketBackend);
CMS.registerBackend('test-repo', TestBackend);
CMS.registerBackend('proxy', ProxyBackend);
CMS.registerWidget([
StringWidget.Widget(),
NumberWidget.Widget(),
TextWidget.Widget(),
ImageWidget.Widget(),
FileWidget.Widget(),
SelectWidget.Widget(),
MarkdownWidget.Widget(),
ListWidget.Widget(),
ObjectWidget.Widget(),
RelationWidget.Widget(),
BooleanWidget.Widget(),
MapWidget.Widget(),
DateTimeWidget.Widget(),
CodeWidget.Widget(),
ColorStringWidget.Widget(),
]);
CMS.registerEditorComponent(imageEditorComponent);
CMS.registerEditorComponent({
id: 'code-block',
label: 'Code Block',
widget: 'code',
type: 'code-block',
});
CMS.registerLocale('en', locales.en);
Object.keys(images).forEach(iconName => {
CMS.registerIcon(iconName, <Icon type={iconName} />);
});
```
# Contributing
2022-10-02 20:06:20 -04:00
New contributors are always welcome! Check out [CONTRIBUTING.md](https://github.com/StaticJsCMS/static-cms/blob/main/CONTRIBUTING.md) to get involved.
2017-02-08 16:29:15 -02:00
# Change Log
2016-09-20 11:29:45 -03:00
This project adheres to [Semantic Versioning](http://semver.org/).
2022-10-02 20:06:20 -04:00
Every release is documented on the Github [Releases](https://github.com/StaticJsCMS/static-cms/releases) page.
2016-09-20 11:29:45 -03:00
2017-02-08 16:29:15 -02:00
# License
2016-09-20 11:29:45 -03:00
2022-10-02 20:06:20 -04:00
Static CMS is released under the [MIT License](LICENSE).
2017-02-08 16:29:15 -02:00
Please make sure you understand its [implications and guarantees](https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html).
2016-11-11 16:19:25 -08:00
# Netlify CMS
2022-10-02 20:06:20 -04:00
Static CMS is a fork of Netlify CMS focusing on the core product over adding massive new features.
2018-04-11 17:47:23 -04:00
# Thanks