Skip to content

Commit 17df0a4

Browse files
authored
Merge pull request #47 from justwriteclick/part3-balsamiq
Publish Balsamiq part 3; ready for next week
2 parents 0cfec04 + f7d200c commit 17df0a4

8 files changed

Lines changed: 126 additions & 0 deletions
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
---
2+
layout: post
3+
title: Lists Get a Makeover - Balsamiq, Leon Barnard
4+
excerpt: "Learn useful techniques for static sites on GitHub from Leon Barnard, Designer and Writer at Balsamiq."
5+
modified: Sat Apr 15 22:34:44 CDT 2017
6+
categories: articles
7+
author: leon_barnard
8+
tags: [case study, balsamiq, static sites, use case, wireframes, github, docs, repos, hugo, tools, gif, animated gifs]
9+
image:
10+
feature: alittlecreation-paintchips.jpg
11+
credit: Flickr alittlecreation
12+
creditlink: https://flic.kr/p/dfEUAY
13+
comments: true
14+
share: true
15+
---
16+
17+
# Use Case Part III: Balsamiq
18+
19+
After sorting through two [other](http://docslikecode.com/articles/balsamiq-case-study-part-1/) [challenges](http://docslikecode.com/articles/balsamiq-case-study-part-2/) with moving to their current static docs site generator, Leon Barnard at Balsamiq tackles ongoing maintenance of list pages where the lists should be appealing to click and use.
20+
21+
Check out the prior two parts of this series, including [how to use conditional text with Markdown to document multiple product releases](http://docslikecode.com/articles/balsamiq-case-study-part-1/), and [simplify source files while providing animated gif files that include a play and pause action](http://docslikecode.com/articles/balsamiq-case-study-part-2/).
22+
23+
## Challenge #3: Giving the list pages a makeover
24+
25+
The last challenge is one that I had wanted to do for the first release of our new docs site, but never got around to. The challenge is that it's hard to make a documentation site look pretty beyond the home page, whether it's a static site or not.
26+
27+
Let's look at the [Dropbox help site home page](https://www.dropbox.com/help) as an example:
28+
29+
![](https://media.balsamiq.com/images/docslikecode/dropbox-help.png)
30+
31+
I love the illustrations and layout. Very appealing and inviting. But as soon as you go a level deeper you get this:
32+
33+
![](https://media.balsamiq.com/images/docslikecode/dropbox-help-toc.png)
34+
35+
A big ol' list of links. A wall of text. It's a very different feel from the page you came from.
36+
37+
It's clear to me that this page is automatically generated by some kind of content management system (CMS) template. Designers for pages like this usually cede control of the placement of the articles to the CMS, because they don't want to have to manually update it every time a new article is added.
38+
39+
They're limited because they don't know how many articles there will be in each category, so most sites just end up creating a simple list, perhaps in sub-categories. Even awesome documentation sites like [Mailchimp](http://kb.mailchimp.com/) and [Zapier](https://zapier.com/help/) do this once you go beyond the first level.
40+
41+
And this is exactly what we do on our documentation site within each product category currently:
42+
43+
![]({{ site.url }}/images/balsamiq/desktop-toc-old.png)
44+
45+
But I really love the look of hard-coded landing pages like the Dropbox site. The illustrations, the grid layout, the way it directs you to the information that's most important. I wanted to see if we could make our second-level pages look more like that.
46+
47+
To cut to the chase, here's what the upcoming version of our docs site will look like:
48+
49+
![]({{ site.url }}/images/balsamiq/desktop-toc.png)
50+
51+
It feels more like a documentation site landing page, right? It has a featured articles section with the articles that are most relevant to new users, and the rest of the articles are split evenly in three columns. Yet none of it is hard-coded, even the featured "Getting Started" articles.
52+
53+
I'll start by explaining the "Everything Else..." section at the bottom and what makes it different from our previous version.
54+
55+
The links there are automatically placed by Hugo and styled using the [Bootstrap List group](http://getbootstrap.com/components/#list-group) component. That part is pretty easy. The challenge was putting them in columns and making sure that the columns were equal heights, regardless of how many articles there were.
56+
57+
Here's the code I wrote inside the Hugo template to define some variables to use further down in the code:
58+
59+
{% raw %}
60+
```go
61+
{{ $featuredRows := 1 }} // number of rows to feature in Getting Started section
62+
{{ $totalCount := len (where .Site.Pages "Section" "desktop") }} // total number of articles in this section
63+
{{ $rowCount := (sub (div (add (add $totalCount 1) (mod $totalCount 3)) 3) $featuredRows) }} // number of rows in each column
64+
```
65+
{% endraw %}
66+
67+
And when it comes time to populate the columns:
68+
69+
{% raw %}
70+
```html
71+
<div class="row mt1">
72+
<div class="col-xs-12 col-md-4">
73+
<div class="list-group">
74+
{{ range first $rowCount (after 3 .Data.Pages.ByWeight) }}
75+
<a href="{{ .Permalink }}" class="list-group-item">{{ .Title }}</a>
76+
{{ end }}
77+
</div>
78+
</div>
79+
<div class="col-xs-12 col-md-4">
80+
<div class="list-group">
81+
{{ range first $rowCount (after (add $rowCount 3) .Data.Pages.ByWeight) }}
82+
<a href="{{ .Permalink }}" class="list-group-item">{{ .Title }}</a>
83+
{{ end }}
84+
</div>
85+
</div>
86+
<div class="col-xs-12 col-md-4">
87+
<div class="list-group">
88+
{{ range first $rowCount (after (add (mul $rowCount 2) 3) .Data.Pages.ByWeight) }}
89+
<a href="{{ .Permalink }}" class="list-group-item">{{ .Title }}</a>
90+
{{ end }}
91+
</div>
92+
</div>
93+
</div>
94+
```
95+
{% endraw %}
96+
97+
98+
The variable called `$featuredRows` helps determine where the count should start for columns. From there Hugo counts the number of remaining articles and divides that number by 3 (rounded up to the nearest whole number). It then creates the number of items in each column so that they are as even as possible. It takes a bit of math to do it, but that's what computers are good at anyway.
99+
100+
And now to that "Getting Started" section at the top...
101+
102+
![]({{ site.url }}/images/balsamiq/desktop-toc-getting-started.png)
103+
104+
I wanted different images for each of the featured articles, but I just didn't like the idea of hard-coding any links or resources, in case we decided to change things later (and also because I'm stubborn). So, the top part of the code identifies the first three articles (ordered by weight), lists their names, links them up, and then grabs an image for each of them using the following code:
105+
106+
{% raw %}
107+
```html
108+
<img src="http://media.balsamiq.com/img/support/docs/m4d/b3/toc-button-{{ .File.BaseFileName }}.svg">
109+
```
110+
{% endraw %}
111+
112+
113+
The trick is that the last part of the image file name is the same as the name of the markdown file. So, the article called `intro.md` uses an image called `toc-button-intro.svg`. This means that if we want other articles to show up in the "Getting Started" section we don't need to touch this page. We just adjust the weights in the front matter and add a new image that corresponds to the file that will get moved into that area.
114+
115+
Voila!
116+
117+
## The moral of the story
118+
119+
So, what did we learn from these challenges? I think the most important thing is that all of them were overcome without making life harder for the content writers. We didn't compromise on keeping the workflow simple when we added functionality, even though we were tempted to.
120+
121+
We *could* have switched away from Markdown. We *could* have started writing HTML inside our Markdown files. We *could* have required manual template updates when we reordered articles. It took a lot of work not to do these things. But that's the beauty of programming: it's an up front investment that saves time and effort in the long run.
122+
123+
Static sites may seem to have more limitations than traditional CMSs or powerful technical writing tools. But if you can find a way around the limitations, you can reap the benefits that made static sites attractive in the first place. Markdown is easy. GitHub offers collaborative coding. A scripted robot can run a build command from a terminal. It's writing excellent documentation that is tough. Fortunately, that's what technical writers are good at. Having a developer liaison for the docs team can free writers from having to think about the limitations of the technology they're using so they can focus on writing the docs.
124+
125+
{% include sign-up.html %}
126+

images/.DS_Store

0 Bytes
Binary file not shown.
119 KB
Loading
12.3 KB
Loading
32.4 KB
Loading

images/balsamiq/desktop-toc.png

54.6 KB
Loading
74.3 KB
Loading

images/balsamiq/dropbox-help.png

50.6 KB
Loading

0 commit comments

Comments
 (0)