yarn add v1.16.0 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@1.2.9: The platform "win32" is incompatible with this module. info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning "hexo-deployer-git > babel-eslint@10.0.2" has unmet peer dependency "eslint@>= 4.12.1". [4/4] Building fresh packages...
success Saved lockfile. success Saved 6 new dependencies. info Direct dependencies └─ hexo-generator-amp@3.1.2 info All dependencies ├─ amphtml-validator@1.0.23 ├─ colors@1.1.2 ├─ follow-redirects@1.7.0 ├─ hexo-generator-amp@3.1.2 ├─ image-size@0.6.3 └─ pug-load@2.0.12 Done in 14.45s.
说明安装成功。
修改配置文件
注意:这里的配置文件指的是主配置文件,也就是在项目根目录的那个,而不是在主题里的
打开 _config.yml 文件,在末尾添加如下配置信息
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# hexo-generator-amp # The following settings is the quick start options.
generator_amp: templateDir:amp-template assetDistDir:amp-dist logo: path:sample/sample-logo.png width:600 height:60 substituteTitleImage: path:sample/sample-substituteTitleImage.png width:1024 height:800 warningLog:false# To display warning, please set true.