⚙️ navbar

Displays navbar

This helper is intended to be used with autoload functionality, to add shared navbar to the set of IMP! pages. But it can be used as regular helper (Like on this page ↑, locally defined navbar overwrites the autoloaded one).

→ See this page in edit mode.

Example code for autoload.js

// helpers/autoload.js

window.impHelpers.autoload = {
  helpers: [
    [
      "navbar",
      ,
      {
        logo: "<strong>🏠</strong>",
        link: "index.html",
        links: [
          ["https://yandex.ru", "yandex"],
          ["https://google.com", "google"],
        ],
        style: "./helpers/nav.css",
      },
    ],
   //... your other autoloaded modules
  ],
};

Example within page

 ```h:navbar
 {
        "logo": "<strong>🏠</strong>",
        "link": "index.html",
        "links": [
          ["https://yandex.ru", "yandex"],
          ["https://google.com", "google"]
        ],
        "style": "./helpers/nav.css"
      }
 ```

Parameters

name meaning type default
logo HTML at the start String empty
link Link for logo String empty
style Link to css to replace default style String empty
addStyle Link to css to add to default style String empty
exclude List of regexps (as strings), for page urls, at which navbar is disabled Array of strings empty
links List of navbar links Array of arrays* empty

* List of navbar links is an array of arrays, each of which contains 2 values:

  1. String, url.
  2. String, label.