{%- macro iconLink(link, text='Unknown', icon='none') -%} {%- set link = linkFromType(link, icon) -%} {{ text }} {%- endmacro -%} {%- macro link(link, text='', type='default', linkAsText=false) -%} {%- if linkAsText -%} {%- set text = link -%} {%- endif -%} {%- set link = linkFromType(link, type) -%} {{ text }} {%- endmacro -%} {%- macro linkFromType(link, type='default') -%} {%- if type === 'github' -%} {%- set text = 'GitHub' -%} {%- set link = 'https://github.com/' + link -%} {%- elif type === 'mozilla-firefox' -%} {%- set text = 'Mozilla Firefox' -%} {%- set link = 'https://addons.mozilla.org/firefox/addon/' + link -%} {%- elif type === 'google-chrome' -%} {%- set text = 'Google Chrome' -%} {%- set link = 'https://chrome.google.com/webstore/detail/' + link -%} {%- elif type === 'microsoft-edge' -%} {%- set text = 'Microsoft Edge' -%} {%- set link = 'https://microsoftedge.microsoft.com/addons/detail/' + link -%} {%- elif type === 'crates-io' -%} {%- set text = 'Crates.io' -%} {%- set link = 'https://crates.io/crates/' + link -%} {%- elif type === 'pypi' -%} {%- set text = 'Python Package Index' -%} {%- set link = 'https://pypi.org/project/' + link -%} {%- elif type === 'npm' -%} {%- set text = 'npm' -%} {%- set link = 'https://www.npmjs.com/package/' + link -%} {%- endif -%} {{- link -}} {%- endmacro -%}