玩命加载中 . . .

主页 归档 分类 标签

hexo-plugin提交指南

hexo plugin 提交指南·参考·感谢

  1. hexo plugin:plugin docs
  2. hexo site repo: hexojs/site
  3. pull request
  4. git 取消推送:post

我的收获

  1. First Pull Request :my first pr
  2. Similar Plugin : If you search “space”,you will find many similar plugin.Although he is not very simple, I am still very proud, because I completed this plug-in alone and I also learned some new knowledge.
  3. little knowledge about github actions.
  4. username repo and show me README.md

步骤

拥有一个 plugin repo or npm package

you can upload to github repo or npm package.

fork 官方库到你的站点

hexojs/site

克隆 你的 fork 仓库

git clone git@github.com:[username]/site.git

更改你的本地项目

具体怎么修改看这,plugin docs,这里没必要说明,很简单的,改一下配置。

保存提交本地推送远程

git add .
git commit -m "plugin:[plugin name]"
git push origin

在你的fork仓库打开Pull Requests

  1. 点击 New pull request
  2. 点击 create pull request,应该是这个吧,自己也没记清楚,有机会再试试,放着里面有文本按钮自己找找。
  3. 在 官方库的pull requsest会有个github acitons的自动化检测,然后等待权限者审批。

感言

( •̀ ω •́ )y—不过好像,这几天官方不在审批工作。在提交插件的时候,发现好多的前辈已经提交过类似的。是我的搜索的姿势不对,他们用space叫做缩进。

我看了其中一位的,有如下区别。

前辈
代码语义语义程度相对高过程化代码,语义化变量命名
第三方引用和参考前辈参考了几个前人还有用了第三方的文本解析库,相对整洁我重学正则和字符串处理,确定几种方案,选择过程化处理
泛用程度前辈的功能无论是从命名还是功能,扩展性比我强局限性很大,基本只能用于专门的markdown处理
测试方式前辈采用单元测试的方式我采用场景测试,相对麻烦
缩进方式区别前辈用第三方库很优雅的实现属性注入,还使用我最近想到的注入器模式处理。我采用手工实现,对非列表的P标签的进行处理并且支持内部br标签文本的工作
未来未知我会继续支持专门markdown处理,突然写着写有更简单的方式实现。就是采用css直接匹配,┭┮﹏┭┮想复杂了,算了好歹也实现了我的plugin,未来会继续支持。

彩蛋

尽管说,我想要技术文章以主题形式,但其实我学习过程的知识是碎片化吸收的。

所以介绍一个碰到的彩蛋。

用你的usename(github repo)展示

创建你的用户名.repo,包括README.md

README.md写入api

![https://github-readme-stats.vercel.app/api?username=(your username)&theme-synthwave](https://github-readme-stats.vercel.app/api?username=(your username)&theme=synthwave)

这是api的介绍

github readme stats

---------------- The End and I hope sunshines on the outside. ----------------
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2022 Ma
  • 访问人数: | 浏览次数:

      请我喝杯咖啡吧~

      支付宝
      微信