No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Latest commit c2d59a6 Dec 10, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CHANGELOG.md changelog updated Dec 10, 2018
LICENSE initial commit Feb 3, 2017
README.md initial commit Feb 3, 2017
blueprints.yaml prepare for release Dec 10, 2018
social-counters.php Fix for GitHub API 2.0 Dec 10, 2018
social-counters.yaml initial commit Feb 3, 2017

README.md

Social Counters Plugin

The Social Counters plugin retrieves counts for both GitHub stars and Twitter followers and makes them available as Twig variables. You can see a demo here.

Installation

Installing the Social Counters plugin can be done in one of two ways. The GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.

GPM Installation (Preferred)

The simplest way to install this plugin is via the Grav Package Manager (GPM) through your system's terminal (also called the command line). From the root of your Grav install type:

bin/gpm install social-counters

This will install the Social Counters plugin into your /user/plugins directory within Grav. Its files can be found under /your/site/grav/user/plugins/social-counters.

Configuration

Before configuring this plugin, you should copy the user/plugins/social-counters/social-counters.yaml to user/config/plugins/social-counters.yaml and only edit that copy.

Here is the default configuration and an explanation of available options:

enabled: true
cache_timeout: 3600
github:
  user: getgrav
  repo: grav
twitter:
  user: getgrav

Just update the information for your GitHub and Twitter accounts.

Note: the cache_timeout of 3600 is a sensible default to ensure you don't need to use any OAUTH tokens to get past any API limits

Usage

The plugin makes a couple of variables available to be used:

GitHub Star Gazers (Stars)

{{ social_counters.github.stars }}

Twitter followers

{{ social_counters.twitter.followers }}