![]() And it isn't a blog engine: it's a framework for building static site generators, including blog engines. When I type "nnow" in P圜harm and hit Tab, it inserts a properly-formatted datetime. To generate publication dates, I've configured what P圜harm calls a "live template": I remove the _discoverable: no line, and set pub_date to now. Over the last few weeks I've ported my blog. It begins with an article in a contents.lr file like this: I associate this tool with a keyboard combo so that, whenever I highlight or open one of these contents.lr files in P圜harm, I can switch to MacDown with keystroke. Next, in P圜harm, I configure open as an "external tool": Now if I type open contents.lr in the Mac OS command line, it opens the file in MacDown. ![]() First, I associate all Lektor's content files, which are called contents.lr, with MacDown: I've configured my system to make it easy to switch between P圜harm and MacDown. As a surprising bonus, images display correctly. MacDown's rendering isn't perfect, since a contents.lr file has some non-Markdown metadata, but it's perfectly good for editing. Instead, I manage my project with P圜harm, my favorite Python IDE, which does a fine job of searching and organizing my Markdown files. Lektor can run a local server and show a basic in-browser editor, but I don't use it. Since the article is a local text file, the power of my programming tools is easily brought to bear.īut most of the time, I'm writing prose. I can include them all in my Markdown using an emacs macro, a Python script, or whatever I choose. I import images simply by resizing them all in one batch (a snap with Photoshop) and dropping them in a directory. Now with Lektor, my articles are just Markdown files on my hard drive, and I edit them with any tool at hand. Its Markdown editor is merely competent, it isn't built for sharing code samples, and adding multiple images to an article (which I do often) is a chore. Instead, I implemented enough of WordPress's XML-RPC API that I could edit my blog with a commercial WordPress client, MarsEdit. Since the blog engine was just a side-project I skipped the hard part: I never wrote an editor. ![]() ![]() I wrote it to exercise my async MongoDB driver, Motor. Motor-Blog is my basic blog engine written in Python. The other is the comparison between running a dynamic server versus deploying a static site. One is the comparison between Lektor and my homemade blog software, Motor-Blog. These observations fall into two categories. Lektor will grow and mature for years to come, but it isn't too early to write up my experience rebuilding a substantial site with it. Over the last few weeks I've ported this blog, with over 400 articles, to Armin Ronacher's new static site generator Lektor. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |