• Stars
    star
    231
  • Rank 173,434 (Top 4 %)
  • Language
    HTML
  • License
    GNU General Publi...
  • Created over 5 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Hugo theme component to display nice notices

hugo-notice

Awesome

About

A Hugo theme component providing a shortcode: notice to display nice notices. Dark mode supported!

Four notice types are provided: warning, info, note and tip.

This component comes with localization in 15 languages: English, French, German, Italian, Portuguese, Spanish, Chinese, Russian, Turkish, Arabic, Polish, Finnish, Korean, Vietnamese and Swahili.

Other languages welcome! Send your pull request.

Screenshot

Installation

Hugo module

  1. Initialize your existing site as hugo module

    hugo mod init github.com/USERNAME/REPO
  2. Add the hugo-notice as a hugo module to be able to get upstream changes later

    hugo mod get github.com/martignoni/hugo-notice
  3. In your site's or theme's configuration file hugo.yaml or hugo.toml, add a new module section and define both hugo-notice and your currently used theme as modules to be imported.

    Example, with hugo.yaml:

    module:
      imports:
        - path: github.com/martignoni/hugo-notice
        - path: my-theme

    or, with hugo.toml,

    [module]
      [[module.imports]]
        path = "github.com/martignoni/hugo-notice"
      [[module.imports]]
        path = "my-theme"

Git submodule

  1. Add the hugo-notice as a submodule to be able to get upstream changes later git submodule add https://github.com/martignoni/hugo-notice.git themes/hugo-notice

  2. Add hugo-notice as the left-most element of the theme list variable in your site's or theme's configuration file hugo.yaml or hugo.toml.

    Example, with hugo.yaml:

    theme: ["hugo-notice", "my-theme"]

    or, with hugo.toml,

    theme = ["hugo-notice", "my-theme"]

Usage

In your site, use the shortcode, this way: go {{< notice warning >}} This is a warning notice. Be warned! {{< /notice >}} or go {{< notice tip >}} This is a very good tip. {{< /notice >}}

Credits

Copyright © 2019 onwards, Nicolas Martignoni [email protected].

Thanks to