npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@barry-flynn/hexo-github-calendar

v1.0.4

Published

Plugin for displaying GitHub contribution heatmaps in Hexo

Downloads

100

Readme

hexo-github-calendar

本插件用于在 Hexo 中显示 GitHub 贡献度热力图

hexo-github-calendar

安装依赖

npm i @barry-flynn/hexo-github-calendar

添加配置

在 Hexo 项目根目录的 _config.yml 文件最后面添加如下配置(注意是在 Hexo 的配置文件中添加,而不是主题的配置文件),以我所使用的 Butterfly 主题为例,需要添加的内容为:

# hexo-github-canlendar
# 贡献度热力图插件 https://github.com/Barry-Flynn/hexo-github-calendar
githubcalendar:
  enable: true        # 是否启用本插件
  enable_page: /      # 要生效的页面,如 / 首页,/about/ 介绍页等
  user: Barry-Flynn   # GitHub 用户名
  layout:
    type: id
    name: recent-posts
    index: 0
  githubcalendar_html: '<div class="recent-post-item" style="width:100%;height:auto;padding:10px;"><div id="github_loading" style="width:10%;height:100%;margin:0 auto;display: block"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"  viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="#d0d0d0" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform></path></svg></div><div id="github_container"></div></div>'
  pc_minheight: 280px
  mobile_minheight: 0px
  # 贡献统计的梯度色卡值,可自行调整
  color: "['#ebedf0', '#a2f7af', '#6ce480', '#54ad63', '#469252', '#31753c', '#1f5f2a', '#13531f', '#084111', '#032b09', '#000000']"
  # 推荐填写你自建的API接口,方法详见本插件配套Python后端 https://github.com/Barry-Flynn/python_github_calendar_api
  api: https://github-calendar-api.meta-code.top/api
  calendar_js: https://cdn.jsdelivr.net/gh/barry-flynn/hexo-github-calendar/hexo_githubcalendar.js
  plus_style: ""

本地预览

hexo clean & hexo g & hexo s

说明与鸣谢

本项目 fork 自仓库 Zfour/hexo-github-calendar,对应的原 npm 依赖包是 hexo-githubcalendar,所匹配的原 Python 后端接口是 Zfour/python_github_calendar_api,原来的传参方式是直接在 API 接口后面拼接用户名 /api?Barry-Flynn,不符合 key-value 形式的标准规范,因此我对前后端都进行了改进。

本项目 Barry-Flynn/hexo-github-calendar 为改进后的 Hexo 前端插件,对应的 npm 依赖包是 @barry-flynn/hexo-github-calendar,新的后端 Python 接口是 Barry-Flynn/python_github_calendar_api,其现在的传参方式为 /api?user=Barry-Flynn

从旧版本迁移

如果需要从旧依赖包迁移至本项目对应的新依赖包,请先卸载旧依赖:

npm uninstall hexo-githubcalendar

再安装本项目所对应的新依赖:

npm i @barry-flynn/hexo-github-calendar

并按照本文档调整根目录的 _config.yml 配置项即可,其中主题为 Butterfly、Volantis、Matery、MengD 的同学,可以查看 _config.yml 文件中的模板,其他主题的同学请自行修改挂载元素配置项 githubcalendar_html 进行适配。

为了服务稳定性,推荐根据 Barry-Flynn/python_github_calendar_api 自己在 Vercel 或私有服务器自建 API 后端,本文档中提供的 api 地址可能承载不了大家的过量请求,会随时更换从而失效。