Skip to content
Snippets Groups Projects
Commit 3ed62736 authored by Lars Bilke's avatar Lars Bilke Committed by Lars Bilke
Browse files

[web] Updated README.md.

parent 5b20e362
No related branches found
No related tags found
No related merge requests found
## Getting started
## Requirements
- 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:
Use shortcode `img`:
```
```go
{{< img src="../square_1e2_neumann_gradients.png" >}}
```
......@@ -46,19 +64,26 @@ Optional parameters:
- `class` - CSS class
- `alt` - Alt text
## Dump
### Visualizations
Use shortcode `vis`:
### Serve converted meshes with S3
```go
{{< vis path="Elliptic/square_1x1_GroundWaterFlow/square_1e2_pcs_0_ts_1_t_1.000000.vtu" [height="300"] >}}
```
- Set CORS: http://stackoverflow.com/a/19557452/80480
- Upload to e.g. http://s3-eu-central-1.amazonaws.com/jenkins-dump
- Eventually add `crossdomain.xml` to the root of the bucket:
`path` is relative to `ogs/web/static/vis/` and points to a converted data set, see below.
Optional parameters:
```xml
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" secure="false" />
</cross-domain-policy>
- `height` - In px
----
You can convert VTK output files to vtk.js format with:
```bash
npm run convert -- -e -i vtk-file.vtu -o output/path
```
Run `npm run convert` to get a list of possible arguments.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment