Hugo Snackbar Module

A super lightweight (less then 50 lines code) snackbar module for Hugo, used to show short messages to clients, such as results of actions.

Module
github.com/hugomods/snackbar
GitHub Stars Used By Used By Used By Used By

Installation

hugo.yaml

1module:
2  imports:
3  - path: github.com/hugomods/snackbar

hugo.toml

1[module]
2[[module.imports]]
3    path = 'github.com/hugomods/snackbar'

hugo.json

1{
2   "module": {
3      "imports": [
4         {
5            "path": "github.com/hugomods/snackbar"
6         }
7      ]
8   }
9}

Usage

1.Import the SCSS

1@import "mods/snackbar/scss/index";

The path is relative to assets folder.

2.Import the JS

1import snackbar from 'mods/snackbar/js/index.ts';
2
3snackbar.add('Greeting from snackbar');