Skip to main content
 

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:

  1. Create a new Cloud9 workspace with the Python template, as Lektor is written in Python.
  2. Delete the ex50 folder
  3. In the bash tab of the new workspace, install lektor by running: curl -sf https://www.getlektor.com/install.sh | sh
  4. Once this completes, start a new project: lektor quickstart
  5. Create a new runner (Run > Run With > New Runner) with the following contents (replace myproject):
    {
    "cmd" : ["lektor", "server", "-p", "8080", "-h", "0.0.0.0"],
    "info" : "Started $project_path",
    "working_dir": "/home/ubuntu/workspace/myproject"
    }
  6. Press the Run button to start the server, and Preview > Preview Running Application to browse the Lektor site.

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

 

 

 

WorkLog.py - work logging

I wrote this little script and thought it might be useful for others. WorkLog.py allows you to keep track of what you are working on by writing a timestamped message to a CSV file.
It turns out it helps me stay in tack during a long day of work.

worklog

I've put the latest code on GitHub

 

A great little bit of python code. It requires Python 3. Then just run the file.

 

Tweet: Python or poetry: pip install fabricfab deploysi...

Python or poetry: pip install fabric
fab deploy
sip lemonade

 

Fixing Trac after upgrading VisualSVN

If you upgraded VisualSVN Server like I have today to 1.61 and have Trac installed as per VisualSvn+Trac then you’ll notice Trac stopped working.

To fix this, follow this part of the instructions:

Add following line at the top of file C:\Program Files\VisualSVN Server\httpd-wrapper.bat:

set PYTHONHOME=%~dp0\Trac\python

Update: Later updates to VisualSvn Server break Trac.

 

TracFogbugzPlugin 0.9u-py2.5 Patch for Trac 0.11

If you use both VisualSvn + Trac (or another flavour of Subversion and Trac), and tried to integrate them with Fogbugz , you will have tried the TracFogbugzPlugin.

Trying to get this to work isn’t straightforward as it’s not compatible with Trac 0.11. You will come across the following error:

Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\trac\web\api.py", line 339, in
send_error
'text/html')
File "C:\Python25\Lib\site-packages\trac\web\chrome.py", line 684, in
render_template
data = self.populate_data(req, data)
File "C:\Python25\Lib\site-packages\trac\web\chrome.py", line 592, in
populate_data
d['chrome'].update(req.chrome)
File "C:\Python25\Lib\site-packages\trac\web\api.py", line 168, in
__getattr__
value = self.callbacks[name](self)
File "C:\Python25\Lib\site-packages\trac\web\chrome.py", line 460, in
prepare_request
for category, name, text in contributor.get_navigation_items(req):
File
"c:\Python25\lib\site-packages\tracfogbugzplugin-0.9u-py2.5.egg\fogbugz\fogb
ugz.py", line 22, in get_navigation_items
yield 'mainnav', 'fogbugz', Markup('<a href="%s">FogBuz</a>',
self.baseurl)
LookupError: unknown encoding: >/">https://<<myurl>>/

To fix this line 22 needs changed, to read:

yield 'mainnav', 'fogbugz', Markup('<a href="%s">FogBuz</a>'%self.baseurl)

Or download the file below and use it as part of the installation instructions (if this is your first Python Egg you want to read about installing Trac plugins. ;)

Now it is loading but the plugin doesn't seem to work, haha.

Download: Patched tracfogbugzplugin-09u-py25