Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eloi-perez/simple-content-editor
Editor.js integration for Next.js
https://github.com/eloi-perez/simple-content-editor
editorjs nextjs
Last synced: about 1 month ago
JSON representation
Editor.js integration for Next.js
- Host: GitHub
- URL: https://github.com/eloi-perez/simple-content-editor
- Owner: Eloi-Perez
- License: mit
- Created: 2021-11-17T23:33:22.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-03T19:51:22.000Z (about 2 years ago)
- Last Synced: 2023-03-10T14:17:21.429Z (almost 2 years ago)
- Topics: editorjs, nextjs
- Language: JavaScript
- Homepage:
- Size: 201 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Simple Content Editor
SCE is a [Next.js](https://nextjs.org/) project where the admin can edit the content of the pages directly in the browser using [Editor.js](https://editorjs.io/)
This project uses Static Generation so the HTML is generated at build time and will be reused on each request.
Also, it will be regenerated with each change of the content.In addition, it uses Server-side Rendering for the edit pages so the HTML is generated on each request as an admin.
## Getting Started
First, you need to create some files not included in this repository.
* In the root folder, create '.env.local' with the entries:
DB_USER=admin_user
DB_PASS=admin_password
IRON_SECRET=32_characters_long_private_key_to_encrypt_cookies
* Now in the 'data' folder, add a .json file for each of the editable pages included (atm it will be about.json and index.json)
The content of these files should be in a readable format by editor.js, this is an example you can use to bootstrap your application:`{
"time": 1637196257931,
"blocks": [
{
"id": "KOigsjrDCs",
"type": "header",
"data": {
"text": "Welcome",
"level": 2
}
}
],
"version": "2.22.2"
}`Then install all dependencies:
```bash
npm install
```Now you can run the development server:
```bash
npm run dev
```Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.