Skip to content

Commit

Permalink
Add Bluesky social link option throughout site (#953)
Browse files Browse the repository at this point in the history
* Add Bluesky social link to site and event footer

Signed-off-by: Chris Abraham <[email protected]>

* Add Bluesky metadata fields to sidebars

Signed-off-by: Chris Abraham <[email protected]>

* Add Bluesky link to speaker profiles

Signed-off-by: Chris Abraham <[email protected]>

---------

Signed-off-by: Chris Abraham <[email protected]>
  • Loading branch information
cjyabraham authored Dec 3, 2024
1 parent f7e8b0a commit 4c75c01
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ public function speaker_custom_column_data( $column, $post_id ) {
case 'twitter_url':
echo get_post_meta( $post_id, 'lfes_speaker_twitter', true ) ? '<span class="dashicons dashicons-yes-alt" style="color:green"></span>' : '<span class="dashicons dashicons-no-alt" style="color:red"></span>';
break;
case 'bluesky_url':
echo get_post_meta( $post_id, 'lfes_speaker_bluesky', true ) ? '<span class="dashicons dashicons-yes-alt" style="color:green"></span>' : '<span class="dashicons dashicons-no-alt" style="color:red"></span>';
break;
case 'github_url':
echo get_post_meta( $post_id, 'lfes_speaker_github', true ) ? '<span class="dashicons dashicons-yes-alt" style="color:green"></span>' : '<span class="dashicons dashicons-no-alt" style="color:red"></span>';
break;
Expand All @@ -419,14 +422,15 @@ public function speaker_custom_column( $columns ) {
unset( $columns['date'] );
unset( $columns['author'] );
// add new columns.
$columns['featured_image'] = 'Speaker Image';
$columns['featured_image'] = 'Image';
$columns['job_title'] = 'Title';
$columns['company'] = 'Company';
$columns['company_logo'] = 'Company Logo';
$columns['linkedin_url'] = 'Linkedin URL';
$columns['twitter_url'] = 'X URL';
$columns['github_url'] = 'GitHub URL';
$columns['website_url'] = 'Website URL';
$columns['company_logo'] = 'Logo';
$columns['linkedin_url'] = 'Linkedin';
$columns['twitter_url'] = 'X';
$columns['bluesky_url'] = 'Bluesky';
$columns['github_url'] = 'GitHub';
$columns['website_url'] = 'Website';
// add back in old columns.
$columns['author'] = $author;
$columns['date'] = $date;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,17 @@
'default_value' => '',
'placeholder' => __( 'https://twitter.com/CloudNativeFdn' ),
),
array(
'type' => 'text',
'id' => 'bluesky',
'data_type' => 'meta',
'data_key' => 'bluesky',
'label' => __( 'Bluesky' ),
'register_meta' => true,
'ui_border_top' => true,
'default_value' => '',
'placeholder' => __( 'https://bsky.app/profile/cncf.io' ),
),
array(
'type' => 'text',
'id' => 'github',
Expand Down Expand Up @@ -897,6 +908,17 @@
'default_value' => '',
'placeholder' => __( 'https://twitter.com/username' ),
),
array(
'type' => 'text',
'id' => 'bluesky',
'data_type' => 'meta',
'data_key' => 'bluesky',
'label' => __( 'Bluesky' ),
'register_meta' => true,
'ui_border_top' => false,
'default_value' => '',
'placeholder' => __( 'https://bsky.app/profile/cncf.io' ),
),
array(
'type' => 'text',
'id' => 'github',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
$company_logo = get_post_meta( $speaker_id, 'lfes_speaker_company_logo', true );
$linkedin = get_post_meta( $speaker_id, 'lfes_speaker_linkedin', true );
$twitter = get_post_meta( $speaker_id, 'lfes_speaker_twitter', true );
$bluesky = get_post_meta( $speaker_id, 'lfes_speaker_bluesky', true );
$github = get_post_meta( $speaker_id, 'lfes_speaker_github', true );
$website = get_post_meta( $speaker_id, 'lfes_speaker_website', true );
$content = get_the_content();
Expand Down Expand Up @@ -177,7 +178,7 @@
<div class="speaker-modal__social">
<?php
// Social Icons.
if ( $linkedin || $twitter || $github || $website ) :
if ( $linkedin || $twitter || $bluesky || $github || $website ) :

if ( $twitter ) :
?>
Expand All @@ -192,6 +193,14 @@
</svg></a>
<?php
endif;
if ( $bluesky ) :
?>
<a target="_blank" rel="noopener noreferrer"
href="<?php echo esc_url( $bluesky ); ?>">
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="2.96 3.83 18.46 16.27"><path d="M7.20057 5.27426c-1.44899-1.13849-3.82948-1.96649-3.82948.7245 0 .56924.3105 4.55394.46575 5.22674.67275 2.2252 2.94973 2.7945 5.01972 2.484-3.57073.5692-4.50222 2.5874-2.53573 4.6057 3.72597 3.8812 5.38197-.9315 5.79597-2.1735l.1035-.2588.1035.2588c.414 1.242 2.07 6.0547 5.796 2.1735 1.9664-2.0183 1.0349-4.0365-2.5358-4.6057 2.07.3105 4.347-.2588 5.0197-2.484.1553-.6728.4658-4.6575.4658-5.22674 0-2.69099-2.3805-1.86299-3.8295-.7245-2.0182 1.50074-4.2435 4.60572-5.0197 6.26174-.7763-1.65602-3.00149-4.761-5.01973-6.26174z"/></svg>
</a>
<?php
endif;
if ( $linkedin ) :
?>
<a target="_blank" rel="noopener noreferrer"
Expand Down
6 changes: 6 additions & 0 deletions web/wp-content/themes/lfevents/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class="<?php echo esc_html( $footer_classes ); ?>">

<?php
$twitter = 'https://twitter.com/linuxfoundation';
$bluesky = 'https://bsky.app/profile/linuxfoundation.org';
$linkedin = 'https://www.linkedin.com/company/the-linux-foundation/';
$youtube = 'https://www.youtube.com/user/TheLinuxFoundation';
$facebook = 'https://www.facebook.com/TheLinuxFoundation/';
Expand All @@ -80,6 +81,11 @@ class="<?php echo esc_html( $footer_classes ); ?>">
get_template_part( 'template-parts/svg/twitter' );
echo '</a></li>';
}
if ( $bluesky ) {
echo '<li class="s-bs"><a rel="noopener" title="Bluesky" target="_blank" href="' . esc_html( $bluesky ) . '">';
get_template_part( 'template-parts/svg/bluesky' );
echo '</a></li>';
}
if ( $linkedin ) {
echo '<li class="s-li"><a rel="noopener" title="Linkedin" target="_blank" href="' . esc_html( $linkedin ) . '">';
get_template_part( 'template-parts/svg/linkedin' );
Expand Down
9 changes: 8 additions & 1 deletion web/wp-content/themes/lfevents/singular.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ class="event-footer-newsletter__title"><?php echo wp_kses( $form_title, array( '
$youtube = get_post_meta( $parent_id, 'lfes_youtube', true );
$facebook = get_post_meta( $parent_id, 'lfes_facebook', true );
$twitter = get_post_meta( $parent_id, 'lfes_twitter', true );
$bluesky = get_post_meta( $parent_id, 'lfes_bluesky', true );
$github = get_post_meta( $parent_id, 'lfes_github', true );
$instagram = get_post_meta( $parent_id, 'lfes_instagram', true );
$twitch = get_post_meta( $parent_id, 'lfes_twitch', true );
Expand All @@ -304,9 +305,10 @@ class="event-footer-newsletter__title"><?php echo wp_kses( $form_title, array( '
$hashtag = get_post_meta( $parent_id, 'lfes_hashtag', true );

// if no custom social links are set, fallback to defaults for LF.
if ( ! $wechat && ! $linkedin && ! $qq && ! $youtube && ! $facebook && ! $twitter && ! $instagram ) {
if ( ! $wechat && ! $linkedin && ! $qq && ! $youtube && ! $facebook && ! $twitter && ! $bluesky && ! $instagram ) {

$twitter = 'https://twitter.com/linuxfoundation';
$bluesky = 'https://bsky.app/profile/linuxfoundation.org';
$linkedin = 'https://www.linkedin.com/company/the-linux-foundation/';
$youtube = 'https://www.youtube.com/user/TheLinuxFoundation';
$facebook = 'https://www.facebook.com/TheLinuxFoundation/';
Expand All @@ -332,6 +334,11 @@ class="event-footer-logo-social__wrapper <?php echo esc_html( $menu_text_color )
get_template_part( 'template-parts/svg/twitter' );
echo '</a></li>';
}
if ( $bluesky ) {
echo '<li><a rel="noopener" title="Bluesky" target="_blank" href="' . esc_html( $bluesky ) . '">';
get_template_part( 'template-parts/svg/bluesky' );
echo '</a></li>';
}
if ( $github ) {
echo '<li><a rel="noopener" title="X" target="_blank" href="' . esc_html( $github ) . '">';
get_template_part( 'template-parts/svg/github' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@
align-items: center;

&.s-tw:hover {
background-color: #46d4fe;
background-color: #5d5d5d;
}
&.s-bs:hover {
background-color: #1083fe;
}
&.s-li:hover {
background-color: #419cca;
background-color: #0a66c2;
}
&.s-yt:hover {
background-color: #a72b1d;
Expand Down
10 changes: 10 additions & 0 deletions web/wp-content/themes/lfevents/template-parts/svg/bluesky.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/**
* Bluesky icon
*
* @package FoundationPress
* @since FoundationPress 1.0.0
*/

?>
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="2.96 3.83 18.46 16.27"><path d="M7.20057 5.27426c-1.44899-1.13849-3.82948-1.96649-3.82948.7245 0 .56924.3105 4.55394.46575 5.22674.67275 2.2252 2.94973 2.7945 5.01972 2.484-3.57073.5692-4.50222 2.5874-2.53573 4.6057 3.72597 3.8812 5.38197-.9315 5.79597-2.1735l.1035-.2588.1035.2588c.414 1.242 2.07 6.0547 5.796 2.1735 1.9664-2.0183 1.0349-4.0365-2.5358-4.6057 2.07.3105 4.347-.2588 5.0197-2.484.1553-.6728.4658-4.6575.4658-5.22674 0-2.69099-2.3805-1.86299-3.8295-.7245-2.0182 1.50074-4.2435 4.60572-5.0197 6.26174-.7763-1.65602-3.00149-4.761-5.01973-6.26174z"/></svg>

0 comments on commit 4c75c01

Please sign in to comment.