- Download [Hugo](https://gohugo.io/#action) and put it in your `PATH`
- Install Node packages with `npm install` (or via `yarn`), *OPTIONAL* for SCSS and Javascript
- Install Python packages with `pip install -r requirements.txt`, *OPTIONAL* for getting content from [Contentful](https://app.contentful.com/spaces/4nuqzxntzxks)
- Install [Node.js](https://nodejs.org/en/), check if `npm` is in your `PATH`
- Install [Yarn](https://yarnpkg.com/en/docs/install), *OPTIONAL* faster alternative to `npm install`
- Install Python and `pip`, *OPTIONAL* for getting content from [Contentful](https://contentful.com)
- Install [ParaView](http://www.paraview.org/download/), *OPTIONAL* for converting VTK output files to vtk.js-format for interactive web visualization, check if `pvpython` is either in the `PATH` or ParaView is installed in `/Applications/` on macOS or `/usr/local/opt/paraview` on Linux
## Getting started
- Inside the source-directory `ogs/web`:
- Install Node packages with `npm install` (or via `yarn`)
- Install Python packages with `pip install -r requirements.txt`, *OPTIONAL* for getting content from [Contentful](https://contentful.com)
- Run `npm run build` to build the site which is created in `public/`
Alternatively you can simply run `make web` inside your build directory to install everything and build the site (this requires that `python`, `pip` and `npm` or `yarn` was found by CMake).
Alternatively you can simply run `make web` inside your build directory to install everything and build the site (this requires that `python`, `pip` and `npm` was found by CMake).
## Develop site with live-preview
## Start servers and watchers
In `ogs/web` run
hugo server
In your browser go to http://localhost:1313. As you make modifications to the site it will be rebuild and the page in the browser gets reloaded.
If you want to modify css or javascript run `gulp` in another terminal:
npm run gulp
## Build site
## Importing CMS content (Optional)
In `ogs/web/import` rename `secret_example.py` to `secret.py` and fill in `accessToken`.
In `ogs/web/import` run
python import.py
(cd import; python import.py) # Optional for fetching content from Contentful, needs credentials setup, rename `secret_example.py` to `secret.py`
npm run build
This fetches articles from the CMS to e.g. `ogs/web/data/news.json`.
## Used components
...
...
@@ -34,7 +52,7 @@ If you want to modify css or javascript run `gulp` in another terminal: