Sha256: 8834ecc61c2088d539b963fbec06b61c59e12c4d434255a32f73541a4a4ca52c

Contents?: true

Size: 1.79 KB

Versions: 6

Compression:

Stored size: 1.79 KB

Contents

{%- assign name = include.name | downcase -%}
{%- assign type = 'font' -%}
{%- assign size = 16 -%}
{%- assign width = size -%}
{%- assign height = size -%}
{%- assign class = nil -%}
{%- assign style = nil -%}

{%- assign icon = nil -%}

{%- assign title = name | replace: '-', ' ' | capitalize | escape -%}

{%- if include.type -%}
  {%- assign type = include.type | downcase -%}
{%- endif -%}

{%- if include.size -%}
  {%- assign width = include.size -%}
  {%- assign height = include.size -%}
{%- endif -%}

{%- if include.width -%}
  {%- assign width = include.width -%}
{%- endif -%}

{%- if include.height -%}
  {%- assign height = include.height -%}
{%- endif -%}

{%- case type -%}
  {%- when 'font' -%}
    {%- capture icon -%}
      <i class="bi-{{- name -}}{% if include.class %} {{ include.class }}{% endif %}" role="img" aria-label="{{- title -}}"{% if include.style %} style="{{ include.style }}"{% endif %}></i>
    {%- endcapture -%}
  {%- when 'image' -%}
    {%- assign image = '/assets/bootstrap-icons/icons/' | append: name | append: '.svg' -%}
    {%- capture icon -%}
      <img{% if include.class %} class="{{ include.class }}"{% endif %} src="{{- image | relative_url -}}" alt="{{- title -}}" width="{{- width -}}" height="{{- height -}}"{% if include.style %} style="{{ include.style }}"{% endif %}>
    {%- endcapture -%}
  {%- when 'sprite' -%}
    {%- assign image = '/assets/bootstrap-icons/bootstrap-icons.svg#' | append: name -%}
    {%- capture icon -%}
      <svg class="bi{% if include.class %} {{ include.class }}{% endif %}" width="{{- width -}}" height="{{- height -}}" fill="currentColor" role="img" aria-label="{{- title -}}"{% if include.style %} style="{{ include.style }}"{% endif %}><use xlink:href="{{- image | relative_url -}}"/></svg>
    {%- endcapture -%}
{%- endcase -%}

{{- icon -}}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
paraqeet-0.6.0 _includes/icon.html
paraqeet-0.5.0 _includes/icon.html
paraqeet-0.4.0 _includes/icon.html
paraqeet-0.3.0 _includes/icon.html
paraqeet-0.2.0 _includes/icon.html
paraqeet-0.1.0 _includes/icon.html