forked from devopsdays/devopsdays-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfooter_scripts.html
63 lines (56 loc) · 1.87 KB
/
footer_scripts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{{- if .IsHome -}}
{{- partial "map.html" . -}}
{{- $.Scratch.Set "twitter_handle" "devopsdays" -}}
{{- $.Scratch.Set "sharing_title" "devopsdays" -}}
{{- end -}}
<!-- set strutured metadata -->
{{- if .IsPage -}}
{{- if or (eq .Type "welcome") (eq .Type "event") -}}
{{- partial "events/event_metadata.html" . -}}
{{- end -}}
{{- end -}}
<!-- end metadata -->
<script src={{"js/devopsdays-min.js" | absURL}}></script>
{{- if .IsPage -}}
{{ if eq (index (split (.Permalink | relURL) "/") 1) "events" }}
{{- $e := (index $.Site.Data.events (index (split (.Permalink | relURL) "/") 2)) -}}
{{- if $e.event_twitter -}}
{{- if ne $e.event_twitter "" -}}
{{- $.Scratch.Set "twitter_handle" $e.event_twitter -}}
{{- end -}}
{{- end -}}
{{- if isset .Params "Title" -}}
{{- if ne .Params.Title "" -}}
{{- $.Scratch.Set "sharing_title" .Params.Title -}}
{{- end -}}
{{- else -}}
{{- $sharing_title := (printf "devopsdays %s - %s" $e.city $e.year) -}}
{{- $.Scratch.Set "sharing_title" $sharing_title -}}
{{- end -}}
{{- else -}}
{{- $.Scratch.Set "twitter_handle" "devopsdays" -}}
{{- if isset .Params "Title" -}}
{{- if ne .Params.Title "" -}}
{{- $.Scratch.Set "sharing_title" .Params.Title -}}
{{- end -}}
{{- else -}}
{{- if eq .Type "blog" -}}
{{- $.Scratch.Set "sharing_title" .Params.Title -}}
{{- else -}}
{{- $.Scratch.Set "sharing_title" "devopsdays" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
<script>
//shares
$(document).ready(function () {
//YOUR JQUERY CODE
$("#share").jsSocials({
shares: ["email", {share: "twitter", via: '{{ $.Scratch.Get "twitter_handle" }}'}, "facebook", "linkedin"],
text: '{{ ($.Scratch.Get "sharing_title") }}',
showLabel: false,
showCount: false
});
});
</script>