Skip to content

Commit 36d7f9a

Browse files
committed
Add social share configuration
- Introduced `social_shares` field to specify which social share buttons to display, defaulting to email and LinkedIn. - Updated documentation to reflect the new `social_shares` option. - Modified footer scripts to dynamically build social share buttons based on event configuration.
1 parent 23fa90b commit 36d7f9a

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

data/events/2025/halifax/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ event_twitter: "DevOpsDaysHali" # Change this to the twitter handle for your eve
55
description: "The premier DevOps conference for Atlantic Canada" # Edit this to suit your preferences
66
ga_tracking_id: "" # If you have your own Google Analytics tracking ID, enter it here. Example: "UA-74738648-1"
77

8+
# Social Share Buttons - Only show email and LinkedIn (no Facebook or Twitter)
9+
social_shares: ["email", "linkedin"]
10+
811
masthead_background: "halifax-background.png"
912
sharing_image: "halifax-sharing.png"
1013

themes/devopsdays-theme/layouts/partials/footer_scripts.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,21 @@
2121
{{- $sharing_title := (printf "devopsdays %s - %s" $e.city $e.year) -}}
2222
{{- $.Scratch.Set "sharing_title" $sharing_title -}}
2323
{{- end -}}
24+
{{- /* Build social shares array based on event configuration or use defaults */ -}}
25+
{{- $shares := slice -}}
26+
{{- if $e.social_shares -}}
27+
{{- range $e.social_shares -}}
28+
{{- if eq . "twitter" -}}
29+
{{- $shares = $shares | append (dict "share" "twitter" "via" ($.Scratch.Get "twitter_handle")) -}}
30+
{{- else -}}
31+
{{- $shares = $shares | append . -}}
32+
{{- end -}}
33+
{{- end -}}
34+
{{- else -}}
35+
{{- /* Default: all social share buttons */ -}}
36+
{{- $shares = slice "email" (dict "share" "twitter" "via" ($.Scratch.Get "twitter_handle")) "facebook" "linkedin" -}}
37+
{{- end -}}
38+
{{- $.Scratch.Set "social_shares" $shares -}}
2439
{{- else -}}
2540
{{- $.Scratch.Set "twitter_handle" "devopsdays" -}}
2641
{{- if isset .Params "Title" -}}
@@ -44,8 +59,13 @@
4459
$(document).ready(function () {
4560
//YOUR JQUERY CODE
4661

62+
{{- $shares := $.Scratch.Get "social_shares" -}}
63+
{{- if not $shares -}}
64+
{{- /* Default for non-event pages */ -}}
65+
{{- $shares = slice "email" (dict "share" "twitter" "via" ($.Scratch.Get "twitter_handle")) "facebook" "linkedin" -}}
66+
{{- end -}}
4767
$("#share").jsSocials({
48-
shares: ["email", {share: "twitter", via: '{{ $.Scratch.Get "twitter_handle" }}'}, "facebook", "linkedin"],
68+
shares: {{ $shares | jsonify }},
4969
text: '{{ ($.Scratch.Get "sharing_title") }}',
5070
showLabel: false,
5171
showCount: false

themes/devopsdays-theme/reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ All dates are in unquoted YYYY-MM-DD, like this: `variable: 2016-01-05`, or like
9191
| `event_social_slack` | String | No | The invite URL to your slack workspace. | "https://join.slack.com/t/dodrox/shared_invite/xyz" |
9292
| `event_social_listserv` | String | No | The URL to subscribe to your group mailing list. | "https://lists.devopsdays.org/subscription?f=xyz". |
9393
| `event_twitter` | String | No | Legacy field for the twitter handle. Exclude the "@" symbol. Kept for backward support. | "devopsdayschi" |
94+
| `social_shares` | Array | No | Specify which social share buttons to display on event pages. Valid values: "email", "twitter", "facebook", "linkedin". If not specified, defaults to all four buttons. | ["email", "linkedin"] |
9495

9596
### Branding Fields
9697

utilities/examples/data/events/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ event_social_youtube: "devopsdayscityabbr" # Change this to the youtube channel
4646
# legacy
4747
event_twitter: "devopsdayscityabbr" # This will create a traditional "Follow" twitter button. Change this to the twitter handle for your event such as devopsdayschi or devopsdaysmsp.
4848

49+
# Social Share Buttons
50+
# Optional: Specify which social share buttons to display on event pages.
51+
# If not specified, defaults to all: ["email", "twitter", "facebook", "linkedin"]
52+
# Valid values: "email", "twitter", "facebook", "linkedin"
53+
# Example: social_shares: ["email", "linkedin"] # Only show email and LinkedIn share buttons
54+
social_shares: # ["email", "twitter", "facebook", "linkedin"]
55+
4956
nav_elements: # List of pages you want to show up in the navigation of your page.
5057
# - name: propose
5158
# - name: location

0 commit comments

Comments
 (0)