hexo-generator-amp
Advanced tools
Comparing version 1.0.7 to 2.0.0
26
index.js
@@ -26,3 +26,3 @@ 'use strict'; | ||
var sitelogoPath= '../template/sample-yoursite-logo.png'; | ||
var avatorPath = '../template/sample-avator.png'; | ||
var avatarPath = '../template/sample-avator.png'; | ||
var substituteTitleImagePath = '../template/sample-substituteTitleImage.png'; | ||
@@ -34,3 +34,3 @@ | ||
if(hexo.config.generator_amp && hexo.config.generator_amp.templateDir && hexo.config.generator_amp.assetDistDir && hexo.config.generator_amp.logo && hexo.config.generator_amp.logo.path && hexo.config.generator_amp.substituteTitleImage && hexo.config.generator_amp.substituteTitleImage.path){ | ||
ic.initCopy( pathFn.join(hexo.config.generator_amp.templateDir) , [ejsPath, cssPath, logoPath, sitelogoPath, substituteTitleImagePath, avatorPath]); | ||
ic.initCopy( pathFn.join(hexo.config.generator_amp.templateDir) , [ejsPath, cssPath, logoPath, sitelogoPath, substituteTitleImagePath, avatarPath]); | ||
}else{ | ||
@@ -41,3 +41,3 @@ lg.log("error", "Please set the generator_amp option." , "_config.yml"); | ||
var avatorDefaultPath = "sample/" + pathFn.basename( avatorPath ); | ||
var avatorDefaultPath = "sample/" + pathFn.basename( avatarPath ); | ||
if(hexo.config.authorDetail && hexo.config.authorDetail.avatar && hexo.config.authorDetail.avatar.path){ | ||
@@ -59,13 +59,13 @@ avatorDefaultPath = hexo.config.authorDetail.avatar.path; | ||
hexo.config.generator_amp = assign({}, | ||
hexo.config.generator_amp, { | ||
"defaultAssetsPath" : { | ||
"ejs" : ejsPath , | ||
"css" : cssPath , | ||
"logo": logoPath , | ||
"avator" : avatorPath , | ||
"substituteTitleImage" : substituteTitleImagePath | ||
} | ||
hexo.config.generator_amp = assign({ | ||
}, hexo.config.generator_amp, { | ||
"defaultAssetsPath" : { | ||
"ejs" : ejsPath , | ||
"css" : cssPath , | ||
"logo": logoPath , | ||
"avator" : avatarPath , | ||
"substituteTitleImage" : substituteTitleImagePath | ||
} | ||
); | ||
}); | ||
@@ -72,0 +72,0 @@ var shush = su.chkUpdate(hexo.config); |
@@ -9,2 +9,3 @@ 'use strict'; | ||
var cheerio = require('cheerio'); | ||
var moment = require('moment'); | ||
var tp = require('./templatePath.js'); | ||
@@ -325,8 +326,11 @@ var gs = require('./imageSize.js'); | ||
// get year | ||
var nowD = new Date(); | ||
var yy = nowD.getFullYear(); | ||
var yy = moment().format("YYYY"); | ||
//datePublished | ||
var pd = new Date(post.date); | ||
var pdStr = pd.getFullYear() + "-"+ (pd.getMonth() + 1) + "-" + pd.getDate() | ||
//datePublished - Formatting using formats in Hexo config | ||
var dateFormat = "YYYY-MM-DD"; | ||
if(config.date_format) { | ||
dateFormat = config.date_format; | ||
} | ||
var pdStr = moment(post.date).format(dateFormat); | ||
var xml = template({ | ||
@@ -342,3 +346,3 @@ config : config , | ||
isInstagramContain: isInstagramContain , | ||
avatorPath : avatarPath_template, | ||
avatarPath : avatarPath_template, | ||
logoPath : logoPath_template, | ||
@@ -345,0 +349,0 @@ logoPath_width : logoPath_template_width, |
{ | ||
"name": "hexo-generator-amp", | ||
"version": "1.0.7", | ||
"version": "2.0.0", | ||
"main": "index", | ||
"dependencies": { | ||
"cheerio": "^0.22.0", | ||
"ejs": "^2.4.1", | ||
"ejs": "^2.5.5", | ||
"hasha": "^2.2.0", | ||
"hexo-env": "^0.0.1", | ||
"hexo-fs": "^0.1.6", | ||
"hexo-pagination": "^0.0.2", | ||
"html-minifier": "^2.1.2", | ||
"hexo-pagination": "^0.1.0", | ||
"html-minifier": "^3.2.3", | ||
"image-size": "^0.5.0", | ||
"log-util": "^1.1.2", | ||
"mkdirp": "^0.5.1", | ||
"object-assign": "^2.0.0" | ||
"object-assign": "^4.1.0" | ||
}, | ||
@@ -18,0 +18,0 @@ "description": "AMP ⚡ HTML (Accelerated Mobile Pages) generator for Hexo.", |
Sorry, the diff of this file is not supported yet
97955
2171
+ Addedclean-css@4.2.4(transitive)
+ Addedcommander@2.17.12.19.0(transitive)
+ Addedhe@1.2.0(transitive)
+ Addedhexo-pagination@0.1.0(transitive)
+ Addedhtml-minifier@3.5.21(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addeduglify-js@3.4.10(transitive)
- Removedalign-text@0.1.4(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedasync@0.2.10(transitive)
- Removedcamelcase@1.2.1(transitive)
- Removedcenter-align@0.1.3(transitive)
- Removedchange-case@3.0.2(transitive)
- Removedclean-css@3.4.28(transitive)
- Removedcliui@2.1.0(transitive)
- Removedcommander@2.8.12.9.0(transitive)
- Removedconstant-case@2.0.0(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddot-case@2.1.1(transitive)
- Removedgraceful-readlink@1.0.1(transitive)
- Removedhe@1.1.1(transitive)
- Removedheader-case@1.0.1(transitive)
- Removedhexo-pagination@0.0.2(transitive)
- Removedhtml-minifier@2.1.7(transitive)
- Removedis-lower-case@1.1.3(transitive)
- Removedis-upper-case@1.1.2(transitive)
- Removedlazy-cache@1.0.4(transitive)
- Removedlongest@1.0.1(transitive)
- Removedlower-case-first@1.0.2(transitive)
- Removedncname@1.0.0(transitive)
- Removedobject-assign@2.1.1(transitive)
- Removedpascal-case@2.0.1(transitive)
- Removedpath-case@2.1.1(transitive)
- Removedright-align@0.1.3(transitive)
- Removedsentence-case@2.1.1(transitive)
- Removedsnake-case@2.1.0(transitive)
- Removedsource-map@0.4.4(transitive)
- Removedswap-case@1.1.2(transitive)
- Removedtitle-case@2.1.1(transitive)
- Removeduglify-js@2.6.4(transitive)
- Removeduglify-to-browserify@1.0.2(transitive)
- Removedupper-case-first@1.1.2(transitive)
- Removedutils-merge@1.0.1(transitive)
- Removedwindow-size@0.1.0(transitive)
- Removedwordwrap@0.0.2(transitive)
- Removedxml-char-classes@1.0.0(transitive)
- Removedyargs@3.10.0(transitive)
Updatedejs@^2.5.5
Updatedhexo-pagination@^0.1.0
Updatedhtml-minifier@^3.2.3
Updatedobject-assign@^4.1.0