-
Notifications
You must be signed in to change notification settings - Fork 7
Snippets (pre-defined & user definable) #15
Copy link
Copy link
Open
Labels
Description
Feature: Snippets
A mechanism to load pre-defined chunks of text that can be inserted inline to streamline/standardize certain outputs.
<html>
<head>
<meta charset="utf-8">
{{ snippet "html-link" "/assets/css/app.js" }}
</head>
</html>The above template would produce roughly the following output:
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/assets/css/app.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
</head>
</html>The {{ snippet }} template function would have following signature: snippet NAME [ARGS ..], with arguments being passed into the template, accessible with the param [N] function. In the above example, the SRI checksum would be dynamically calculated from the given argument. In this way, complex standardized blocks of functionality can be composed using snippets.
Configuration Sample
header:
snippets:
banner: '<h1 class="hero">Hello There!</h1>'
Reactions are currently unavailable