Python Static website generator fits well with Modern web
In common static website generator like Jekyll, it transforms plain text like mardown to html.
Jekyll is blog-friendly generator, but Jikji
is general-purpose static website generator that communicates with DBMS or RESTFul API Server.
$ pip install jikji
$ jikji <my_site> generate
You don't have to generate all the time after modifying template.
Jikji
has useful function to develop in realtime
Run jikji as listening mode
$ jikji <my_site> listen
$ jikji <my_site> listen --port PORT --host HOST
Then you can see rendered website in your browser (default: http://localhost:7000)
When you reload the website running with Flask, jikji will do re-rendering the template.
- Fast. Jikji use multiprocessing on generation
- Expandability. You can build from micro web to enterprise-class website.
- Efficiency. You can write code fastly with familiar libraries/design pattern.
Jikji
uses Jinja2 template engine which is used in Flask.
You can see jinja template documentation on here.
Jikji has a concept View
, which is similar to Controller
on common backend framework
One View
has one 'URL rule', one 'View Function', and multiple 'Pages'.
Usually, the controller has the role of taking the data from the model with the PARAMETERS in URL and returning the HTML with the View.
In static web, PARAMETERS are provided in advance. There are many tuple set of parameters in ONE VIEW.
Jikji calls the tuple Page
For example, 'Article View' has url rule /posts/$1/$2
The sample PAGEs for 'Article View' will have the following.
/posts/dev/best-sublime-text-3-themes-of-2016
/posts/dev/the-best-news-from-angulars-ng-conf