The simplest way to see if Almoststatic is what you’re looking for, is to try the sample provided with source code package and explore the source code.
The following tutorial is tested on Linux Ubuntu, but it’s easy to port on other platforms such other Linux distros, Windows or Mac.
You need git and python3, install them with:
$ sudo apt install git python3 $ sudo apt install python3-dev $ sudo apt install python3-pip $ sudo apt install python3-venv
Last linux’s releases comes with python3 already installed and you have only to check if your version is 3.6 or higher:
$ python3 --version
Now clone Almoststatic with git and enter into the directory:
$ git clone https://gitlab.com/claudio.driussi/almoststatic.git $ cd almoststatic
It’s common in python using virtualenv for development, to do so and to install Almoststatic, write:
$ python3 -m venv myvenv $ source myvenv/bin/activate $ pip install almoststatic $ pip install pyftpsync
Done! Now you can try the sample, cd into sample directory and run flaskapp.py:
$ cd sample/ $ python flaskapp.py
A local host Flask App instance server is executed and you can test Almoststatic features.
Open your browser and copy and paste the following URL:
You will be redirected to the static site showing some widgets and feature of Almostatic, you can navigate to see some examples.
You can always exit from server pressing CTRL-C on your terminal.
To build static site run:
$ python write_static.py $ ls -l ../_static_site/
*.html files are created on
../_static_site/ folder, but to get
a really working static site, see configuration at: Write static pages
If you wish, you can do:
$ cd ../test $ python as_test.py
to run automatic testing.
I suggest to run it in debugger to examine how Almoststatic works in simpler cases.