Skip to content

afiorillo/hugo-shortcodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hugo Shortcodes

Some shortcodes for Hugo, which you can add to your website as a Hugo Module

Install

  1. 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
  2. Add this module to your website by adding it to your config.toml:

    [module]
      [[module.imports]]
        path = "github.com/afiorillo/hugo-shortcodes"
  3. Run Hugo. This will download the latest version of the module.

    hugo server -v -D

Update

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

Override

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).

Modules

calculator.html

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/

Credits

This README borrows heavily from tohn/hugo-shortcodes. It's a nice model for easily distributed shortcodes.

About

Some reusable Hugo Shortcodes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages