Updated README
This commit is contained in:
parent
659e406c5e
commit
bffbd0c873
61
README.org
61
README.org
@ -46,58 +46,41 @@
|
|||||||
that is also simple: it is the only one that provides a ~--watch~ option so
|
that is also simple: it is the only one that provides a ~--watch~ option so
|
||||||
it automatically recompiles SCSS code to CSS when the SCSS code is changed.
|
it automatically recompiles SCSS code to CSS when the SCSS code is changed.
|
||||||
|
|
||||||
** How to run this backend
|
** How to run this project
|
||||||
This backend delivers only two main files:
|
This backend delivers only two main files:
|
||||||
- =/dart/main.dart.js= The main dart file compiled to Javascript (you don’t
|
- =/dart/main.dart.js= The main dart file compiled to Javascript (you don’t
|
||||||
need to worry about the others),
|
need to worry about the others),
|
||||||
- =/style/style.css= The main style file compiled to CSS.
|
- =/style/style.css= The main style file compiled to CSS.
|
||||||
This is everything you need for beautiful org-generated websites.
|
This is everything you need for beautiful org-generated websites.
|
||||||
|
|
||||||
*** Running locally
|
While I tried to run this inside a Docker environment serving the Dart and
|
||||||
You could install Dart on your machine, as well as the Ruby implementation
|
CSS files on a HTTP port to which I tried to redirect requests, I found the
|
||||||
of SASS with its dependencies. Next, you will need to install ~webdev~ and
|
easiest way was to actually compile everything into a ~build~ directory and
|
||||||
install the Dart dependencies:
|
to simlink its content to the root directory of your org website like so:
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
$ pub global activate webdev
|
cd /path/to/your/org/website
|
||||||
$ pub get
|
ln -s /path/to/your/owb/directory/*
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
By the way, you have to ensure your Dart cache’s bins are in your ~$PATH~.
|
Here is what I add at the top of my org files in order to get it working:
|
||||||
They are generally installed in your ~$HOME/.pub-cache/bin~ directory.
|
#+BEGIN_SRC org
|
||||||
|
,#+HTML_HEAD_EXTRA: <link rel="stylesheet" href="/style/style.css"/>
|
||||||
|
,#+HTML_HEAD_EXTRA: <script defer src="/dart/main.dart.js"></script>
|
||||||
|
#+END_SRC
|
||||||
|
In this order, it will make your website display stuff a bit faster.
|
||||||
|
|
||||||
Then, you have to run ~start.sh~, and you’re good to go! Content will be
|
To compile the project, you will need to install Dart on your machine as well
|
||||||
delivered on the 8080 port. If you wish to deliver content to another port,
|
as a SCSS compiler. While the latter is up to you, make sur the result CSS
|
||||||
you can edit this file.
|
files are in the same directory as their original SCSS counterpart. As for
|
||||||
|
the Dart part of the project, you can run the following to create a release
|
||||||
|
build of the project:
|
||||||
#+BEGIN_SRC sh
|
#+BEGIN_SRC sh
|
||||||
./start.sh
|
pub global activate webdev
|
||||||
|
webdev build -r
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Docker
|
If ~pub~ is not found as an executable, make sure ~$HOME/.pub-cache/bin~ is
|
||||||
A Dockerfile is also provided so you can run this server inside a Docker
|
in your ~$PATH~. Same goes for ~webdev~ even after you install it.
|
||||||
container, and thus you can avoid the hassle of installing Dart and Ruby
|
|
||||||
Sass. In order to run OWB, you can first build the Docker image:
|
|
||||||
#+BEGIN_SRC sh
|
|
||||||
docker build . --tag owb:1.0
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
And then you can run it:
|
|
||||||
#+BEGIN_SRC sh
|
|
||||||
docker run \
|
|
||||||
-p 8080:8080 \
|
|
||||||
-v ./web:/app/web \
|
|
||||||
--restart always \
|
|
||||||
--detach \
|
|
||||||
--name owb \
|
|
||||||
owb:1.0
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
*** Docker-compose
|
|
||||||
This repository also provides a ~docker-compose.yml~ file for easier Docker
|
|
||||||
usage with ~docker-compose~. If you wish to run your backend in
|
|
||||||
release-mode, simply run the following:
|
|
||||||
#+BEGIN_SRC sh
|
|
||||||
docker-compose up --detach
|
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
** Running in development mode
|
** Running in development mode
|
||||||
# To run this backend in development mode, you will have to remove the
|
# To run this backend in development mode, you will have to remove the
|
||||||
|
Reference in New Issue
Block a user