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 DorfGit, GitHub, Matrix, Mastodon & Twitter support)
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)
* 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  =
  | twitter  | Twitter  | tw                  = [https://twitter.com/{{{2}}} @{{{2}}}] {{#ifeq: {{NAMESPACE}}|User|{{#set:Twitter=@{{{2}}}}} {{#set:TwitterLink={{{2}}}}} {{#set:Has Twitter=True}} |}}
}}</includeonly>
}}</includeonly>

Revision as of 05:28, 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

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)
  • twitter (alternative Schreibweisen: Twitter, tw)