1.0.8 • Published 1 year ago

hexo-calendar v1.0.8

Weekly downloads
5
License
MIT
Repository
github
Last release
1 year ago

Insert a calendar like Github contributions into your blog.

中文文档

Note: This plugin will conflict with the hexo g command, please use hexo ge or hexo generate instead of the hexo g command!

Precondition

Note: The plugin cannot be used if the prerequisites are not met, and the problems of installing this plugin when the prerequisites are not met will not be dealt with, and how to achieve the following prerequisites will not be dealt with!

  1. Node.js >= 12.0
  2. Use Git to manage the blog source code.
  3. Use the git log -1 --date=iso --pretty=format:"%ad" command in the blog root directory to output a date.
  4. How to determine whether the first item meets:
    1. The blog root directory contains the .git folder, which is a hidden folder.
    2. Meets the third item above.

Installation

npm i hexo-calendar -S

or

cnpm i hexo-calendar -S

Usage

Use as a helper function in theme templates

<%- calendar({monthLang: 'en', dayLang: 'en', title: 'calendar'}) %>

Use as a tag in md files

Note: Please use strict JSON format for this method!

{% calendar %}
{"monthLang": "en", "dayLang": "en", "title": "calendar"}
{% endcalendar %}

If you use automatic deployment

If you use automatic deployment such as Travis CI, Github Action, then you need to use the hexo gc -w=40 command to generate a calendar.json file before pushing the source code. -w=40 means to display activity records from 40 weeks ago to the present.

Options

NameTypeDefault valueDescription
widthString"600"Calendar width, unit: px
heightString"185"Calendar height, unit: px
idString"calendar"Calendar element id
monthLangString or Array"en"Month language, optional: en, cn or custom
dayLangString or Array"en"Language for every day of the week, optional: en, cn or custom
weeksNumber40Show how many weeks ago to the present activity record
titleString"calendar"Calendar title
insertScriptBooleantrueWhether to automatically insert the echarts library. If you have imported the echarts library globally, please set this to false; if your site has pjax enabled, please set this to false and reference the echarts library globally.
colorObjectnullColor options
color.backgroundString"#f9f9f9"Background color
color.tooltip.backgroundString"#555"Tooltip's background color
color.tooltip.borderString"#777"Tooltip's border color
color.visualMap.inRangeString'["#ebedf0", "#c6e48b", "#7bc96f", "#239a3b", "#196127"]'The colors displayed for different times of submission
color.calendar.itemBorderString"#fff"The border color for each data point
color.calendar.monthLabelString"#3C4858"Month label color
color.calendar.dayLabelString"#3C4858"Day label color
color.calendar.nameString"#3C4858"None

Example

Example

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago