JSPM

hexo-renderer-marked-lazy

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q46811F
  • License MIT

Markdown renderer plugin for Hexo, based on Tommy Chen's hexo-renderer-marked

Package Exports

  • hexo-renderer-marked-lazy

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hexo-renderer-marked-lazy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hexo-renderer-marked-lazy

This is a hexo renderer based on hexo-renderer-marked.

The only difference is that marked-lazy supports simple lazy-loading images. The renderer will transform ![some desc](http://img.com/jpg) into something like:

<img src="placeholder.gif" data-echo="http://img.com/jpg" alt="some desc">

As above implies, data-echo is the default "lazy src" attribute name, and its value is the real image source. The name echo come from echo.

In your _config.yml, add your custom attribute as following:

marked:
    lazyAttr: data-src
    blankSrc: /img/placeholder.png
    # for more options
    # please refer to https://github.com/hexojs/hexo-renderer-marked

Then you can add some lazy-loading plugins to your pages.

Enjoy it!