Edited at

Lektor 静的サイトジェネレータ

More than 3 years have passed since last update.

Jinja2Flaskの作者、mitsuhikoさんが Lektorという、静的サイトジェネレータを少し前に公開していたので、少し調べてみました。


A flexible and powerful static content management system for building complex and beautiful websites out of flat files — for people who do not want to make a compromise between a CMS and a static blog engine.

Getting your ideas implemented is as easy as making breakfast eggs.




残念ながらpython3にはまだ対応していないようで(  2.0で対応する予定らしい。 2.0には間に合わなかったようで、3.0になるみたいです。(2016-04-16))利用するにはPython2が必要です。



#lektor --help

Usage: lektor [OPTIONS] COMMAND [ARGS]...

The lektor management application.

This command can invoke lektor locally and serve up the website. It's
intended for local development of websites.

--project PATH The path to the lektor project to work with.
--language TEXT The UI language to use (overrides autodetection).
--version Show the version and exit.
--help Show this message and exit.

build Builds the entire project into the final...
clean Cleans the entire build folder.
content-file-info Provides information for a set of lektor files.
deploy Deploy the website.
dev Development commands.
plugins Manages plugins.
project-info Shows the info about a project.
quickstart Starts a new empty project.
server Launch a local server.


# lektor quickstart

Lektor Quickstart

This wizard will generate a new basic project with some sensible defaults for
getting started quickly. We just need to go through a few questions so that
the project is set up correctly for you.

Step 1:
| A project needs a name. The name is primarily used for the admin UI and
| some other places to refer to your project to not get confused if multiple
| projects exist. You can change this at any later point.
> Project Name: "プロジェクトの名前を入力"

Step 2:
| Your name. This is used in a few places in the default template to refer
| to in the default copyright messages.
> Author Name ["著者の名前"]:

Step 3:
| This is the path where the project will be located. You can move a
| project around later if you do not like the path. If you provide a
| relative path it will be relative to the working directory.
> Project Path ["プロジェクトのパス"]:

Step 4:
| Do you want to generate a basic blog module? If you enable this the
| models for a very basic blog will be generated.
> Add Basic Blog [Y/n]: Y

That's all. Create project? [Y/n] Y



├── プロジェクトの名前.lektorproject
├── assets
│   └── static
│   └── style.css
├── content
│   ├── about
│   │   └── contents.lr
│   ├── blog
│   │   ├── contents.lr
│   │   └── first-post
│   │   └── contents.lr
│   ├── contents.lr
│   └── projects
│   └── contents.lr
├── models
│   ├── blog-post.ini
│   ├── blog.ini
│   └── page.ini
└── templates
├── blog-post.html
├── blog.html
├── layout.html
├── macros
│   ├── blog.html
│   └── pagination.html
└── page.html

10 directories, 16 files


アクセスをするにはブラウザで、 にアクセスします。

# lektor server

* Project path: プロジェクトの名前.lektorproject
* Output path: /Users/*****/Library/Caches/Lektor/builds/7f3059dbd1dd5855e861340204aabf2a
* Running on (Press CTRL+C to quit)
Started source info update
Finished source info update in 0.03 sec
Started build
U index.html
U about/index.html
U projects/index.html
U blog/index.html
U static/style.css
U blog/first-post/index.html
Finished build in 0.10 sec
Started prune
Finished prune in 0.00 sec

設定を変更するには、 で管理ページにアクセスする。




Jinja2 is a full featured template engine for Python. It has full unicode support, an optional integrated sandboxed execution environment, widely used and BSD licensed.

作者 trmin Ronacher


Click is a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary. It’s the “Command Line Interface Creation Kit”. It’s highly configurable but comes with sensible defaults out of the box.

It aims to make the process of writing command line tools quick and fun while also preventing any frustration caused by the inability to implement an intended CLI API.

作者 trmin Ronacher


Python API library and shell utilities to monitor file system events.


The fastest markdown parser in pure Python, inspired by marked.


Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions. And before you ask: It's BSD licensed!

作者 trmin Ronacher


Easy to use Python module to extract Exif metadata from tiff and jpeg files.


A small INI library for Python.

作者 trmin Ronacher


Babel is an integrated collection of utilities that assist in internationalizing and localizing Python applications, with an emphasis on web-based applications.


Easily download, build, install, upgrade, and uninstall Python packages


The PyPA recommended tool for installing Python packages.


Requests is the only Non-GMO HTTP library for Python, safe for human consumption.