Git Product home page Git Product logo

hugo-github-calendar's Introduction

hugo-github-calendar

GitHub License

About

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.

Screenshot

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

Usage

  1. Add the hugo-github-calendar as a submodule to be able to get upstream changes later git submodule add https://github.com/totoroot/hugo-github-calendar.git themes/hugo-github-calendar

  2. Add hugo-github-calendar as the left-most element of the theme list variable in your site's or theme's configuration file config.yaml or config.toml. Example, with config.yaml:

    theme: ["hugo-github-calendar", "my-theme"]

    or, with config.toml,

    theme = ["hugo-github-calendar", "my-theme"]
  3. 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.

License

hugo-github-calendar by Matthias Thym, as well as github-calendar.js are licensed under MIT license.

hugo-github-calendar's People

Contributors

totoroot avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

theonlyrou

hugo-github-calendar's Issues

an issue

TypeError: Cannot read properties of null (reading 'getAttribute')
    at github-calendar.min.min.b1d3fd5020bb78b132c2a87d51e3e0b9.js:1:2641

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.