Painless Lektor Setup in Less Than 5 Minutes

Two technologies that I have can really recommend you try out - Lektor and Cloud9 - can be used together to start a static site or blog in a matter of minutes. If you want to try out the power of Lektor without leaving a trace on your machine then follow this quick setup.

Lektor is 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.

Cloud9 combines a powerful online code editor with a full Ubuntu workspace in the cloud.

Because every Cloud9 workspace is also a Docker container, you have full access to a ubuntu system with terminal access. We can use this to install a development Lektor install and work on our static website as follows:

  • Create a new Cloud9 workspace with the Python template, as Lektor is written in Python.
  • Delete the ex50 folder
  • In the bash tab of the new workspace, install lektor by running curl -sf https://www.getlektor.com/install.sh | sh.
  • Once this completes, start a new project: lektor quickstart
  • Save a new runner (Run > Run With > New Runner) as Lektor.run containingh the following contents of code (replace myproject):

    {
        "cmd" : ["lektor", "server", "-p", "8080", "-h", "0.0.0.0"],
        "info" : "Started $project_path",
        "working_dir": "/home/ubuntu/workspace/myproject"
    }
    
  • Press the Run button to start the server, and Preview > Preview Running Application to browse the Lektor site. The admin is available under the /admin URL.

That's all there is to it, you can continue with the Lektor Quickstart instructions.

Aug 23, 2016