Template:SocialMediaLink: Difference between revisions

Template page
(Created page with "<noinclude> == Usage == The first parameter has to be the service you are linking to, the second the username, the third the server if it is a federated service. <pre><nowiki>...")
 
(Added Telegram support)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
This Template creates a social media link and, if it's used on a User page, adds the relevant Semantic MediaWiki properties.
== Usage ==
== Usage ==
The first parameter has to be the service you are linking to, the second the username, the third the server if it is a federated service.
The first parameter has to be the service you are linking to, the second the username, the third the server if it is a federated service.
<pre><nowiki>{{SocialMediaLink|service|username|server.example.com}}</nowiki></pre>
<pre><nowiki>{{SocialMediaLink|service|username|server.example.com}}</nowiki></pre>
Bei Service sind folgende Einträge möglich bzw. folgende Services werden unterstützt:
* dorfgit (alternative Schreibweisen: DorfGit, Git, git)
* github (alternative Schreibweisen: Github, GitHub, gh)
* matrix (alternative Schreibweisen: Matrix, mtrx, mx)
* mastodon (alternative Schreibweisen: Mastodon, mstdn)
* telegram (alternative Schreibweisen: Telegram)
* twitter (alternative Schreibweisen: Twitter, tw)
</noinclude>
</noinclude>
<includeonly>{{#switch: {{{1}}}
<includeonly>{{#switch: {{{1}}}
  | dorfgit  =  
  | dorfgit  | DorfGit  | Git      | git      = [https://chaosdorf.de/git/{{{2}}} {{{2}}}] {{#ifeq: {{NAMESPACE}}|User|{{#set:DorfGit={{{2}}}}} {{#set:DorfGitLink={{{2}}}}} {{#set:Has DorfGit=True}} |}}
  | github  =
  | github  | Github  | GitHub  | gh      = [https://github.com/{{{2}}} {{{2}}}] {{#ifeq: {{NAMESPACE}}|User|{{#set:GitHub={{{2}}}}} {{#set:GitHubLink={{{2}}}}} {{#set:Has GitHub=True}} |}}
  | matrix  = [https://matrix.to/#/@{{{2}}}:{{{3}}} @{{{2}}}:{{{3}}}] {{#ifeq: {{NAMESPACE}}|User|{{#set:Matrix=@{{{2}}}:{{{3}}}}} {{#set:MatrixLink={{{2}}}{{{{3}}}} }} {{#set:Has Matrix=True}} |}}
  | matrix  | Matrix  | mtrx    | mx      = [https://matrix.to/#/@{{{2}}}:{{{3}}} @{{{2}}}:{{{3}}}] {{#ifeq: {{NAMESPACE}}|User|{{#set:Matrix=@{{{2}}}:{{{3}}}}} {{#set:MatrixLink={{{2}}}{{{{3}}}} }} {{#set:Has Matrix=True}} |}}
  | mastodon =
  | mastodon | Mastodon | mstdn              = [https://{{{3}}}/@{{{2}}} @{{{2}}}@{{{3}}}] {{#ifeq: {{NAMESPACE}}|User|{{#set:Mastodon=@{{{2}}}:{{{3}}}}} {{#set:MastodonLink={{{2}}}{{{{3}}}} }} {{#set:Has Mastodon=True}} |}}
  | twitter  =
| telegram | Telegram                      = [https://t.me/{{{2}}} @{{{2}}}] {{#ifeq: {{NAMESPACE}}|User|{{#set:Telegram=@{{{2}}}}} {{#set:TelegramLink={{{2}}}}} {{#set:Has Telegram=True}} |}}
  | twitter  | Twitter  | tw                  = [https://twitter.com/{{{2}}} @{{{2}}}] {{#ifeq: {{NAMESPACE}}|User|{{#set:Twitter=@{{{2}}}}} {{#set:TwitterLink={{{2}}}}} {{#set:Has Twitter=True}} |}}
}}</includeonly>
}}</includeonly>

Latest revision as of 07:02, 14 October 2022

This Template creates a social media link and, if it's used on a User page, adds the relevant Semantic MediaWiki properties.

Usage[edit source]

The first parameter has to be the service you are linking to, the second the username, the third the server if it is a federated service.

{{SocialMediaLink|service|username|server.example.com}}

Bei Service sind folgende Einträge möglich bzw. folgende Services werden unterstützt:

  • dorfgit (alternative Schreibweisen: DorfGit, Git, git)
  • github (alternative Schreibweisen: Github, GitHub, gh)
  • matrix (alternative Schreibweisen: Matrix, mtrx, mx)
  • mastodon (alternative Schreibweisen: Mastodon, mstdn)
  • telegram (alternative Schreibweisen: Telegram)
  • twitter (alternative Schreibweisen: Twitter, tw)