Git Product home page Git Product logo

hexo-generator-amp's People

Contributors

churchs19 avatar jsdevtom avatar livekn avatar matthewsanders avatar rayros avatar taichi avatar tea3 avatar toobug avatar tvdias avatar vicayang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hexo-generator-amp's Issues

Cashe

I see that there are some interesting words used,
as object key,
isCasheUpdate
isCasheClear

and as file name,
write-cashe.js

Are they named cashe not cache on purpose? :)

Thanks!

When it converting the image, it convert the noemal pages image

For example,

It will convert this code in normal pages so that normal pages' image won't work.

And it seems it can't be seperate for CDN images. Such as in the normal pages it use website image's address "google.com/1.jpg" and in the AMP it uses local image's address "/images/1.jpg"

Support different path for amp files.

There is no way to specify the generated amp files' path, and this may lead to problem sometimes.

FATAL ENOTDIR: not a directory, mkdir '/Users/TooBug/xxx/public/article/post-title.html/amp'

My blog for example:

Hexo generate the blog post html file in a individual folder in general, maybe post-title/index.html, thus the url might be http://localhost:4000/post/post-title/. But it's possible to modify the default path of generated blog posts by permalink config. For backwards compatible, I changed this config to

permalink: article/:title.html

Then the generated path would be something like post-title.html, there is no folder here. But the amp plugin still tries to write amp files to post-title.html/amp/index.html, this lead to the error.

Hope there would be a config to specify the path of generated amp files.

Error: unable to verify the first certificate

When I run hexo g, plugins will make mistakes.

-> _posts/nofollow-301.md
[17:31:38.027] [hexo-generator-amp] error:  Error: unable to verify the first certificate
This plugin checks whether the image URL exists.
img path: https://obbuo9upd.qnssl.com/20160304201650.jpg
Please check the following file.

-> _posts/where-is-community.md
[17:31:38.027] [hexo-generator-amp] error:  This plugin can not acquire the width and height of such url images. Please change the URL to HTTP or HTTPS, or add height and width.
img path: https://obbuo9upd.qnssl.com/20160304201650.jpg
Please check the following file.

Because the pictures in my article are all stored on the drawing bed, so plug-ins can't be detected, can you skip this detection process, thank you.

npm audit warns 1 high and 1 low vulnerabilities

For BUG

When I run the npm audit on my hexo project, I got the following information:

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary File Overwrite                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ tar                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.4.2                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > node-gyp > tar              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/803                             │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ braces                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.3.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > hexo-fs > chokidar > anymatch >         │
│               │ micromatch > braces                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/786                             │
└───────────────┴──────────────────────────────────────────────────────────────┘

Environment Info

OS version

  • Ubuntu 18.04 (Bionic Beaver)

Node version(node -v)

v10.15.3

Hexo Configuration

Plugin version(npm ls --depth 0)

Error Plugin Load Failed

I'm starting a hexo blog and followed the installation instructions.

I copied the following into the __config.yml.

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   # If you want to validate, please set true.

Then if I run hexo generate, I get an error.

ERROR Plugin load failed: hexo-generator-amp

I'm running Windowx 10 x64 using node v6.9.4.

Any help would be appreciated!

is it possible to customize output path?

hi, @tea3
Thanks for your plugin. successfully generated amp for my site.
i tried two configurations setting permalink in site _config.yml not theme _config.yml, with different output:

  1. permalink: :category/:abbrlink.html/ Output file path is www.xxx.site/category/:abbrlink.html/amp/
  2. permalink: :category/:abbrlink.html Output file path is www.xxx.site/category/:abbrlink.htmlamp/

a / must set after the permalink, otherwise, www.xxx.site/category/:abbrlink.html/amp/ will show 404 not found.

another question, This plugin generated the AMP HTML. Output file path is ./your-posts-parmalink/amp/, is it possible to customize the output path? such as www.xxx.site/amp/category/:abbrlink.html ?

thanks.

Strange font

Can we set by default something more useful for latin and cyrillc?

Local images not found.

None of my local images are linked from the generated content and an error is emitted during generation: "This plugin can not acquire the width and height of such url images. Please change the URL to HTTP or HTTPS, or add height and width."

I think I might be misunderstanding how this code works, but I was looking at this line here:

imgDevPath = pathFn.join(process.env.PWD || process.cwd() , "source/" , imgsrc);

Does this mean that a local image file specified in a markdown template like this:
![Image description](localimage.jpg)
Will be attempted to be found by the plugin under the path $pwd|$cwd + 'source/' + 'localimage.jpg'?

If so, would that explain why none of my images are replaced with amp equivalents?

`npm audit` complains high vulnerabilities of hexo-generator-amp

For BUG

  • All the 20 vulnerabilities depend on hexo-generator-amp
  • The output of npm audit of hexo directory is as follows:
                       === npm audit security report ===                        
                                                                                
┌──────────────────────────────────────────────────────────────────────────────┐
│                                Manual Review                                 │
│            Some vulnerabilities require your attention to resolve            │
│                                                                              │
│         Visit https://go.npm.me/audit-guide for additional guidance          │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │  Inefficient Regular Expression Complexity in                │
│               │ chalk/ansi-regex                                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ ansi-regex                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > npmlog > gauge > wide-align │
│               │ > string-width > strip-ansi > ansi-regex                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-93q8-gq69-wqmw            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │  Inefficient Regular Expression Complexity in                │
│               │ chalk/ansi-regex                                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ ansi-regex                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > node-gyp > npmlog > gauge > │
│               │ wide-align > string-width > strip-ansi > ansi-regex          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-93q8-gq69-wqmw            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │  Inefficient Regular Expression Complexity in                │
│               │ chalk/ansi-regex                                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ ansi-regex                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > sass-graph > yargs >        │
│               │ string-width > strip-ansi > ansi-regex                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-93q8-gq69-wqmw            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │  Inefficient Regular Expression Complexity in                │
│               │ chalk/ansi-regex                                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ ansi-regex                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > sass-graph > yargs > cliui  │
│               │ > string-width > strip-ansi > ansi-regex                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-93q8-gq69-wqmw            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │  Inefficient Regular Expression Complexity in                │
│               │ chalk/ansi-regex                                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ ansi-regex                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > sass-graph > yargs > cliui  │
│               │ > wrap-ansi > string-width > strip-ansi > ansi-regex         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-93q8-gq69-wqmw            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Prototype Pollution in set-value                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ set-value                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > hexo-fs > chokidar > braces >           │
│               │ snapdragon > base > cache-base > set-value                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-4jqc-8m5r-9rpr            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Prototype Pollution in set-value                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ set-value                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > hexo-fs > chokidar > anymatch >         │
│               │ micromatch > snapdragon > base > cache-base > set-value      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-4jqc-8m5r-9rpr            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Prototype Pollution in set-value                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ set-value                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > hexo-fs > chokidar > anymatch >         │
│               │ micromatch > braces > snapdragon > base > cache-base >       │
│               │ set-value                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-4jqc-8m5r-9rpr            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Prototype Pollution in set-value                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ set-value                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > hexo-fs > chokidar > anymatch >         │
│               │ micromatch > extglob > expand-brackets > snapdragon > base > │
│               │ cache-base > set-value                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-4jqc-8m5r-9rpr            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Prototype Pollution in set-value                             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ set-value                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > hexo-fs > chokidar > anymatch >         │
│               │ micromatch > extglob > expand-brackets > snapdragon > base > │
│               │ cache-base > union-value > set-value                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-4jqc-8m5r-9rpr            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary File Creation/Overwrite on Windows via             │
│               │ insufficient relative path sanitization                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ tar                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.4.18                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > node-gyp > tar              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-5955-9wpr-37jh            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary File Creation/Overwrite via insufficient symlink   │
│               │ protection due to directory cache poisoning using symbolic   │
│               │ links                                                        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ tar                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.4.18                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > node-gyp > tar              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-qq89-hq3f-393p            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary File Creation/Overwrite via insufficient symlink   │
│               │ protection due to directory cache poisoning using symbolic   │
│               │ links                                                        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ tar                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=4.4.16                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > node-gyp > tar              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-9r2w-394v-53qc            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary File Creation/Overwrite due to insufficient        │
│               │ absolute path sanitization                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ tar                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.2.2                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > node-gyp > tar              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-3jfq-g458-7qm9            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Arbitrary File Creation/Overwrite via insufficient symlink   │
│               │ protection due to directory cache poisoning                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ tar                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.2.3                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > node-gyp > tar              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-r628-mhmh-qjhw            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ Passing in a non-string 'html' argument can lead to          │
│               │ unsanitized output                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ striptags                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.2.0                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > hexo-util > striptags                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-qxg5-2qff-p49r            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Regular Expression Denial of Service in trim-newlines        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ trim-newlines                                                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > node-sass > meow > trim-newlines        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-7p7h-4mm5-852v            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Regular expression denial of service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ glob-parent                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.1.2                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > hexo-fs > chokidar > glob-parent        │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-ww39-953v-wcq6            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Remote code execution via the `pretty` option.               │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ pug                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=3.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > pug                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-p493-635q-r6gr            │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate      │ ReDOS vulnerabities: multiple grammars                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ highlight.js                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=10.4.1                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ hexo-generator-amp                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ hexo-generator-amp > hexo-util > highlight.js                │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://github.com/advisories/GHSA-7wwv-vh3v-89cq            │
└───────────────┴──────────────────────────────────────────────────────────────┘
found 20 vulnerabilities (7 moderate, 13 high) in 742 scanned packages
  20 vulnerabilities require manual review. See the full report for details.

Environment Info

OS version

  • Linux: Ubuntu 20.04.2 LTS (5.11.0-37-generic)

Node version(node -v)

v12.22.7

Plugin version(npm ls --depth 0)

[email protected] ~/Workspace/sanori.github.io
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Fix relative path inconsistencies

currently the configuration seems to use three different relative paths:

  1. logo - path is relative to public site layout
  2. avatar - path is relative to post (this seems incorrect as you could easily share this resource in a root directory aka about/profile.jpg)
  3. css and ejs templates - path is relative to the hexo install location

Item 2. above is probably the most troublesome.

Support for <amp-video>

It would be great if the library supported <amp-video>s not only the ones hosted on Youtube or Vimeo.

Since the change seems pretty straightforward I'll try to make it myself.

Cannot use yarn to install in windows 10

As title.
I use yarn add hexo-generator-amp will show the error below.

error C:\Users\Administrator\Documents\blog\node_modules\amphtml-validator: Command failed.
Exit code: 1
Command: \bin\sh -c "exit 0" 2> postinstall.DELETEME && rm postinstall.DELETEME || node postinstall-windows.js
Arguments:
Directory: C:\Users\Administrator\Documents\blog\node_modules\amphtml-validator
Output:
path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.join (path.js:489:7)
    at Object.<anonymous> (C:\Users\Administrator\Documents\blog\node_modules\amphtml-validator\postinstall-windows.js:43:10)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)

But use npm i -S hexo-generator-amp works

node 8.1.4
npm 5.0.3
yarn 1.2.1

How to disable copying template files?

It seems like hexo-generator-amp always generates sample template even if I specify existing templateDir in config file. Is there any way to disable this behavior or I'm just missing something?

The template directory has .ejs, .css and images directly under itself like below:

amp_template/
├── amp.css
├── amp.ejs
├── sample-avator.png
├── sample-logo.png
├── sample-placeholder.png
├── sample-substituteTitleImage.png
└── sample-yoursite-logo.png

Environment Info

OS version

  • macOS 10.12.5

Node version(node -v)

$ node -v
v6.10.3

Your site _config.yml

...
generator_amp:
  templateDir:  amp_template
  assetDistDir: amp
  cssFilePath: amp.css
  templateFilePath: amp.ejs
  logo:
    path:   sample-logo.png
    width:  600
    height: 60
  substituteTitleImage:
    path:   sample-substituteTitleImage.png
    width:  1024
    height: 800
  warningLog: true
  validateAMP: true
...

Plugin version(npm ls --depth 0)

CSS syntax error in tag 'style amp-custom'

BUG

I'm using the theme hexo-theme-suka and I was added the generator_amp part to the theme's file (themes/suka/layout/_partial/head/index.ejs)'s first line

But when I was trying to test my blog via https://validator.ampproject.org , I got this error

- CSS syntax error in tag 'style amp-custom' - incomplete declaration.AUTHOR_STYLESHEET_PROBLEM line 1744, column 290
  
- CSS syntax error in tag 'style amp-custom' - invalid declaration.AUTHOR_STYLESHEET_PROBLEM line 1744, column 309
  
- CSS syntax error in tag 'style amp-custom' - incomplete declaration.AUTHOR_STYLESHEET_PROBLEM line 1744, column 317
  
- CSS syntax error in tag 'style amp-custom' - invalid declaration.AUTHOR_STYLESHEET_PROBLEM line 1744, column 337
  
- CSS syntax error in tag 'style amp-custom' - incomplete declaration.AUTHOR_STYLESHEET_PROBLEM line 1744, column 378
  
- CSS syntax error in tag 'style amp-custom' - invalid declaration.AUTHOR_STYLESHEET_PROBLEM line 1744, column 392

This is the error part.

#hexo-amp-id-1{color:#DB4D6D;}#hexo-amp-id-2{color:#DB4D6D;}#hexo-amp-id-3{color:#DB4D6D;}#hexo-amp-id-4{color:#DB4D6D;}#hexo-amp-id-5{color:#DB4D6D;}#hexo-amp-id-6{background-color:black;color:white;text-decoration:none;padding:4px 6px;font-family:-apple-system, BlinkMacSystemFont, &quot;San Francisco&quot;, &quot;Helvetica Neue&quot;, Helvetica, Ubuntu, Roboto, Noto, &quot;Segoe UI&quot;, Arial, sans-serif;font-size:12px;font-weight:bold;line-height:1.2;display:inline-block;border-radius:3px}#hexo-amp-id-7{display:inline-block;padding:2px 3px}#hexo-amp-id-8{height:12px;width:auto;position:relative;vertical-align:middle;top:-2px;fill:white}#hexo-amp-id-9{display:inline-block;padding:2px 3px}

the problem is I could't find how is this part comes from, and how to fix it
(exclude the first minus sign)

- &quot;San Francisco&quot;, &quot;Helvetica Neue&quot;, Helvetica, Ubuntu, Roboto, Noto, &quot;Segoe UI&quot

the is Example HTML file to this full page

Environment Info

OS version

  • OSX 10.14

Node version(node -v)

v12.11.1

Your site _config.yml

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: true   # To display warning, please set true.
  generateAmpPath: amp/archives/:abbrlink/

Plugin version(npm ls --depth 0)

hexo-site@0.0.0 /Users/edisonjwa/Documents/git/Hexo-CI
├── core-js@3.2.1
├── hexo@3.9.0
├── hexo-abbrlink@2.0.5
├── hexo-cdnify@0.0.2
├── hexo-cli@3.0.0
├── hexo-generator-amp@3.2.0
├── hexo-generator-archive@1.0.0
├── hexo-generator-baidu-sitemap@0.1.6
├── hexo-generator-category@1.0.0
├── hexo-generator-feed@2.0.0
├── hexo-generator-index@1.0.0
├── hexo-generator-sitemap@1.2.0
├── hexo-generator-tag@1.0.0
├── hexo-renderer-ejs@1.0.0
├── hexo-renderer-marked@2.0.0
├── hexo-renderer-stylus@1.1.0
├── hexo-server@1.0.0
├── hexo-spoiler@1.5.2
├── hexo-tag-aplayer@3.0.4
├── hexo-uglify@1.0.0
└── node-pre-gyp@0.12.0

amp-template location

whenever I do a "hexo generate", it copy the fresh template copy and replace my original folder, i wonder how can I refer back to my custom logo and avatar? I wonder if I place my custom amp-template folder to the wrong place(currently I place it at project entry, parallel to "themes", "source", and "public" folder). as below:

├── amp-template
├── images
├── index.html
├── js
├── node_modules
├── package.json
├── page
├── public
├── robots.txt
├── scaffolds
├── search.xml
├── sitemap.xml
├── source
├── tags
├── themes
└── vendors

The log I receive from CI environment is:

$ hexo clean
[17:42:33.690] [hexo-generator-amp] hexo-generator-amp's template has been copied to the your project.
Please check the following file.
-> /home/travis/build/chocoluffy/chocoluffy.github.io/amp-template/sample
INFO  Deleted database.
INFO  Deleted public folder.

And my node\nvm environment is:

$ node --version
v7.10.1
$ npm --version
4.2.0
$ nvm --version
0.33.8

on Linux.

Everything about AMP works properly, I just wonder how can I apply my custom assets instead of using the default one. Thanks in advance!


[UPDATE]: problem fixed. I check the source code, found that it actually requires several png files to be at the right folder to avoid error condition. (before I just placed my logo png inside).

Add support for mathjax

Hi, I am using your hexo-generator-amp plugin and that works quite well. However, I notice that because the amp disallow the third party javascript, the formula I write in .md could not be render correctly in amp page.

I notice that amp has support MathML in the beginning of 2018. So I would like to do a little change: when generate the amp page, use the regex to replace $(.*)$ and $$(.*)$$ to <amp-mathml layout="container" data-formula="\[ (.*) \]"> </amp-mathml>

Do you know any idea how to render the formula elegantly except this method? Also, could you provide some hints or information about how and where should I modify the code? I guess I should add a formula.js in the filter to do the replacement and call it in generator.js. Am I correct? I am willing to make a contribution!

throw er; // Unhandled 'error' event

INFO Start processing
events.js:160
throw er; // Unhandled 'error' event
^

Error: getaddrinfo ENOTFOUND suishoshizuku.com suishoshizuku.com:443
at errnoException (dns.js:28:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)


Latest version need verify file URL ?

INFO Start processing
[17:52:25.217] [hexo-generator-amp] error: TypeError: unsupported file type: undefined (file: undefined)
This plugin gets width and height by accessing the external image. However, the plugin could not access the external image. Please confirm that the image URL is correct. Or, add the width and height to the post. : http://wx3.sinaimg.cn/wp-content/uploads/2014/08/ublock1.png
Please check the following file.
-> _posts/ublock.md

This URL is invalid.

lastest version error

INFO Start processing
[hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently checking the cache now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently replacing table align now ... [hexo-generator-amp] Plugin is currently restorating

now ... [hexo-generator-amp] Plugin is currently restorating now ... [hexo-generator-amp] Plugin is currently restorating now ... [hexo-generator-amp] Plugin is currently restorating now ... [hexo-generator-amp] Plugin is currently restorating now ... [hexo-generator-amp] Plugin is currently restorating now ... [hexo-generator-amp] Plugin is currently restorating now ... [hexo-generator-amp] Plugin is currently restorating now ... [hexo-generator-amp] Plugin is currently restorating now ... [hexo-generator-amp] Plugin is currently restorating now ... [hexo-generator-amp] Plugin is currently replacing lazy video now ... FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
ReferenceError: post is not defined
at Object. (/Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:28:91)
at initialize.exports.each (/Path/Blog/node_modules/hexo-generator-amp/node_modules/cheerio/lib/api/traversing.js:300:24)
at /Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:24:16
at Promise._execute (/Path/Blog/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Path/Blog/node_modules/bluebird/js/release/promise.js:481:18)
at new Promise (/Path/Blog/node_modules/bluebird/js/release/promise.js:77:14)
at module.exports.filter_video (/Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:17:10)
at tryCatcher (/Path/Blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Path/Blog/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/Path/Blog/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Path/Blog/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Path/Blog/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/Path/Blog/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Path/Blog/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/Path/Blog/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
at processImmediate [as _immediateCallback] (timers.js:594:5)
FATAL post is not defined
ReferenceError: post is not defined
at Object. (/Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:28:91)
at initialize.exports.each (/Path/Blog/node_modules/hexo-generator-amp/node_modules/cheerio/lib/api/traversing.js:300:24)
at /Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:24:16
at Promise._execute (/Path/Blog/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Path/Blog/node_modules/bluebird/js/release/promise.js:481:18)
at new Promise (/Path/Blog/node_modules/bluebird/js/release/promise.js:77:14)
at module.exports.filter_video (/Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:17:10)
at tryCatcher (/Path/Blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Path/Blog/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/Path/Blog/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Path/Blog/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Path/Blog/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/Path/Blog/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Path/Blog/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/Path/Blog/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
at processImmediate [as _immediateCallback] (timers.js:594:5)

delete amp-template, and remove and reinstall npm package,

hexo g again , then

INFO Start processing
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
ReferenceError: post is not defined
at Object. (/Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:28:91)
at initialize.exports.each (/Path/Blog/node_modules/hexo-generator-amp/node_modules/cheerio/lib/api/traversing.js:300:24)
at /Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:24:16
at Promise._execute (/Path/Blog/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Path/Blog/node_modules/bluebird/js/release/promise.js:481:18)
at new Promise (/Path/Blog/node_modules/bluebird/js/release/promise.js:77:14)
at module.exports.filter_video (/Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:17:10)
at tryCatcher (/Path/Blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Path/Blog/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/Path/Blog/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Path/Blog/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Path/Blog/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/Path/Blog/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Path/Blog/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/Path/Blog/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
at processImmediate [as _immediateCallback] (timers.js:594:5)
FATAL post is not defined
ReferenceError: post is not defined
at Object. (/Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:28:91)
at initialize.exports.each (/Path/Blog/node_modules/hexo-generator-amp/node_modules/cheerio/lib/api/traversing.js:300:24)
at /Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:24:16
at Promise._execute (/Path/Blog/node_modules/bluebird/js/release/debuggability.js:300:9)
at Promise._resolveFromExecutor (/Path/Blog/node_modules/bluebird/js/release/promise.js:481:18)
at new Promise (/Path/Blog/node_modules/bluebird/js/release/promise.js:77:14)
at module.exports.filter_video (/Path/Blog/node_modules/hexo-generator-amp/lib/filter/video.js:17:10)
at tryCatcher (/Path/Blog/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Path/Blog/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/Path/Blog/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/Path/Blog/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/Path/Blog/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/Path/Blog/node_modules/bluebird/js/release/async.js:133:16)
at Async._drainQueues (/Path/Blog/node_modules/bluebird/js/release/async.js:143:10)
at Immediate.Async.drainQueues (/Path/Blog/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
at processImmediate [as _immediateCallback] (timers.js:594:5)

0e9f9be This commit is wrong.

old version is ok.

AMP page for site index

I see this plugin creates amp pages for only posts.
How can I create amp page for site index ?
my-domain.com/amp ?

Doesn't allow full minification

Hexo 3.2.0 breaks minifiers, but there was a fixed added at sha: 95fb3ce22621bc477e48adfec4152696eb1aae29

So before the next version of Hexo is available on npm you can use git:
npm install //[email protected]:hexojs/hexo.git --save

That will fix minification for standard pages using hexo-all-minifier plugin, however, this plugin will not be fully minified.

Only contents of page in <div class="entry-content ecp"> will be minified.

Publish on AMPThemes.io

Hi there,

This is Ciprian from AMPThemes.io - a market place for AMP themes. I noticed your hexo-generator-amp here on GitHub and I wanted to ask if it would be OK with you to publish it on AMPThemes.io as a freebie, mentioning you as an author and all. Looking forward to hearing your thoughts.

rel="amphtml" Content After Changed Link Structure

Question:

My Hexo Blog's permanent link structure is like this: :title.html, for example, if my title is hello-world, the permanent link will be blogsite.com/hello-world.html.

While configuring this plugin, I found that under my link settings, the plugin could not generate contents like /public/hello-world.html/amp/index.html. So generateAmpPath: :title.html/amp/ #(optional) Custom AMP HTML Path will not work.

I looked into #24 and followed your instruction to change the generateAmpPath variable into generateAmpPath: amp/:title.html, then it does work and able to generate the amp static files for me.

But according to the instruction in README as well as #14, I put the following code into path\to\hexo\themes\next\layout\_partials\head\head.swig

{% if is_post() && config.generator_amp %}
  <link rel="amphtml" href="./amp/index.html">
{% endif %}

But currently the amp generate location has been changed, ./amp/index.html will be a 404 for sure, so what should I do to make the amphtml tag to work?

Many thanks for all the effects in developing this plugin whilst answering questions like this one. More details are provided below.


OS version

  • Windows (please tell me version)
    Windows 10 1809

Node version(node -v)

v10.7.0

Plugin version(npm ls --depth 0)
I dont know why these errors occur.

npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! peer dep missing: eslint@>= 4.12.1, required by [email protected]

Again, thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.