publishing
This commit is contained in:
parent
2229b217a2
commit
65f1150e68
1 changed files with 16 additions and 3 deletions
|
@ -21,6 +21,19 @@
|
|||
|
||||
<p><span class="sc"><abbr title="Trop long; pas lu">tlpl</abbr>: </span> Les boutons des réseaux sociaux traquent vos utilisateurs, ont un design incohérent avec celui de votre site, utilisent des ressources, ralentissent le rendu de vos pages.</p>
|
||||
<p>Faite les choses bien. Utilisez des liens statiques.</p>
|
||||
<p>Si vous n’avez pas envie de lire, copiez et collez simplement le code suivant dans votre <span class="sc">html</span> :</p>
|
||||
<pre class="js"><code><script>
|
||||
var url=document.location;
|
||||
document.write(
|
||||
'<'+'a href="https://twitter.com/home?status='+url+'" '
|
||||
+'target="_blank">Tweet this<'+'/a> - '
|
||||
|
||||
+ '<'+'a href="http://www.facebook.com/sharer/sharer.php?u='+url+'" '
|
||||
+'target="_blank">Like this<'+'/a> - '
|
||||
|
||||
+ '<'+'a href="https://plus.google.com/share?url='+url+'" '
|
||||
+'target="_blank">Share on G+<'+'/a>');
|
||||
</script></code></pre>
|
||||
</div>
|
||||
|
||||
<h2 id="the-problem">The problem</h2>
|
||||
|
@ -70,7 +83,7 @@
|
|||
<span class="ot"> target=</span><span class="st">"_blank"</span><span class="kw">></span>Like this<span class="kw"></a></span>
|
||||
|
||||
<span class="kw"><a</span><span class="ot"> href=</span><span class="st">"https://plus.google.com/share?url=$url$"</span>
|
||||
<span class="ot"> target=</span><span class="st">"_blank"</span><span class="kw">></span>+1 this<span class="kw"></a></span></code></pre>
|
||||
<span class="ot"> target=</span><span class="st">"_blank"</span><span class="kw">></span>Share on G+<span class="kw"></a></span></code></pre>
|
||||
<p>But you have to replace <code>$url$</code> by the current <span class="sc"><abbr title="Uniform Ressource Locator">url</abbr></span>.</p>
|
||||
<p><strong>Solution 2 (Just copy/paste):</strong></p>
|
||||
<p>If you don’t want to write the <span class="sc"><abbr title="Uniform Ressource Locator">url</abbr></span> yourself, you could use some minimal js:</p>
|
||||
|
@ -84,7 +97,7 @@ document.write(
|
|||
+'target="_blank">Like this<'+'/a> - '
|
||||
|
||||
+ '<'+'a href="https://plus.google.com/share?url='+url+'" '
|
||||
+'target="_blank">+1 this<'+'/a>');
|
||||
+'target="_blank">Share on G+<'+'/a>');
|
||||
</script></code></pre>
|
||||
<p>Here is the result:</p>
|
||||
<div style="text-align:center" class="nostar">
|
||||
|
@ -98,7 +111,7 @@ document.write(
|
|||
+'target="_blank">Like this<'+'/a> - '
|
||||
|
||||
+ '<'+'a href="https://plus.google.com/share?url='+url+'" '
|
||||
+'target="_blank">+1 this<'+'/a>');
|
||||
+'target="_blank">Share on G+<'+'/a>');
|
||||
</script>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue