middleman: passing local data variables between layout and template

Middleman is a great tool for creating static websites. Recently I've been using it to redesign my own website and a scenario I encountered was wanting to pass variables between my layout and my template file. Specifically, I wanted to pass information local data (a yaml file) to my layout file. Here's how I went about doing this: # in your layout file (inside layout/ folder): <% myvar = yield_content :myvar %> # in your template file (e.g., mypage.html.erb): <% content_for :myvar, data.somefile %> # this examples assumes there's a somefile.yml in your data/…Read more …

django + less, updated

In a previous post, I described how I configured the hyperkitty django project to use LESS. Briefly, my steps were: - install django-compressor, django-less, nodejs, npm, and lessc - update settings.py with configuration settings for django-compressor and django-less - restart webserver However, it turns out some of those steps are a bit outdated. First, PyPI says that django-less is not maintained and suggests using django-static-precompiler instead. Second, while LESS suggests that the easiest way to install the compiler is via npm, it is just as easy to install the LESS compiler via nodejs-less.…Read more …

debugging the Javascript Quick-Start Guide for Evernote SDK

Turned out to be a few relatively simple bugs, but together they caused enough of a hiccup that I was left scratching my head for a bit. So if anyone else out there finds themselves in the same boat, hopefully these tips will help. I was interested in checking out Evernote's API and decided to start with their Javascript tutorial. It turns out that they left out a few things in their writeup: In the original gist of index.html that's in the tutorial, there's a missing bracket ('>'): <input type="submit" value="Login" onClick="app.loginWithEvernote()"</input> should…Read more …

google analytics “tracking not installed” messages

It took me ages to figure out, but it turns out that my own browser settings were causing me to keep getting the "Tracking Not Installed" messages. Other people have mentioned AdBlock being the culprit, but in my case it was the Ghostery extension, which I have installed on all of my browsers. Oops. Whitelisting my websites solved the problem - now when I go to test the tracking code on my own browser, I get "Tracking Installed" for my sites.Read more …

list overview: user scenarios

As described in my previous post, I've added a "personalized" section to the list overview page. This hasn't been implemented on the backend yet, but the intention is to provide extra details for users who have logged in. The difference is just an extra group of discussion threads at the top of the page: when you're not logged in: when you're logged in: I added this section based on typical day-to-day scenarios of interacting with a mailing list. Typical scenarios for sending messages include: 1) starting a new thread, 2) replying to a…Read more …