Giter VIP home page Giter VIP logo

hugo-shortcode-roneo-button-icon-badge's Introduction

Objective

This Hugo Theme Component allows to easily insert Badges and Buttons in your content and templates

Both a Shortcode and a Partial Template are provided.

Screenshot

Insert buttons and badges with an optional icon

Usage

{{< badge text="CSS" icon="css" >}}

Options

text= "string" # REQUIRED
icon= "SVG icon name"
href= "URL"
id= "string"
class= "custom-class"

Only the text parameter is required.

The icon parameter must match one of the filenames at /layouts/partials/svg/.
You can add more files by creating the same directory structure in project root.

Installation

(Requires Hugo > 0.42)

Install as a Git submodule:

git submodule add https://gitlab.com/roneo.org/hugo-shortcode-roneo-button-icon-badge.git themes/hugo-shortcode-roneo-button-icon-badge

Edit config.toml:

theme = ["hugo-shortcode-roneo-button-icon-badge", "YourCurrentTheme"]

To learn more about "Theme components", see the Hugo documentation

Insert in a Markdown file

with the following Shortcode:

{{< badge text="CSS" >}}

Insert a badge with an icon:

{{< badge text="CSS" icon="css" >}}

Call from a template

{{ partial "badge.html" (dict "context" . "pages" $.Site.Pages "text" "Hi there" "icon" "git") }}

Add more icons

Add SVG files in /assets/svg/.
You can edit the Component directory or create the same folder structure at the root of your project.

Note that some SVG files do not work (#TODO:investigate), see /assets/svg/ to get inspiration.

Contribute

Please star this repo on Github or Gitlab, to help this project gain some visibility and reach new contributors.

Code contributions are welcome, and the main place for development is this Gitlab repo. Feel free to use this Github repo.

References

hugo-shortcode-roneo-button-icon-badge's People

Contributors

roneoorg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.