This is not a standalone theme. It is a Hugo theme component providing a shortcode: github-calendar
to display github-calendar.js in your Hugo site.
Contrary to other shortcodes, this shortcode uses locally sourced JS and CSS so they must be included. Changes made from the upstream source files were:
- github-calendar.min.js: reducing the width of the graph inside its container for better looks (upstream the text is too close to the left border of its container)
- github-calendar.css: introducing root variables for background and text color to make them conveniently configurable via the shortcode
-
Add the
hugo-github-calendar
as a submodule to be able to get upstream changes latergit submodule add https://github.com/totoroot/hugo-github-calendar.git themes/hugo-github-calendar
-
Add
hugo-github-calendar
as the left-most element of thetheme
list variable in your site's or theme's configuration fileconfig.yaml
orconfig.toml
. Example, withconfig.yaml
:theme: ["hugo-github-calendar", "my-theme"]
or, with
config.toml
,theme = ["hugo-github-calendar", "my-theme"]
-
In your site, use the shortcode, this way:
{{< github-calendar username="totoroot" >}}{{</ github-calendar >}}
Just replace my username with yours. The shortcode expects at least the username, but accepts some optional variable as well.
All options that can be passed via shortcode, are listed below:
{{< github-calendar username="totoroot" responsive=true width=100 backgroundColor=#303030 textColor=#ececec >}}{{</ github-calendar >}}
Name Type Default Description username string totoroot The username used to fetch GitHub contributions. responsive bool true If graph should be sized responsively in relation to its container. width integer 100 The width of the graph's container in percent.backgroundColor CSS color value #303030 The color value to use for the background of the container. textColor CSS color value #ececec The color value to use for all text in the container.
hugo-github-calendar by Matthias Thym, as well as github-calendar.js are licensed under MIT license.