Difference between revisions of "Template:GitHub"

From blackwiki
Jump to navigation Jump to search
imported>Technical 13
(and a named parameter for label and add testing to see if implicit parameter 1 (url) is a full url or just the page to the page after the domain.)
imported>Primefac
m (Protected "Template:GitHub": semi-protecting highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indefi...)
 
(26 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[{{#ifeq: {{str left|{{{1|{{{url}}}}}}|4}} | http |{{{url}}}|//github.com/{{{1}}}}} {{{label|{{{2|{{#titleparts:{{{1|GitHub page}}}|1|-1}}}}}}}}]<noinclude>
+
[{{#if:{{#invoke:String|match|{{{1|{{{url}}}}}}|^https?://|plain=0|ignore_errors=1}}||https://github.com/}}{{#if:1|{{{url|{{{1}}}}}}}} {{If empty|{{{label|{{{2|}}}}}}|{{#titleparts:{{{1}}}|1|-1}}}}] {{#switch:{{{link}}}
 +
|hidden=
 +
|no=on GitHub
 +
|on [[GitHub]]
 +
}}<noinclude>
 
{{Documentation}}</noinclude>
 
{{Documentation}}</noinclude>

Latest revision as of 19:21, 10 January 2018

Script error: No such module "If empty". on GitHub

Usage

This template can be used to create a link to a repository or a single file on GitHub. The link to GitHub can be suppressed with the parameter |link=no, and the mentioning of GitHub can be omitted entirely with |link=hidden.

Examples

See also

Template:Wikidata property