Skip to content

Commit 6e8a990

Browse files
[global] add social badges to shortcodes (#14902)
1 parent 3413510 commit 6e8a990

11 files changed

Lines changed: 186 additions & 32 deletions

File tree

themes/devopsdays-theme/layouts/partials/events/cta.html

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
<div class = "row">
44

5+
<!-- propose button -->
6+
{{- if $e.startdate -}}
7+
{{- if $e.cfp_date_start -}}
8+
{{- if and (ge now (time $e.cfp_date_start)) (le now (time $e.cfp_date_end)) -}}
9+
<div class = "col-auto offset-1 offset-md-0 welcome-page-cta">
10+
<a href='{{ (partial "functions/get-cfp-url" $e) }}' class="btn jssocials-share-link event-cta-button" role="button" aria-pressed="true">Propose</a>
11+
</div>
12+
{{- end -}}
13+
{{- end -}}
14+
{{- end -}}
15+
516
<!-- register button -->
617
{{- if $e.registration_open -}}
718
{{- if eq $e.registration_open "true" -}}
@@ -46,26 +57,11 @@
4657
{{- end -}}
4758
{{- end -}}
4859

49-
50-
51-
<!-- propose button -->
52-
{{- if $e.startdate -}}
53-
{{- if $e.cfp_date_start -}}
54-
{{- if and (ge now (time $e.cfp_date_start)) (le now (time $e.cfp_date_end)) -}}
55-
<div class = "col-auto offset-1 offset-md-0 welcome-page-cta">
56-
<a href='{{ (partial "functions/get-cfp-url" $e) }}' class="btn jssocials-share-link event-cta-button" role="button" aria-pressed="true">Propose</a>
57-
</div>
58-
{{- end -}}
59-
{{- end -}}
60-
{{- end -}}
61-
62-
63-
64-
<!-- follow on twitter button -->
65-
{{- if $e.event_twitter -}}
66-
{{- if ne $e.event.twitter "" -}}
60+
<!-- contact via email button -->
61+
{{- if $e.organizer_email -}}
62+
{{- if ne $e.organizer_email "" -}}
6763
<div class = "col-auto offset-1 offset-md-0 welcome-page-cta">
68-
<a href="https://twitter.com/{{$e.event_twitter}}" class="btn jssocials-share-link event-cta-button" role="button" aria-pressed="true">Follow</a>
64+
<a href="mailto:{{ $e.organizer_email }}?subject=DevOpsDays {{ $e.city }} {{ $e.year }}" class="btn jssocials-share-link event-cta-button" role="button" aria-pressed="true">Contact</a>
6965
</div>
7066
{{- end -}}
7167
{{- end -}}
@@ -120,4 +116,4 @@
120116
<div id="share"></div>
121117
</div>
122118

123-
</div>
119+
</div>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- $e := partial "functions/get-event-data" . -}}
2+
3+
{{- if $e.event_social_bsky -}}
4+
<a href="{{ $e.event_social_bsky }}" class="fa-brands social-bsky fa-bluesky" target="_blank" title="Join us on Bluesky"></a>
5+
{{- else -}}
6+
<a href="{{ index .Params 0 }}" class="fa-brands social-bsky fa-bluesky" target="_blank" title="Join us on BlueSky"></a>
7+
{{- end -}}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- $e := partial "functions/get-event-data" . -}}
2+
3+
{{- if $e.event_social_linkedin -}}
4+
<a href="{{ $e.event_social_linkedin }}" class="fa-brands social-li fa-linkedin" target="_blank" title="Follow on Linkedin"></a>
5+
{{- else -}}
6+
<a href="{{ index .Params 0 }}" class="fa-brands fa-linkedin" target="_blank" title="Follow on Linkedin"></a>
7+
{{- end -}}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- $e := partial "functions/get-event-data" . -}}
2+
3+
{{- if $e.event_social_listserv -}}
4+
<a href="{{ $e.event_social_listserv }}" class="fa fa-envelope social-envelope" target="_blank" title="Subscribe to our Mailing List"></a>
5+
{{- else -}}
6+
<a href="{{ index .Params 0 }}" class="fa fa-envelope social-envelope" target="_blank" title="Subscribe to our Mailing List"></a>
7+
{{- end -}}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- $e := partial "functions/get-event-data" . -}}
2+
3+
{{- if $e.event_social_mastodon -}}
4+
<a href="{{ $e.event_social_mastodon }}" class="fa-brands social-mstd fa-mastodon" target="_blank" title="Join us on Mastodon"></a>
5+
{{- else -}}
6+
<a href="{{ index .Params 0 }}" class="fa-brands social-mstd fa-mastodon" target="_blank" title="Join us on Mastodon"></a>
7+
{{- end -}}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- $e := partial "functions/get-event-data" . -}}
2+
3+
{{- if $e.event_social_slack -}}
4+
<a href="{{ $e.event_social_slack }}" class="fa-brands fa-slack social-slack" target="_blank" title="Join us on Slack"></a>
5+
{{- else -}}
6+
<a href="{{ index .Params 0 }}" class="fa-brands fa-slack social-slack" target="_blank" title="Join us on Slack"></a>
7+
{{- end -}}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- $e := partial "functions/get-event-data" . -}}
2+
3+
{{- if $e.event_social_twitter -}}
4+
<a href="https://twitter.com/{{ $e.event_social_twitter }}" class="fa-brands fa-twitter social-x" target="_blank" title="Follow on Twitter"></a>
5+
{{- else -}}
6+
<a href="https://twitter.com/{{ index .Params 0 }}" class="fa-brands fa-twitter social-x" target="_blank" title="Follow on Twitter"></a>
7+
{{- end -}}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- $e := partial "functions/get-event-data" . -}}
2+
3+
{{- if $e.event_social_youtube -}}
4+
<a href="https://www.youtube.com/@{{ $e.event_social_youtube }}" class="fa-brands social-yt fa-youtube" target="_blank" title="Subscribe to our channel"></a>
5+
{{- else -}}
6+
<a href="https://www.youtube.com/@{{ index .Params 0 }}" class="fa-brands fa-youtube" target="_blank" title="subscribe to our channel"></a>
7+
{{- end -}}

themes/devopsdays-theme/reference.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,17 @@ The `/data/events/YYYY/CITY.main.yml` file is the main configuration file for yo
4747

4848
### General Fields
4949

50-
| Field Name | Type | Required | Description | Example |
51-
|------------------|--------|----------|-------------------------------------------------------------------------------------------------------|-----------------------------------------------|
52-
| `name` | String | Yes | The name of the event. Four digit year with the city name in lower-case, with no spaces. | "2017-chicago" |
53-
| `year` | String | Yes | The year of the event. Make sure it is in quotes. | "2017" |
54-
| `city` | String | Yes | The displayed city name of the event. Capitalize it. | "Salt Lake City" |
55-
| `event_twitter` | String | Yes | The twitter handle for your event such as "devopsdayschi" or "devopsdaysmsp". Exclude the "@" symbol. | "devopsdayschi" |
56-
| `description` | String | No | Overall description of your event. Quotation marks need to be escaped. | "It's time for more DevOpsDays at Ponyville!" |
57-
| `ga_tracking_id` | String | No | If you have your own Google Analytics tracking ID, enter it here. | "UA-74738648-1" |
58-
| `gtm_tracking_id` | String | No | If you have your own Google Analytics v4 tracking ID, enter it here. | "G-NCBC4PBEMK" |
59-
| `event_group` | String | No | If you'd like to group different events together (ie, "australia"), set them to the same "event_group" | "ponyville" |
60-
| `speakers_verbose` | String | No | Set this to "true" if you want verbose speaker attributes (URLs visible). | "true" |
61-
| `cancel` | String | No | If your event must be cancelled, add this field with the value of "true" (case-sensitive). This will keep it from being listed in the "upcoming events" views. | "true" | |
50+
| Field Name | Type | Required | Description | Example |
51+
|--------------------|--------|----------|-------------------------------------------------------------------------------------------------------|-----------------------------------------------|
52+
| `name` | String | Yes | The name of the event. Four digit year with the city name in lower-case, with no spaces. | "2017-chicago" |
53+
| `year` | String | Yes | The year of the event. Make sure it is in quotes. | "2017" |
54+
| `city` | String | Yes | The displayed city name of the event. Capitalize it. | "Salt Lake City" |
55+
| `description` | String | No | Overall description of your event. Quotation marks need to be escaped. | "It's time for more DevOpsDays at Ponyville!" |
56+
| `ga_tracking_id` | String | No | If you have your own Google Analytics tracking ID, enter it here. | "UA-74738648-1" |
57+
| `gtm_tracking_id` | String | No | If you have your own Google Analytics v4 tracking ID, enter it here. | "G-NCBC4PBEMK" |
58+
| `event_group` | String | No | If you'd like to group different events together (ie, "australia"), set them to the same "event_group"| "ponyville" |
59+
| `speakers_verbose` | String | No | Set this to "true" if you want verbose speaker attributes (URLs visible). | "true" |
60+
| `cancel` | String | No | If your event must be cancelled, add this field with the value of "true" (case-sensitive). This will keep it from being listed in the "upcoming events" views. | "true" |
6261

6362
### Date-related Fields
6463
All dates are in unquoted YYYY-MM-DD, like this: `variable: 2016-01-05`, or like `variable: 2016-01-05T23:59:00-06:00`
@@ -80,6 +79,18 @@ All dates are in unquoted YYYY-MM-DD, like this: `variable: 2016-01-05`, or like
8079
| `registration_link` | String | No | If you have a custom registration link, enter it here. This will control the Registration menu item as well as the "Register" button. | "https://myurlhere" reference it like {{< event_link url-key="registration_link" text="Register to attend the conference!" >}} | |
8180
| `sponsor_link` | String | No | If you have a custom sponsorship link, enter it here. This will control the "Become an X Sponsor!" links. It does NOT change the "Sponsor" button. | "https://myurlhere" | |
8281

82+
### Social Fields
83+
| Field Name | Type | Required | Description | Example |
84+
|-------------------------|--------|----------|-------------------------------------------------------------------------------------------------------|------------------------------------------------------|
85+
| `event_social_twitter` | String | No | The twitter handle for your event such as "devopsdayschi" or "devopsdaysmsp". Exclude the "@" symbol. | "devopsdaysrox" |
86+
| `event_social_linkedin` | String | No | The direct URL to your linkedin event or group/company page. | "https://www.linkedin.com/company/devopsdaysrox" |
87+
| `event_social_youtube` | String | No | The Youtube handle for your event such as "devopsdaysrox" or "devopsdayschi". Exclude the "@" symbol. | "devopsdaysrox" |
88+
| `event_social_bsky` | String | No | The BlueSky direct URL for your event/group profile. Can link to a custom server. | "https://bsky.app/profile/dodrox.bsky.social" |
89+
| `event_social_mastodon` | String | No | The Mastodon direct URL for your event/group profile. Can link to a custom server. | "https://mastodon.social/@dodrox" |
90+
| `event_social_slack` | String | No | The invite URL to your slack workspace. | "https://join.slack.com/t/dodrox/shared_invite/xyz" |
91+
| `event_social_listserv` | String | No | The URL to subscribe to your group mailing list. | "https://lists.devopsdays.org/subscription?f=xyz". |
92+
| `event_twitter` | String | No | Legacy field for the twitter handle. Exclude the "@" symbol. Kept for backward support. | "devopsdayschi" |
93+
8394
### Branding Fields
8495

8596
| Field Name | Type | Required | Description | Example |

themes/devopsdays-theme/static/css/site.css

Lines changed: 86 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)