Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Huge updates #27

Merged
merged 16 commits into from
Nov 3, 2017
Merged

Huge updates #27

merged 16 commits into from
Nov 3, 2017

Conversation

xiazeyu
Copy link
Collaborator

@xiazeyu xiazeyu commented Oct 28, 2017

Fixed:

仅生成选择的模型(#14) 模型列表移除(#14)
增加模型左右设置(#10)(#19)(#21)(#23) 增加移动端模型更多功能(#12)
New README
Deleted package-lock.json to solve dependencies problems
Updates dependencies
Tried to fix (#26) Uncaught TypeError.

然后 @EYHN 你3个月前发的#15 现在还有效吗?
有空想把您的pr 3.0 merge到下一个pr中。

可用性与稳定性请大大仔细验证 xiazeyu未经仔细的测试,初步保证可用性
然后一些issues如果解决了可以关闭。
觉得可以请等待最终完成然后发布npm新版本

@xiazeyu
Copy link
Collaborator Author

xiazeyu commented Oct 28, 2017

@EYHN 还有,我看你3.0的PR里改了好多,除了commit里提到的内容,很多都是语法风格之类的修改吗?
--已查阅并更新

@xiazeyu
Copy link
Collaborator Author

xiazeyu commented Oct 28, 2017

好吧,你的${config.hiddenOnMobile ? ...:...}实现貌似比我的简单很多,你可以接着更改QwQ
--已查阅并更新

readme.zh-CN.md Outdated
<%- live2d({
model: "nipsilon"
}) %>
```
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不可用

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--已查阅并更新
代码中加入了相关内容,请查阅
在此补充设置优先顺序

"nico": "nito/nico.model.json",
"nito": "nito/nito.model.json",
"nipsilon": "nito/nipsilon.model.json",
"nietzsche": "nito/nietzche.model.json",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nito系列 (i.e. ni-j ,nico,nito, nipsilon, nietzche) 都用不了了

Copy link
Collaborator Author

@xiazeyu xiazeyu Oct 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--已查阅并更新
请仔细再次检查确保无误

index.js Outdated

registerDir('live2d/assets/', path.resolve(__dirname, './assets'));
registerFile('live2d/script.js', path.resolve(__dirname, './dist/bundle.js'))

hexo.extend.helper.register('live2d', function (config) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 config 参数是否应该删除

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,意思是这个hexo.helper只要传递一堆字符串就可以了吗?那个function(config)里的config变量是没用的?

@xiazeyu
Copy link
Collaborator Author

xiazeyu commented Oct 29, 2017

ejs不可用:
这个就不知道了,你repo原本的README就是这样写的= =我也不会ejs
要不然我删掉?

这里的 config 参数是否应该删除:
nodejs是异步的吗?这里我还在研究hexo的api原理
我的理解是
hexo.extend.generator.register
的作用是把文件丢到publish目录下,而
hexo.extend.helper.register('live2d', function (config)
的作用是告诉hexo应该在网页里加什么html代码
但是我还是beginer嘛,所以:
1,对function 后config是什么意思不理解。这句代码用的是你原先的代码
2,获取到的config数组(大概这么叫吧)是局部变量,无法在registerDir('live2d/assets/', path.resolve(__dirname, path.join('./assets/', config.model)));
中使用,因此在index.js中我增加了73-80行的代码

nito系列 (i.e. ni-j ,nico,nito, nipsilon,nietzche) 都用不了了
这个我更改了assets的文件结构,直接把nito系列单独拖出来了一个文件夹,README里的说明没检查,不过应该是可以使用的

话说如果我要更改pr的comment的话,直接git push我fork的repo,然后pr上做什么操作直接跟进到我repo的最近提交呢?

index.js Outdated
<script type="text/javascript">
(function(){
if(device.mobile()){
if(${config.mobileShow}){
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

常见作者的pr“3.0”

```


- `model`: 模型名称 默认值: z16
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试是否可用

index.js Outdated


var config = Object.assign(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

更好地传递config

index.js Outdated

registerDir('live2d/assets/', path.resolve(__dirname, './assets'));
registerFile('live2d/script.js', path.resolve(__dirname, './dist/bundle.js'))

hexo.extend.helper.register('live2d', function (config) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,意思是这个hexo.helper只要传递一堆字符串就可以了吗?那个function(config)里的config变量是没用的?

@xiazeyu
Copy link
Collaborator Author

xiazeyu commented Oct 30, 2017

@EYHN 我正在改写代码,然后请看看我上面的反馈,谢谢。

@EYHN
Copy link
Owner

EYHN commented Oct 30, 2017

  1. 我是指如果在ejs传入模型设置会导致一些问题。
  2. 同第一条
  3. nito系列因为路径问题无法使用,你自己试试就知道了
  4. push就可以自动更新了

@xiazeyu
Copy link
Collaborator Author

xiazeyu commented Oct 30, 2017

ejs中传入模型会导致错误如何解决?emmm,或者是改成swig传入模型设置?
对模板不是很熟悉,我觉得这种问题还是您多给点建议或者亲自更改比较好。

@xiazeyu
Copy link
Collaborator Author

xiazeyu commented Oct 30, 2017

@EYHN
好吧,请再次确认程序没问题,我下次commit再做document的问题吧。
建议你直接看修改过的index.js,diff可能比较乱,因为做了挺大的结构调整

@xiazeyu
Copy link
Collaborator Author

xiazeyu commented Oct 30, 2017

参照了
https://hexo.io/api/helper.html
修复了config问题
不再能够在模板中传递设置的代价换来了只上传选定模型的改进。

@xiazeyu
Copy link
Collaborator Author

xiazeyu commented Nov 2, 2017

目前所有改动均已完成,请检查。
@EYHN
如果可以merge,请顺便更新版本号发布npm,谢谢。

@EYHN EYHN merged commit cb36854 into EYHN:master Nov 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants