Skip to content

Commit

Permalink
Add GitLab to the quick links plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dmbaturin committed Oct 30, 2024
1 parent b834237 commit eb56966
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion assets/files/plugins/quick-links.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
-- All elements also support a short form where the content becomes the link data:
-- <wikipedia>Philippe Soupault</wikipedia>
-- <github>dmbaturin/soupault</github>
-- <gitlab>dmbaturin</gitlab>
-- <sourcehut>~dmbaturin/soupault</sourcehut>
-- <mastodon>@[email protected]</mastodon>
-- <twitter>@dmbaturin</twitter> -- "@" is optional
Expand Down Expand Up @@ -161,7 +162,7 @@ function make_twitter_link(element)
end

elements = HTML.select_all_of(page, {
"wikipedia", "github", "sourcehut", "codeberg", "mastodon", "twitter", "linkedin", "rfc"
"wikipedia", "github", "gitlab", "sourcehut", "codeberg", "mastodon", "twitter", "linkedin", "rfc"
})

local index = 1
Expand All @@ -173,6 +174,8 @@ while elements[index] do
new_elem = make_wikipedia_link(elem)
elseif (tag_name == "github") then
new_elem = make_simple_link(elem, "project", "https://github.com/%s")
elseif (tag_name == "gitlab") then
new_elem = make_simple_link(elem, "project", "https://gitlab.com/%s")
elseif (tag_name == "sourcehut") then
-- SourceHut supports multiple version control systems as well as
-- having a project page without a subdomain.
Expand Down
5 changes: 4 additions & 1 deletion plugins/quick-links.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
-- All elements also support a short form where the content becomes the link data:
-- <wikipedia>Philippe Soupault</wikipedia>
-- <github>dmbaturin/soupault</github>
-- <gitlab>dmbaturin</gitlab>
-- <sourcehut>~dmbaturin/soupault</sourcehut>
-- <mastodon>@[email protected]</mastodon>
-- <twitter>@dmbaturin</twitter> -- "@" is optional
Expand Down Expand Up @@ -161,7 +162,7 @@ function make_twitter_link(element)
end

elements = HTML.select_all_of(page, {
"wikipedia", "github", "sourcehut", "codeberg", "mastodon", "twitter", "linkedin", "rfc"
"wikipedia", "github", "gitlab", "sourcehut", "codeberg", "mastodon", "twitter", "linkedin", "rfc"
})

local index = 1
Expand All @@ -173,6 +174,8 @@ while elements[index] do
new_elem = make_wikipedia_link(elem)
elseif (tag_name == "github") then
new_elem = make_simple_link(elem, "project", "https://github.com/%s")
elseif (tag_name == "gitlab") then
new_elem = make_simple_link(elem, "project", "https://gitlab.com/%s")
elseif (tag_name == "sourcehut") then
-- SourceHut supports multiple version control systems as well as
-- having a project page without a subdomain.
Expand Down

0 comments on commit eb56966

Please sign in to comment.