惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
About on SuperTechFans
C
Cybersecurity and Infrastructure Security Agency CISA
N
News and Events Feed by Topic
C
Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
A
Arctic Wolf
Scott Helme
Scott Helme
P
Palo Alto Networks Blog
S
Schneier on Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
T
Tor Project blog
量子位
G
Google Developers Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog RSS Feed
NISL@THU
NISL@THU
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
AWS News Blog
AWS News Blog
爱范儿
爱范儿
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
L
LINUX DO - 最新话题
Security Archives - TechRepublic
Security Archives - TechRepublic
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
Cloudbric
Cloudbric
aimingoo的专栏
aimingoo的专栏
L
Lohrmann on Cybersecurity
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hacker News: Ask HN
Hacker News: Ask HN
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
S
Security @ Cisco Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Cyber Attacks, Cyber Crime and Cyber Security
G
GRAHAM CLULEY
P
Proofpoint News Feed
V
V2EX
Martin Fowler
Martin Fowler
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Cloudflare Blog
SecWiki News
SecWiki News
罗磊的独立博客
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
小众软件
小众软件
The Last Watchdog
The Last Watchdog

HCLonely Blog

HCLonely Blog - 让OpenWrt控制台进入赛博空间:luci-theme-cyberpunk HCLonely Blog - Artitalk V4: 从Leancloud迁移至Vercel HCLonely Blog - 记一次hexo-bilibili-bangumi分时函数渲染优化 HCLonely Blog - IP签名图片生成服务 HCLonely Blog - 树莓派搭建私有在线PS网站 HCLonely Blog - 将 Node.js 项目打包为一个可执行文件 HCLonely Blog - 哔哩哔哩硬核会员搜题脚本 HCLonely Blog - 在静态网站上实现浏览记录功能 HCLonely Blog - 统一推送服务Nodejs API HCLonely Blog - 在线答题搜答案脚本 HCLonely Blog - 青年大学习安卓跳过方法 HCLonely Blog - 公主连结 Re:Dive 中文输入法词库 HCLonely Blog - 基于 NodeJs 的 live2d 后端 Api 服务器 HCLonely Blog - 百度分析和谷歌分析适配 pjax HCLonely Blog - Git 免密、免 SSH 进行 push & pull HCLonely Blog - 一款基于 webstack 的 hexo 主题 HCLonely Blog - 使用 cron-job 解决 LeanCloud 因流控原因自动唤醒失败的问题 HCLonely Blog - Valine 添加验证码、博主标签及评论微信、QQ 通知 HCLonely Blog - 使用 Cloud Studio 在线搭建、编辑、部署 Hexo HCLonely Blog - 给你的网页添加一个 moc3 格式的 Live2d 模型 HCLonely Blog - Hexo-tag-steamgame 插件 HCLonely Blog - Hexo-online-server 在线编辑发布文章插件 HCLonely Blog - Hexo 博客美化
HCLonely Blog - hexo-calendar 活动日历插件
博主:HCLonely · 2020-07-28 · via HCLonely Blog

本文最后更新于天前,内容可能已不再适用!

在博客中插入类似 Github contributions 的活动日历。

注意:此插件会和hexo g命令冲突,请使用hexo gehexo generate替代hexo g命令!

前提条件

注意:不满足前提条件的无法使用此插件,在不满足前提条件的情况下安装此插件出现的问题不予以处理,如何实现以下前提条件的问题不予以处理!

  1. Node.js >= 12.0
  2. 使用Git对博客**源码(不是使用 git 部署)**进行管理;
  3. 在博客根目录使用git log -1 --date=iso --pretty=format:"%ad"命令能够输出一个日期;
  4. 如何确定第一项是否符合:
    1. 博客根目录含有.git文件夹,这是一个隐藏文件夹;
    2. 符合上面的第三项。

安装

npm i hexo-calendar -S

or

cnpm i hexo-calendar -S

使用

作为辅助函数在主题模板中使用

<%- calendar({monthLang: 'cn', dayLang: 'cn', title: '活动日历'}) %>

作为标签在 md 文件中使用

注意:这种方法请使用严格的 JSON 格式!

{% calendar %}
{"monthLang": "cn", "dayLang": "cn", "title": "活动日历"}
{% endcalendar %}

如果你使用了自动部署

如果你使用了Travis CI,Github Action之类的自动部署,那么你需要在推送源码之前使用hexo gc -w=40命令生成一个calendar.json文件。-w=40代表显示 40 周之前至今的活动记录。

选项

名称类型默认值描述
widthString"600"日历宽度,单位:px
heightString"165"日历高度,单位:px
idString"calendar"日历元素 id
monthLangStringorArray"en"月份语言,可选:en,cn自定义
dayLangStringorArray"en"一周中每一天的语言,可选:en,cn自定义
weeksNumber40显示多少周之前至今的活动记录
titleString"calendar"日历标题
insertScriptBooleantrue是否自动插入echarts库。如果你已全局引入echarts库,请将此项设为false;如果你的站点启用了pjax,请将此项设为false,并全局引用echarts库。

示例

示例

赞赏作者

扫一扫支付