Planned directory structure
|
~/my/prj/web/ # Directory for all web projects using Nikola
|
|
~/my/prj/web/.env # Python environment with nikola and friends
|
|
~/my/prj/web/example.com # Directory of one Nikola project
|
|
~/my/prj/web/example.org # Directory of another Nikola project
|
Prepare Python envinronment
|
cd ~/my/prj/web/
|
|
mkdir .env
|
|
python3 -m venv .env/
|
|
source nikola-env/bin/activate
|
|
pip install nikola
|
|
pip install aiohttp watchdog # Enables nikola auto build function.
|
Add bash alias to activate the environment
Add the following block to the bash alias file.
|
# Activate Python Virtualenv
|
|
# create this with mkdir .env && python3 -m venv .env
|
|
alias activate=". ../.env/bin/activate"
|
Monitor the website changes
Will render the page automatically when changes are saved to the nikola files.
nikola auto --browser