lplt.netLoup Lobet's home page

Site navigation tree

When using Swb, a navigation tree can easily be incorporated into every webpages of a site to show available (sub)directories and pages. This can be achieved by using any executable or script that would generate the appropriate html sctructure within the site template. As an example, here is the rc script used to generate the sidebar on this page:

A call to the script is added to the .tpl file, where the first argument (path) has to be an exact prefix of the second argument (path):

<nav id="side-bar">
  <div>
%{
  /home/loup/bin/sidebar ${site_name} ${src_path}
}%
  </div>
</nav>

N. B.

When adding or removing pages or folders in site source tree, you should rebuild the entier site to update the navtree in every other pages:

% swb -k -b

These pages aren’t seen as modified by swb since their content or template isn’t actually modified, but some of them still need to be updated.