HB Social Share Buttons Module

This module allows users sharing your pages to popular social media.

Modulegithub.com/hbstack/social-share-buttons
Repository⭐ Please consider giving a star if your like it.
Stars
Version
Used by
Requirements
License
UsageSee how to use modules.

Goal

This module intends to be a simple social sharing component that to include links only and without any script as far as possible.

Partial

This module is used by other modules to generate the share buttons in wherever they want, to do so, you’ll need to import the module and include the hb/modules/social-share-buttons/index partial.

Partial Context

The partial accepts two arguments:

  1. page: the current page variable.
  2. params: the modules parameters.

Partial Example

Please replace the my_social_share_buttons with a better name.

1{{- $ctx := dict
2  "page" .
3  "params" (default dict site.Params.my_social_share_buttons)
4}}
5{{- if $ctx.params.media }}
6  {{ partial "hb/modules/social-share-buttons/index" $ctx }}
7{{- end }}

Parameters

icons

When false, hide the icons, default to true.

labels

When false, hide the labels, default to true.

alignment

How to align the buttons.

  • start: align to the left, default.
  • center: align to the center.
  • end: align to the right.
  • between: distribute buttons evenly.

media

The array of supported media.

Supported Media

Media
email
facebook
linkedin
reddit
sinaweibo
telegram
twitter
whatsapp
razonyang
Sunday, December 1, 2024 Friday, December 22, 2023