Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Apr 5, 2021
1 parent faae854 commit 8685368
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 34 deletions.
31 changes: 17 additions & 14 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,12 @@ Before starting make sure your development environment is properly set. See [Vol

1. Make sure you have installed `yo`, `@plone/generator-volto` and `mrs-developer`

$ npm install -g yo
$ npm install -g @plone/generator-volto
$ npm install -g mrs-developer
npm install -g yo @plone/generator-volto mrs-developer

1. Create new volto app

$ yo @plone/volto \
my-dev-project \
--addon @eeacms/volto-columns-block \
--workspace src/addons/volto-columns-block \
--no-interactive \
--skip-install
$ cd my-dev-project
yo @plone/volto my-volto-project --addon @eeacms/volto-columns-block --workspace src/addons/volto-columns-block --skip-install
cd my-volto-project

1. Add the following to `mrs.developer.json`:

Expand All @@ -33,21 +26,31 @@ Before starting make sure your development environment is properly set. See [Vol

1. Install

$ yarn develop
$ yarn
yarn develop
yarn

1. Start backend

$ docker run -d --name plone -p 8080:8080 -e SITE=Plone plone
docker pull plone
docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone

...wait for backend to setup and start - `Ready to handle requests`:

$ docker logs -f plone
docker logs -f plone

...you can also check http://localhost:8080/Plone

1. Start frontend

yarn start

1. Go to http://localhost:3000

1. Happy hacking!

cd src/addons/volto-columns-block/
frontend

$ yarn start

1. Go to http://localhost:3000
Expand Down
61 changes: 44 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
This package gives you a block with columns. Each column is its own separate
blocks container.

###

![Initializing Columns Layout](https://raw.githubusercontent.com/eea/volto-columns-block/docs/docs/initialize.png)
![Columns Edit Example](https://raw.githubusercontent.com/eea/volto-columns-block/docs/docs/edit.png)
![Columns Sidebar](https://raw.githubusercontent.com/eea/volto-columns-block/docs/docs/columns-sidebar.png)
Expand All @@ -20,37 +18,59 @@ blocks container.

## Getting started

1. Create new volto project if you don't already have one:
### Try volto-columns-block with Docker

1. Get the latest Docker images

```
docker pull plone
docker pull plone/volto
```

1. Start Plone backend
```
docker run -d --name plone -p 8080:8080 -e SITE=Plone -e PROFILES="profile-plone.restapi:blocks" plone
```

1. Start Volto frontend

```
$ npm install -g yo @plone/generator-volto
$ yo @plone/volto \
my-volto-project \
--addon @eeacms/volto-columns-block \
--no-interactive \
--skip-install
$ cd my-volto-project
$ yarn add -W @eeacms/volto-columns-block
docker run -it --rm -p 3000:3000 --link plone -e ADDONS="@eeacms/volto-columns-block" plone/volto
```

1. If you already have a volto project, just update `package.json`:
1. Go to http://localhost:3000

### Add volto-columns-block to your Volto project

1. Make sure you have a [Plone backend](https://plone.org/download) up-and-running at http://localhost:8080/Plone

1. Start Volto frontend

* If you already have a volto project, just update `package.json`:

```JSON
"addons": [
"@eeacms/volto-columns-block"
"@eeacms/volto-columns-block"
],

"dependencies": {
"@eeacms/volto-columns-block": "^2.0.0"
"@eeacms/volto-columns-block": "^4.0.0"
}
```

* If not, create one:

```
npm install -g yo @plone/generator-volto
yo @plone/volto my-volto-project --addon @eeacms/volto-columns-block
cd my-volto-project
```

1. Install new add-ons and restart Volto:

```
$ yarn
$ yarn start
yarn
yarn start
```

1. Go to http://localhost:3000
Expand All @@ -71,3 +91,10 @@ See [LICENSE.md](https://github.com/eea/volto-columns-block/blob/master/LICENSE.
## Funding

[European Environment Agency (EU)](http://eea.europa.eu)
rved.

See [LICENSE.md](https://github.com/eea/volto-columns-block/blob/master/LICENSE.md) for details.

## Funding

[European Environment Agency (EU)](http://eea.europa.eu)
17 changes: 14 additions & 3 deletions bootstrap
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path');
const fs = require('fs');
const ejs = require('ejs');

const currentDir = path.basename(process.cwd());

Expand All @@ -8,13 +9,23 @@ const bootstrap = function (ofile) {
if (err) {
return console.log(err);
}
var result = data.replace(/volto-addon-template/g, currentDir);

fs.writeFile(ofile, result, 'utf8', function (err) {
const result = ejs.render(data, {
addonName: `@eeacms/${currentDir}`,
name: currentDir
});
const output = ofile.replace('.tpl', '');
fs.writeFile(output, result, 'utf8', function (err) {
if (err) {
return console.log(err);
}
});
if (ofile.includes('.tpl')) {
fs.unlink(ofile, (err) => {
if (err) {
return console.error(err);
}
});
}
});
}

Expand Down

0 comments on commit 8685368

Please sign in to comment.