Good news: getting started with barely is super easy! So we will keep this short. For more info on Getting Started, see this page in the docs.
read full documentationMake sure you have Python >= 3.9 installed:
1 2 | $ python -V Python 3.9.x |
(On Windows: py -V
)
It is highly recommended to create a virtual environment for barely:
1 2 3 | $ python -m venv .venv $ . .venv/bin/activate (.venv) $ |
(On Windows: py -m venv .venv
and .venv\Scripts\activate
)
Now, simply install barely like any other package:
1 | (.venv) $ pip install barely |
(On Windows: py -m pip install barely
)
That's it! Congrats!
Now let's get familiar with using barely!
You can create a new project with barely new
:
1 2 3 4 5 6 7 | $ barely new [barely][ core][ INFO] :: setting up new project with parameters: -> webroot: webroot -> devroot: devroot -> blueprint: default [barely][ core][ INFO] :: setting up basic config... [barely][ core][ INFO] :: done. |
Sweet! barely created two new subdirectories, devroot
and webroot
. The project was also created with a blueprint, namely default
, which is why our devroot
is not empty.
Build the project with barely rebuild
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | $ cd devroot $ barely rebuild [barely][ core][ INFO] :: registering plugins... [barely][ core][ INFO] :: 7 plugins registered. [barely][ core][ INFO] :: rebuilding devroot... -> deleted /[...]/webroot [barely][ core][ INFO] :: event at /[...]/devroot/page.md -> rendered, highlighted /[...]/devroot/page.md -> /[...]/webroot/index.html [barely][ core][ INFO] :: rebuild complete. [barely][ core][ INFO] :: Finalizing plugin ReadingTime... [barely][ core][ INFO] :: Finalizing plugin ToC... [barely][ core][ INFO] :: Finalizing plugin AutoSEO... [barely][ core][ INFO] :: Finalizing plugin Highlight... [barely][ core][ INFO] :: Finalizing plugin Forms... [barely][ core][ INFO] :: Finalizing plugin Minify... [barely][ core][ INFO] :: Finalizing plugin Gallery... [barely][ core][ INFO] :: .. -> Do you want to Publish / Backup / do both? -> *[n]othing | [p]ublish | [b]ackup | [Y]do both :: n [barely][ core][ INFO] :: exited. |
And then start the live server:
1 2 3 4 | $ barely [barely][ core][ INFO] :: registering plugins... [barely][ core][ INFO] :: 7 plugins registered. [barely][ core][ INFO] :: started tracking... |
Your favorite browser should open, and you will be greeted with the rendered version of page.md
.
These two steps can be combined by making use of the -s
flag: barely rebuild -s
starts the live server immediately after rebuilding.
Now is a good time to play around a bit with your sample project - make some changes to the contents, the templates or add a stylesheet and watch the page update in real time!
For a more thorough explanation, make sure to check out Getting Started in the docs.
There are a couple of things that are important to know about how barely works. If you've used similar frameworks before, you're probably already familiar with most of these things. barely doesn't try to reinvent the wheel.
templates/
folder.config.yaml
file, global variables to be used in your templates are stored in metadata.yaml
.This just scratches the surface; please, do yourself a favor and read the Detailed Overview in the docs.