Some shortcodes for Hugo, which you can add to your website as a Hugo Module ✨
-
Enable modules in your repository (skip this step if you already have a
go.mod
file in your repo):hugo mod init github.com/$username/$reponame
-
Add this module to your website by adding it to your
config.toml
:[module] [[module.imports]] path = "github.com/afiorillo/hugo-shortcodes"
-
Run Hugo. This will download the latest version of the module.
hugo server -v -D
You can update this module with:
hugo mod get -u github.com/afiorillo/hugo-shortcodes
Or you can update all modules defined in your config.toml
with:
hugo mod get -u
You can override a shortcode by adding a file with the same name as the one you want to replace in your own shortcode directory (layouts/shortcodes
for example).
calculator.html
is useful for representing bread and dough recipes in an interactive way.
Example:
{{< calculator >}}
ingredients:
- name: Bread Flour
percent: 100
- name: Water
percent: 70
- name: Instant Yeast
percent: 1
- name: Sale
percent: 1
{{< /calculator >}}
Demo: https://0x6166.com/pizza/
This README borrows heavily from tohn/hugo-shortcodes. It's a nice model for easily distributed shortcodes.