Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Latest commit

 

History

History
49 lines (36 loc) · 2.51 KB

README.md

File metadata and controls

49 lines (36 loc) · 2.51 KB

Nunjucks Bootstrap

Nunjucks templates (macros) for Bootstrap (v4) modules.

Purpose

This project provides a collection of reusable macros for Bootstrap modules to quickly create web pages. Each module offers multiple very small macros, which allow you to mix and match, use them all, or just a few of them.

The macros produce HTML, so you can combine macros and HTML as you please. Here's an example:

<nav>
	<h2 class="sr-only">Site menu</h2>
	{% call nav.inline() %}
    	{{ nav.activeItem('Active', '#item1') }}
	    {{ nav.item('Default item', '#item2') }}
    	<li>use <strong>custom HTML</strong> anywhere</li>
	    {{ nav.item('Another item', '#item3') }}
	{% endcall %}
</nav>

Modules

You can view the demos of all available modules.

The source files of all modules can be found in src/. Each module has its own readme with instructions on how to use its macros.

Template render engines

These templates are created for Nunjucks (JavaScript). The templates can also be used with template render engines in other languages (mostly without modification): Jinja2 (Python), Twig (PHP), Jinjava (Java) and Pongo (Go Lang).

Contributing

See CONTRIBUTING.md for guidelines and development scripts.