From 94560f7b9cc528fb6ca539bccf1e66c92df261b2 Mon Sep 17 00:00:00 2001 From: eyhn Date: Fri, 3 Nov 2017 16:49:54 +0800 Subject: [PATCH] change bottomOffset to verticalOffset --- index.js | 8 ++++---- readme.md | 2 +- readme.zh-CN.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index bedbd19..196b59e 100755 --- a/index.js +++ b/index.js @@ -1,5 +1,4 @@ var fs = require('hexo-fs'); -var nfs = require('fs'); var path = require('path'); var url = require("url"); @@ -31,14 +30,14 @@ var config = Object.assign( { mobileHeight: 150, position: "right", horizontalOffset: 0, - bottomOffset: -20, + verticalOffset: -20, className: "live2d", id: "live2dcanvas", }, hexo.config.live2d, hexo.theme.config.live2d ); - + hexo.extend.helper.register('live2d', function() { return `
@@ -76,7 +75,7 @@ hexo.extend.helper.register('live2d', function() { ` }); -nfs.exists(path.resolve(process.cwd(), path.join('./live2d_models/', config.model)), function(exists){ +fs.exists(path.resolve(process.cwd(), path.join('./live2d_models/', config.model)), function(exists){ if(exists){ registerDir("live2d/assets/", path.resolve(process.cwd(), path.join('./live2d_models/', config.model))); console.log('Found custom model at: ' & path.resolve(process.cwd(), path.join('./live2d_models/', config.model))); @@ -84,6 +83,7 @@ nfs.exists(path.resolve(process.cwd(), path.join('./live2d_models/', config.mode registerDir('live2d/assets/', path.resolve(__dirname, path.join('./assets/', config.model))); } }); + registerFile('live2d/script.js', path.resolve(__dirname, './dist/bundle.js')); registerFile('live2d/device.min.js', path.resolve(__dirname, './dist/device.min.js')); diff --git a/readme.md b/readme.md index 6286137..e362a43 100644 --- a/readme.md +++ b/readme.md @@ -78,7 +78,7 @@ live2d: mobileHeight: 150 # The height of your model on mobile devices. default: 75 position: right # Which side the model is shown at. default: right horizontalOffset: 0 # The horizontal offset. default: 0 - bottomOffset: -20 # The offset of the bottom. default: -20 + verticalOffset: -20 # The offset of the bottom. default: -20 className: live2d # The class name of the element. default: live2d id: live2dcanvas # The ID of the live2d element. default: live2dcanvas ``` diff --git a/readme.zh-CN.md b/readme.zh-CN.md index 0e1ce37..1538ee9 100644 --- a/readme.zh-CN.md +++ b/readme.zh-CN.md @@ -80,7 +80,7 @@ live2d: mobileHeight: 150 # 移动设备上的高度 默认值: 150 position: right # 模型左右侧放置位置 默认值: right horizontalOffset: 0 # 元素的水平偏移 默认值: 0 - bottomOffset: -20 # 元素的底部偏移 默认值: -20 + verticalOffset: -20 # 元素的底部偏移 默认值: -20 className: live2d # 元素的类名 默认值: live2d id: live2dcanvas # 元素的id 默认值: live2dcanvas ```