Settings

Theme

Introducing Lektor – A Static File Content Management System For Python

lucumr.pocoo.org

290 points by jilljennV 10 years ago · 93 comments

Reader

the_mitsuhiko 10 years ago

Direct links to project:

* Website: https://www.getlektor.com/

* Github: https://github.com/lektor/lektor

Would be really curious to hear how people like it :)

  • freyr 10 years ago

    You need to make sure you have the following software installed on your computer:

    - Python 2.7 (not Python 3.x)

    I've read some of your remarks about Python 3, but it seemed like you were (at least begrudgingly) accepting the shift to Python 3. So why no forwards compatibility here? Any plans to support Python 3 in the future?

    • the_mitsuhiko 10 years ago

      I build this originally for myself and i don't use python 3. I'm happy to accept patches for python 3. I think it should not be hard.

      • bootload 10 years ago

        "I build this originally for myself and i don't use python 3"

        Great to see another useful bit of software created. Did you miss the opportunity to build it in Python3?

  • techdragon 10 years ago

    It's quite late for me so I've only had time to read the documentation, but so far I love what I see. I've had a goal of building the static site tool I've wanted to use for a long time now, name chosen and everything, but you may have built something nice enough I don't need to.

    If this is as nice yo use as the documentation leads me to believe it will be, I may just turn some of my existing exploratory code into plugins for this instead of building my own entire tool around them.

  • bliti 10 years ago

    Very nice. I had been building the same thing after wanting something more than pelican and less than wordpress. This seems to fit perfectly.

    Is there a roadmap for contributing to the project? I failed to see one on github.

    • the_mitsuhiko 10 years ago

      > Is there a roadmap for contributing to the project? I failed to see one on github.

      Nope. Hoping to get some feedback to see what people need. It does what I need pretty much at the moment. Just figured i add some docs and share it as some sort of Christmas or whatever else you celebrate present.

    • subnaught 10 years ago

      Would you mind listing some specific features you're interested in? I ask because I've recently switched from WordPress to Pelican, and I'm quite happy, so far at least.

  • eliben 10 years ago

    Looks nice, Armin

    A question (that will surely become a FAQ) - how does this compare with Pelican? Is this a non-programmer-friendlier alternative to Pelican?

    • the_mitsuhiko 10 years ago

      It is. But it also is a lot more flexible. It's more of a framework than a simple generator.

      • eliben 10 years ago

        Interesting. Being a framework and more flexible sounds like something that's more programmer oriented rather than more "common people" oriented. I'll check out how you managed to pull this off once I get some free time

  • detaro 10 years ago

    the ini-file configuration seems a bit strange to me(esp since it seems to be ini-files that occasionally contain python code). Why did you go with them instead of making these python classes? To allow the GUI to edit parts of them as well?

    • the_mitsuhiko 10 years ago

      > the ini-file configuration seems a bit strange to me(esp since it seems to be ini-files that occasionally contain python code). Why did you go with them instead of making these python classes? To allow the GUI to edit parts of them as well?

      I grew to heavily dislike the idea of just executing random code to configure things. Impossible to expose to tools, even harder to reason about it. Note that these files do not contain python code at all. They just sometimes contain little Jinja templates.

      The idea is indeed that the GUI can eventually edit some of these things. It also is already used for `lektor plugins add` for instance which updates the project ini file.

      Lastly the reason ini over yaml is purely that this can preserve comments and doing the same for yaml is a lot more work i did not have time for :)

      • crdoconnor 10 years ago

        >Lastly the reason ini over yaml is purely that this can preserve comments and doing the same for yaml is a lot more work i did not have time for :)

        Was that the only thing that bothered you about YAML/pyyaml or were there other things you'd like to see fixed?

      • detaro 10 years ago

        Thanks. Yes, the code-as-configuration thing is difficult, it invites people to do very strange things sometimes.

            [children]
            replaced_with = site.query('/projects').filter(F.categories.contains(this))
        
        (from the categories example) looked a lot like embedded code to me ;)
  • hasenj 10 years ago

    I always love your work, Armin. Definitely sounds like something I've been looking for for ages. Definitely will give it a try.

  • rdtsc 10 years ago

    This looks nice! Thanks for sharing it.

vinceguidry 10 years ago

My feeling is that every serious programmer will end up inventing tools like this simply because the overhead of incorporating other people's tools eventually starts to overtake the overhead of maintaining one's own system.

  • currysausage 10 years ago

    Let's not forget that Lektor solves actual problems. Show me another CMS that offers:

    - Static HTML export with elegant dependency tracking by design (reducing attack vectors and maintenance cost on the frontend server)

    - Admin interface (I can't tell a non-techie to connect via SSH, fire up vi and run Jekyll)

    - Flexible content structure (Title/Author/Content doesn't really scale beyond a simple blog)

    - Elegant design and implementation (I could do anything with WordPress and half a dozen plugins, but I fail to even find a bare-bones theme without kilobytes of code that I will never need; the whole ecosystem revolves around the novice user who understandably prefers "quick and dirty" over touching code)

    I have been looking for a CMS that fulfills these exact criteria for quite some time. Lektor looks ideal for projects where the developer prepares a non-trivial page structure (think book listings, music albums, anything that goes beyond bold and italic), but the client should be able to edit content. Thank you, Armin!

    • hanniabu 10 years ago
      • scotchio 10 years ago

        Checkout SpudPress - Static WordPress hosting. All the same except you can use WordPress theming and Admin. If you know how to distinguish between static and dynamic. It's insanely useful

        http://spudpress.com

        • isoos 10 years ago

          I think a lot of people who would love to use a self-hosted version of this. However, paying for $20/m is usually not worth for a hobby/blog site.

      • the_mitsuhiko 10 years ago

        Correct me if I'm wrong but they are either hosted CMS solutions (Grav, Cockpit) or static website generators (Harp) like Jekyll and friends.

        • hanniabu 10 years ago

          Harp actually is a static generator (didn't think it was, never used before).

          And yes, Grav and Cockpit are self-hosted flat-file CMS, but now that you ask makes me confused. I was under the impression that Lektor was similar where you have a flat-file CMS and whenever a change is made, the static files are created.

          My second guess is that this actually a CMS that exists locally and deploys static files when a change is made?

          • detaro 10 years ago

            Lektor is a static site generator: it generates a "compiled" version of the site that is uploaded to a simple web server, without any server-side scripts running. If you want to edit something, you run it locally, make your changes, generate new files and copy those to the web server.

            The key addition is that there is a nice UI for adding content in the system running locally, so it can be used by less technical users that might not feel comfortable with writing in text files with special tags/metadata, as traditional static generators require.

    • ar-jan 10 years ago

      GravCMS perhaps? http://getgrav.org

      • currysausage 10 years ago

        Grav advertises "smart caching", so it's not static export by design, is it?

        • ar-jan 10 years ago

          You're right, it's not a static site generator, but a (very fast) dynamic flat file CMS. I guess I got this mixed up because I found it while looking into static site generators.

    • gotchange 10 years ago

      Did you test this generator in production? If not, the verdict is not out yet on Lektor and remains to be seen how it will fare in production environments and on the battlefields.

  • the_mitsuhiko 10 years ago

    I think that's why we have so many static site generators. However programmers typically end up just making the static site generator which is why there was nothing like Lektor before (to the best of my knowledge at least).

  • gotchange 10 years ago

    That's the problem with Static Site Generators (SSG) in general. They're opinionated by nature and the learning curve could prove steep to process all the details of the configurations necessary to get the maximum mileage out of the framework but as you dig deeper and deeper, you realize that you'd be better off building your own framework that's fit to your objectives and use cases and improve and expand on that as you go along.

    • jnbiche 10 years ago

      I disagree. The great thing about SSGs like Jekyll and Middleman is that they're very easy to build plugins for. Jekyll in particular is easy to learn, and easy to expand. I honestly can't imagine a bona fide programmer having that much difficulty picking up Jekyll.

      If you did want to build a custom SSG, I think you're best bet is starting from Gulp, and building from there. At least then you can leverage the Gulp ecosystem instead of re-building everything yourself.

    • vinceguidry 10 years ago

      I'm building my own productivity software program using Rails for this reason. I want to see only what I want to see on that page, I want nobody else's ideas getting in the way. It has an intended audience of exactly one, and will in all likelihood never acquire another user.

  • wanda 10 years ago

    Yep.

    I dare say it's how many currently-popular products came into being.

  • amai 10 years ago
  • code4tee 10 years ago

    :-)

qwertyuiop924 10 years ago

I always love Armin's stuff. In quality, it's often near that oh-so-very-special spot that is reserved for Steve Yegge's best posts. Now I will simultaneously be lynched by both the people who think that Steve sucks, and the people who think that Steve's stuff is 1 million times better than anything Armin could ever post. Not to mention 500 other groups who I don't even know.

  • auvrw 10 years ago

    nope, you're upvoted b/c i also appreciate source-level userfriendliness of pocoo projects

davepeck 10 years ago

From the original post:

> There is very little innovation in that space and that's a bit unfortunate

I'll have to respectfully disagree with Armin here, but perhaps I map the terrain a little differently than he does.

In addition to the half-dozen tools he names, which are more narrowly targeted at blog-like static sites, the broader space of asset pipelines and static generation is seeing a lot of innovation. I'd point to Gulp and Rails' latest as a sign that there's more work to do here. Even strictly in the Django world, there are a zillion asset-pipeline-like-apps; django-compressor and django-pipeline, the two most used, are quite different in their approach and philosophy.

I'm excited by this proliferation of tools for generating static web content "offline" and expect to see far more in the future. Lektor looks like another interesting piece to the puzzle, particularly in its focus on end-users rather than programmers. (Anyone remember Movable Type? That's probably the first user-centric static site generator to gain widespread use?)

  • the_mitsuhiko 10 years ago

    > I'd point to Gulp and Rails' latest as a sign that there's more work to do here.

    If you want to throw them into the same category, then sure, there is different stuff happening. But Gulp is even further away from something non programmers can use.

    • davepeck 10 years ago

      I definitely do see gulp et. al. as belonging to the same category of tools, although they're much more general-purpose. I think that's where I map the terrain differently than you. I do so because I'm hopeful that future innovations there will find their way back to tools like Lektor, etc.

      (And completely agree on the programmer-centric nature of these tools.)

gamesbrainiac 10 years ago

Armin Ronacher just makes more and more awesome stuff. I think I'm going to ditch my pelican site, and go for Lektor.

gotchange 10 years ago

I'm really suffering from an acute case of Analysis Paralysis when it comes to Static Site Generators. The offerings on the market are overwhelming and you don't know which one to pick, do you go with an incumbent or mainstream like Jekyll with a huge selection of functionality at your disposal or go for the underdog and minimal one offering just the basics or just build your own framework and adapt to the evolving needs of your projects over its lifetime.

If you're thinking that the scene of MVC JavaScript frameworks resembles more of the good ol' days of the Wild Wild West, wait to see how things are currently like on the SSG front.

  • princeb 10 years ago

    i had this problem a week ago- ended up building an ultra-low-frills low-dependency one in an afternoon just a few weeks ago. Seems silly - i am pretty sure with sufficient time investment i am better off learning how to use popular frameworks (because learning how to use frameworks will make me better at learning how to use frameworks).

  • copperx 10 years ago

    I'm in the same situation. I think I'm going to go with Pandoc + make and escape SSGs altogether.

ngrilly 10 years ago

Considering that one of the project's main goals is to address the needs of non-programmers, do you plan to add an improved Markdown editor (with some syntax highlighting and maybe buttons for things like titles, bold, etc.)?

dwightgunning 10 years ago

This looks great! The native desktop app is a powerful way to drive adoption with non-technical people.

Cactus was on the right track with that although I'm fairly sure the author, Koen Bok is now focussed on his company, Framer. Are there plans to build clients for other platforms? I guess the community can jump in at any time.

Sidenote: do people know of native clients for the other major static site generators like Jekyll, Hugo, Middleman?

Shameless plug: If you're looking for somewhere to host your static site, please check out my side project, http://www.knownly.net

  • wuster 10 years ago

    I want to also vote up Cactus despite the lack of attention paid to it lately. IMO it's very well designed and deserves to be worked on by a wider community.

    It's open sourced via BSD 3 clause: https://github.com/koenbok/cactus

    I especially liked the "deploy to s3" feature, IMO the cheapest way to run a highly scalable static site today.

    Alternatively, a "deploy to GitHub page" would be neat as well.

    I would work on extending Cactus if it was a bigger problem personally, but so far what's released fits my needs already.

rcarmo 10 years ago

Very neat. Static site generators are hard to get right (I've been hacking away at a hybrid solution at http://sushy.no-bolso.com / http://blog.carmo.io - same engine, different themes).

I do have two questions, though. Why the new file extension (.lr) and the field separator?

Jekyll's front matter format is easier for most people - and my engine uses a plain newline to separate front matter from text, and supports multiple file extensions to make it easier for desktop editors.

  • the_mitsuhiko 10 years ago

    The .lr format is easy to explain: it conforms to data models and is easy to parse and generate. Frontmatter does not fit into these requiements. I tried it quite a bit but it makes everything more complex. Not worth it.

    • rcarmo 10 years ago

      Well (and this is only an opinion) having to separate each field makes it harder to edit manually, and a new file extension will be a hassle for non-technical users who want to use their favorite editor.

      (I went with .txt/.md/.textile to support multiple markup engines and make it easier for people to edit with literally anything)

      • the_mitsuhiko 10 years ago

        > Well (and this is only an opinion) having to separate each field makes it harder to edit manually, and a new file extension will be a hassle for non-technical users who want to use their favorite editor.

        A non technical user would use the admin interface.

        Obviously a custom file extension is not particularly nice but there is really not that much one can do around that. Renaming the file to `.md` will not magically make things better because the contents are just wrong and the Markdown format just does not do what Lektor needs.

  • currysausage 10 years ago

    > Why the new file extension (.lr) and the field separator?

    This made me chuckle. Many comments seem to fall into two categories: 1) How is it different from SSG_X? 2) Why is it different from SSG_X? (Both are valid questions, no doubt.)

    The flexibility in content structure is what makes Lektor a more framework-like CMS. The possible complexity can't really be represented with newlines. For example, my "Abstract" field might be several paragraphs long.

jeffwidman 10 years ago

> Lektor belongs to a separate org and the project does not use any resources only I have access to (other than the domain name and the server travis-CI deploys to).

Really appreciate you starting it out this way from the getgo.

> Because I run so many Open Source projects and maintenance of all of them turns out to be tricky I figured I do this better this time around.

Looking forward to seeing Flask & Flask-SQLAlchemy moved to a dedicated Flask org on github. Ideally with another person or two having Pypi creds for pushing releases.

ngrilly 10 years ago

Armin, are you not afraid that having to install Lektor locally could be a serious obstacle for "people that have no understanding of programming"?

  • voltagex_ 10 years ago

    I wonder how hard it'd be to bundle up into a single executable that the user could run. I know I've been battling with Python -> exe tools ever since I started using Python, though.

    • the_mitsuhiko 10 years ago

      There is a bundled cersion for osx with a ui. Just didn't have the time to do it for windows and linux.

cdnsteve 10 years ago

Respectfully, I don't think this puts this project outside the scope of any other static site generators as listed.

In my view a content only API would be more disruptive. A smart content API as a service could be used for any project. Give it a beautiful interface for authors and focus on the writing experience.

Maybe this is Mediums potential new market/ platform. What if you could grab and query your content with a smart api with graphql? No updates, servers, etc.

Any new project I used, I grab my content from this saas and use whatever tech/framework I want. Why aren't more devs looking at this as an option going forward?

  • jsdalton 10 years ago

    Services such as the one you describe do exist, e.g. [Contentful](https://www.contentful.com/). I've used it on a few projects and it's pretty awesome.

    The only thing it's missing from your description is graphql. :)

programminggeek 10 years ago

This looks really interesting. I always love seeing new static site builders. Each one is a bit different, which is cool.

I'm working on making hosting for static sites easier. My static hosting service is still in beta, but we have a sign up form if people are interested. http://www.statichosting.co/

  • hatchoo 10 years ago

    Thanks for the link Brian. The "Get In Line For The Beta" button does not work for me (it does not do anything).

Michael_L 10 years ago

Out of topic: When the next version of Flask will be released? Does Flask has a roadmap or it is "abandonware"?

mxuribe 10 years ago

This is great! I'm using pelican and while a very good tool, I was considering building out a desktop/local-front-end for it...But this is MUCH better than what I could build (with my current level of expertise)...i think i'll be using this, and seriously consider contributing! Kudos @mitsuhiko!

pkd 10 years ago

I love Armin's work, especially Flask, but this seems like lot of other products out there. I have no incentive to switch to this from the generator I'm already using, and for non-techy people I think it's still a big jump in terms of just opening up a tumblr blog.

  • the_mitsuhiko 10 years ago

    > for non-techy people I think it's still a big jump in terms of just opening up a tumblr blog

    True, but that's not the audience anyways. The idea is that if you (as a web developer) want to make a portfolio site for a customer you could use lektor instead of wordpress or something like this. I generally always prefer static website generators for my own work but I cannot give it to a non technical person to fill with content. That's what motivated it.

    But nobody needs to switch for anything. It's just another tool in the shed :)

  • tedmiston 10 years ago

    > ...just opening up a tumblr blog

    [I run a Tumblr software blog at http://sandpaper.io.]

    A related idea on my mind lately is using Tumblr just as a backend CMS. Then pull the content via their API to display to end users on a separate site. For example, with a bot that automates publishing to a gh-pages branch.

    The motivation is that their editing tools and app are so nice, but their presentation makes a site feel less professional. (Also because of the limited abilities to tweak CSS, use JS, and optimize performance can be a bit frustrating.)

  • Torgo 10 years ago

    What other static file CMS are you using?

    • pkd 10 years ago

      I don't use a static file "CMS", but I use my own generator[1] which I made because I wanted something really fast. If you want a flat file cms, then a Google search will throw a lot of them. Kirby is the most popular, IMO. But it's not FLOSS. PicoCMS ticks all those boxes though.

      [1] https://github.com/pawandubey/griffin

      • Torgo 10 years ago

        I wanted a "full" CMS and a GUI, and it looks like finally I got one now. I hadn't seen another static generator that had a GUI of any kind (that seemed to be supported.)

  • NamPNQ 10 years ago

    As he said in blog, another framework is not enough easy use for non-tech user

Socketubs 10 years ago

Nice stuff! (Again and again :)) What's about multi-language website? Tips? Advice?

amai 10 years ago

Urubu (A micro CMS for static websites, with a focus on good navigation practices.) might be an alternative: http://urubu.jandecaluwe.com/

johnchristopher 10 years ago

Does it support some kind of live preview mode (like with HarpJS) ?

  • the_mitsuhiko 10 years ago

    Depends on what you mean by live. If you hit the save button the page renders immediately and you can see it. It rebuilds as files change.

lifeisstillgood 10 years ago

Hmm - gonna have to steal this for a project in new year. This comment is more a bookmark than any contribution to society

krick 10 years ago

I found sculpin pretty much perfect, but having a built-in admin panel is a nice touch.

Siecje 10 years ago

Why did you call it Lektor?

  • frakkingcylons 10 years ago

    It's German for editor. I'm gonna guess for the same reason that his WSGI library is called Werkzeug (tool).

mars 10 years ago

i like http://www.mkdocs.org, it's also python based.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection