Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[global] add social badges to shortcodes #14902

Merged
merged 10 commits into from
Feb 22, 2025
36 changes: 16 additions & 20 deletions themes/devopsdays-theme/layouts/partials/events/cta.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

<div class = "row">

<!-- propose button -->
{{- if $e.startdate -}}
{{- if $e.cfp_date_start -}}
{{- if and (ge now (time $e.cfp_date_start)) (le now (time $e.cfp_date_end)) -}}
<div class = "col-auto offset-1 offset-md-0 welcome-page-cta">
<a href='{{ (partial "functions/get-cfp-url" $e) }}' class="btn jssocials-share-link event-cta-button" role="button" aria-pressed="true">Propose</a>
</div>
{{- end -}}
{{- end -}}
{{- end -}}

<!-- register button -->
{{- if $e.registration_open -}}
{{- if eq $e.registration_open "true" -}}
Expand Down Expand Up @@ -46,26 +57,11 @@
{{- end -}}
{{- end -}}



<!-- propose button -->
{{- if $e.startdate -}}
{{- if $e.cfp_date_start -}}
{{- if and (ge now (time $e.cfp_date_start)) (le now (time $e.cfp_date_end)) -}}
<div class = "col-auto offset-1 offset-md-0 welcome-page-cta">
<a href='{{ (partial "functions/get-cfp-url" $e) }}' class="btn jssocials-share-link event-cta-button" role="button" aria-pressed="true">Propose</a>
</div>
{{- end -}}
{{- end -}}
{{- end -}}



<!-- follow on twitter button -->
{{- if $e.event_twitter -}}
{{- if ne $e.event.twitter "" -}}
<!-- contact via email button -->
{{- if $e.organizer_email -}}
{{- if ne $e.organizer_email "" -}}
<div class = "col-auto offset-1 offset-md-0 welcome-page-cta">
<a href="https://twitter.com/{{$e.event_twitter}}" class="btn jssocials-share-link event-cta-button" role="button" aria-pressed="true">Follow</a>
<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>
</div>
{{- end -}}
{{- end -}}
Expand Down Expand Up @@ -120,4 +116,4 @@
<div id="share"></div>
</div>

</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- $e := partial "functions/get-event-data" . -}}

{{- if $e.event_social_bsky -}}
<a href="{{ $e.event_social_bsky }}" class="fa-brands social-bsky fa-bluesky" target="_blank" title="Join us on Bluesky"></a>
{{- else -}}
<a href="{{ index .Params 0 }}" class="fa-brands social-bsky fa-bluesky" target="_blank" title="Join us on BlueSky"></a>
{{- end -}}
<style>
.social-bsky {
color: black;
height: 50px;
padding: 12px;
font-size: 30px;
text-decoration: none;
display: inline-block;
}
.social-bksy:hover {
color: rgb(17, 134, 243);
text-decoration: none;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- $e := partial "functions/get-event-data" . -}}

{{- if $e.event_social_linkedin -}}
<a href="{{ $e.event_social_linkedin }}" class="fa-brands social-li fa-linkedin" target="_blank" title="Follow on Linkedin"></a>
{{- else -}}
<a href="{{ index .Params 0 }}" class="fa-brands fa-linkedin" target="_blank" title="Follow on Linkedin"></a>
{{- end -}}
<style>
.social-li {
color: black;
height: 50px;
padding: 12px;
font-size: 30px;
text-decoration: none;
display: inline-block;
}
.social-li:hover {
color: rgb(29, 96, 196);
text-decoration: none;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- $e := partial "functions/get-event-data" . -}}

{{- if $e.event_social_listserv -}}
<a href="{{ $e.event_social_listserv }}" class="fa fa-envelope social-envelope" target="_blank" title="Subscribe to our Mailing List"></a>
{{- else -}}
<a href="{{ index .Params 0 }}" class="fa fa-envelope social-envelope" target="_blank" title="Subscribe to our Mailing List"></a>
{{- end -}}
<style>
.social-envelope {
color: black;
height: 50px;
padding: 12px;
font-size: 30px;
text-decoration: none;
display: inline-block;
}
.social-envelope:hover {
color: rgb(46, 124, 43);
text-decoration: none;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- $e := partial "functions/get-event-data" . -}}

{{- if $e.event_social_mastodon -}}
<a href="{{ $e.event_social_mastodon }}" class="fa-brands social-mstd fa-mastodon" target="_blank" title="Join us on Mastodon"></a>
{{- else -}}
<a href="{{ index .Params 0 }}" class="fa-brands social-mstd fa-mastodon" target="_blank" title="Join us on Mastodon"></a>
{{- end -}}
<style>
.social-mstd {
color: black;
height: 50px;
padding: 12px;
font-size: 30px;
text-decoration: none;
display: inline-block;
}
.social-mstd:hover {
color: rgb(110, 99, 218);
text-decoration: none;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- $e := partial "functions/get-event-data" . -}}

{{- if $e.event_social_slack -}}
<a href="{{ $e.event_social_slack }}" class="fa-brands fa-slack social-slack" target="_blank" title="Join us on Slack"></a>
{{- else -}}
<a href="{{ index .Params 0 }}" class="fa-brands fa-slack social-slack" target="_blank" title="Join us on Slack"></a>
{{- end -}}
<style>
.social-slack {
color: black;
height: 50px;
padding: 12px;
font-size: 30px;
text-decoration: none;
display: inline-block;
}
.social-slack:hover {
color: rgb(223, 180, 42);
text-decoration: none;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- $e := partial "functions/get-event-data" . -}}

{{- if $e.event_social_twitter -}}
<a href="https://twitter.com/{{ $e.event_social_twitter }}" class="fa-brands fa-twitter social-x" target="_blank" title="Follow on Twitter"></a>
{{- else -}}
<a href="https://twitter.com/{{ index .Params 0 }}" class="fa-brands fa-twitter social-x" target="_blank" title="Follow on Twitter"></a>
{{- end -}}
<style>
.social-x {
color: black;
height: 50px;
padding: 12px;
font-size: 30px;
text-decoration: none;
display: inline-block;
}
.social-x:hover {
color: rgb(95, 92, 92);
text-decoration: none;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- $e := partial "functions/get-event-data" . -}}

{{- if $e.event_social_youtube -}}
<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>
{{- else -}}
<a href="https://www.youtube.com/@{{ index .Params 0 }}" class="fa-brands fa-youtube" target="_blank" title="subscribe to our channel"></a>
{{- end -}}
<style>
.social-yt {
color: black;
height: 50px;
padding: 12px;
font-size: 30px;
text-decoration: none;
display: inline-block;
}
.social-yt:hover {
color: rgb(224, 52, 52);
text-decoration: none;
}
</style>
12 changes: 12 additions & 0 deletions utilities/examples/data/events/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ location: "yourlocation" # Defaults to city, but you can make it the venue name.
#
location_address: "" #Optional - use the street address of your venue. This will show up on the welcome page if set. Also used by the event_map shortcode!

# Optional - Social badges
# These can be used in the body of any page via matching shortcodes. See sample: https://devopsdays.org/events/2025-denver/welcome/
event_social_linkedin: "https://linkedin.com/company/devopsdayscityabbr" # Change this to the url to your Linkedin group, company, or page.
event_social_slack: "https://join.slack.com/t/devopsdayscityabbr/custom_shared_invite_url" # Change this to your slack invite link.
event_social_listserv: "https://lists.devopsdays.org/subscription?custom_listserv_invite_url" # Change this to your mailing list subscription form url.
event_social_twitter: "devopsdayscityabbr" # Change this to the twitter handle for your event such as devopsdayschi or devopsdaysmsp
event_social_mastadon: "https://mastodon.social/@devopsdayscityabbr" # Change this to url to your mastadon page
event_social_bsky: "https://bsky.app/profile/devopsdayscityabbr.bsky.social" # Change this to url to your bluesky page
event_social_youtube: "devopsdayscityabbr" # Change this to the youtube channel handle for your event such as devopsdaysrox
# legacy
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.

nav_elements: # List of pages you want to show up in the navigation of your page.
# - name: propose
# - name: location
Expand Down
Loading