sc0ttj / mdsh

A simple static site generator, using Markdown and Bash
https://sc0ttj.github.io/mdsh/
10 stars 0 forks source link

Add site navigation menu #62

Closed sc0ttj closed 5 years ago

sc0ttj commented 5 years ago

Create a function to build a navigation menu - which should appear in the site footer, or as an aside for larger screens, or any where the user wants to put it using mustache templates..

The function should output something like:

  Main: (root dir html pages)

    - Home
    - About
    - Foo 

  Recent:

    - post one
    - post two
    - post three
    - post four

  Categories:

   bash
    - post one
    - post two

   css
    - post one
    - post two
    - post three

  Tags:

    list, all, tags, here,
    comma, separated,
    and-stuff, more, last

Implementation

Create a new template called .app/templates/html/_site_navigation.mustache

Create a function called print_site_navigation in .app/functions/generate_page_content.bash which returns the navigation.

Add {{site_navigation}} to the main.mustache template (or some other)..