Adding a custom menu to a Fargo blog

Every new Fargo blog has a menu at the top of each page. It links to archive pages for each month, a set of help pages, and the RSS feed for the blog. You can see what it looks like on the newbie demo site.

The default menu may be all you ever need, but if you want to create your own menu, this document shows you how to do that.

Grab a starter menu

Instead of starting from scratch, I recommend grabbing the menu from the Kim Parker demo site and modify it for your purposes. It'll make it easier to guide you through the process in an error-free way.

2. In Fargo choose Open by name in the File menu.

3. Enter kim, and click OK.

4. The outline should open in a new tab.

5. Put the cursor on the #menus line and press Cmd-C to Copy (or Control-C on Windows or Unix).

6. Click on the tab for your outline, and paste this sub-outline at the top level of your file.

7. Now if you view your site you should see Kim's menu on your site.

8. The next section shows you how to customize it.

Tour of Kim's menu

The top level item in Kim's #menus outline is called default. You can have more than one set of menus in a website, and you can say which menu you want with the #menuName directive, but if you just want one menu, name it default and keep it simple, as Kim does.

Under the name of the menu is its title. Kim wants Fargo to figure it out for her, so the title is <%menutitle%>. The title of the menu will come from the title of the outline as set in the Set Titles dialog in the File menu in Fargo.

Under the title are a series of items, some are links, and others are menus. To create a link, click on the link icon in the left margin in Fargo and enter a URL. You can read about that in the Fargo docs. If you want it to be a menu, add headlines under the heading. Each of these will be a menu item.

The menu items can be links or there can be items under them as illustrated in the About Me! section of Kim's Personal menu. She included the text of her About page in the menu itself. Fargo figures this out, and automatically links to the page from the menu. It's incredibly easy to create these page in Fargo, which in other blogging systems require a number of steps. In Fargo just indent and start typing. The only thing you have to do to signal that the text is to be on its own page is to set its type attribute to outline.

If you look under the About Me! headline, the first line is #text "All About Kim". That's a way of making the title on the blog page different from the text in the menu item. Kim wanted the title to be a little longer on the page because there's more room for a title there than there is in the menu item.

Sometimes you want to group the menu items. The conventional way to do this in menus is with a thin gray line. You tell Fargo that you want a separator with a single hyphen on a line.

If you look at the Archive item, you'll notice that there are no items under it in the editor, but in the actual menu there are items for each of the months that have blog posts. That's because this menu is generated automatically. To see how it works, put the cursor on the headline and click the suitcase icon in the left margin. You'll see that there's a type attribute with the value archive. This tells Fargo to generate the menu items automatically.

The last few items are icons chosen from the Font Awesome collection which is baked into Fargo. They link to her Twitter and Facebook accounts and to the RSS feed that's automatically maintained by Fargo.


Posted: Fri, 12 Jul 2013 12:37:02 GMT