Skip to content

Commit

Permalink
updated links on sidebar
Browse files Browse the repository at this point in the history
added support to display links to pages in the sidebar. updated
readme file with information regarding it.
  • Loading branch information
hdra committed Apr 21, 2013
1 parent 2cafeef commit 5bdf0ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
15 changes: 8 additions & 7 deletions README.md
Expand Up @@ -2,10 +2,6 @@

Cait is a theme for static site generator, [Pelican][pelican]

** Warning: The current version of the theme doesn't display list of pages and categories
as usual. The list of links to be displayed must be explicitly defined in the `MENUITEMS`.
Maybe future update will add options to choose the way links are displayed. **

Cait is a simple responsive (kind of) theme consisting of mostly black, gray, and white.

## Features:
Expand Down Expand Up @@ -33,15 +29,20 @@ For the contact page, change the 4th line to `Template: contact`.
In order to use the landing and contact template, several additional setting values must be specified
in the configuration file.

### MENUITEMS
### USE_CUSTOM_MENU
The landing page and contact templates includes a link to the other part of the site. These are specified
in the `MENUITEMS` tuple. The links are included in the `(Title, url)` format. The url are specified
in the `CUSTOM_MENUITEMS` tuple. The links are included in the `(Title, url)` format. The url are specified
relative to the `SITEURL`.

MENUITEMS = (('Blog', `blog`),
CUSTOM_MENUITEMS = (('Blog', `blog`),
('Contact', 'contact'),
('Projects', '[ages/projects'))

The blog templates aren't required to display the `CUSTOM_MENUITEMS`, in which case will display the
links to the static pages of the site. To use `CUSTOM_MENUITEMS`, specify `USE_CUSTOM_MENU = True`
in the configuration file. Please not that by using the `CUSTOM_MENUITEMS`, the links
to the pages will not be displayed.

### SOCIAL
The landing page can includes links to several social networks. The links are shown in icons, using
icons font provided with [FontAwesome][fa]. These are specified with the `SOCIAL` tuple in the
Expand Down
8 changes: 7 additions & 1 deletion templates/sidebar.html
Expand Up @@ -5,9 +5,15 @@
</hgroup>
<nav>
<ul id="nav-links">
{% for name, url in MENUITEMS %}
{% if USE_CUSTOM_MENU %}
{% for name, url in CUSTOM_MENUITEMS %}
<li><a href="{{ SITEURL }}/{{ url }}">{{ name }}</a></li>
{% endfor %}
{% else %}
{% for page in PAGES %}
<li><a href="{{ SITEURL }}/{{ page.url }}">{{ page.title }}</a></li>
{% endfor %}
{% endif %}
</ul>
</nav>
{% include "footer.html" %}
Expand Down

0 comments on commit 5bdf0ba

Please sign in to comment.