use dynamic links for share buttons

lektura
max.mehl 2017-08-29 22:50:07 +02:00
parent e632b263b1
commit 3268c6008e
3 changed files with 7 additions and 11 deletions

View File

@ -5,9 +5,9 @@
<form action="/share" method="GET" class="share-buttons side" target="_blank">
<input name="popup" id="no-share-popup-side" type="radio" />
<input name="ref" value="pmpc-side" type="hidden" />
<input name="url" value="{{ .Site.Params.url }}" type="hidden" /> <!-- replace with your URL -->
<input name="title" value="{{ .Site.Title }}" type="hidden" /> <!-- replace with site/share title -->
<input class="n" name="website" placeholder="Please do not put anything here" /> <!-- stupid bot detection -->
<input name="url" value="{{ .Site.Params.url }}{{ .RelPermalink }}" type="hidden" />
<input name="title" value="{{ with .Params.Title }}{{ . }} - {{ end }}{{ .Site.Title }}" type="hidden" />
<input class="n" name="website" placeholder="Please do not put anything here" />
{{ range $data.share }}
{{ if eq .userinput true }}

View File

@ -18,15 +18,11 @@
<div class="share-buttons">
{{ .Site.Params.spread.shareTitle }}
<!--
{{ range $data.share }}
<a id="{{ .id }}" href="{{ .link }}" title="{{ .titleBefore}} {{ .name }} {{ .titleAfter }}" target="_blank">{{ .name }}</a>
{{ end }}
-->
<form action="/share" method="GET" class="share-buttons spread" target="_blank">
<input name="popup" id="no-share-popup-spread" type="radio" />
<input name="ref" value="pmpc-spread" type="hidden" />
<input name="url" value="{{ .Site.Params.url }}" type="hidden" />
<input name="url" value="{{ .Site.Params.url }}{{ .RelPermalink }}" type="hidden" />
<input name="title" value="Public Money, Public Code!" type="hidden" />
<input class="n" name="website" placeholder="Please do not put anything here" />

View File

@ -20,8 +20,8 @@ else {
$service = htmlspecialchars($service);
$diasporapod = htmlspecialchars($diasporapod);
$gnusocialpod = htmlspecialchars($gnusocialpod);
$url = urlencode(htmlspecialchars($url));
$title = urlencode(htmlspecialchars($title));
$url = urlencode($url);
$title = urlencode($title);
if ($service === "diaspora") {
$diasporapod = validateurl($diasporapod);