diff options
author | Thomas Letan <lthms@soap.coffee> | 2020-02-16 17:08:59 +0100 |
---|---|---|
committer | Thomas Letan <lthms@soap.coffee> | 2020-02-16 17:08:59 +0100 |
commit | 25e6a8c049dbc19ac752dda5995929695a1e10f1 (patch) | |
tree | befe54864d811b8b68e085396d1cf9e93aa521b6 /plugins | |
parent | Mark external links with a dedicated icon (diff) |
Add a dedicated icon for GitHub links
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/external_links.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/external_links.lua b/plugins/external_links.lua index 0edf9d8..2967364 100644 --- a/plugins/external_links.lua +++ b/plugins/external_links.lua @@ -6,8 +6,11 @@ while index do href = HTML.get_attribute(link, "href") if href then - if Regex.match(href, "^https?://") then - icon = HTML.parse("<i class=\"fa fa-external-link\" aria-hidden=\"true\"></i>") + if Regex.match(href, "^https?://github.com") then + icon = HTML.parse("<i class=\"url-mark fa fa-github\" aria-hidden=\"true\"></i>") + HTML.append_child(link, icon) + elseif Regex.match(href, "^https?://") then + icon = HTML.parse("<i class=\"url-mark fa fa-external-link\" aria-hidden=\"true\"></i>") HTML.append_child(link, icon) end end |