Giter Site home page Giter Site logo

yyitroad / hexo-filter-image Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joeybling/hexo-filter-image

0.0 1.0 0.0 28 KB

自动为hexo中的图片映射绝对路径 | Automatically maps absolute paths to images in hexo

Home Page: https://www.npmjs.com/package/hexo-filter-image

License: MIT License

JavaScript 100.00%

hexo-filter-image's Introduction

介绍

    自动为hexo中的图片映射绝对路径 | Automatically maps absolute paths to images in hexo 添加使用jsdelivr加速图片视频配置。

开始使用

npm i https://github.com/YyItRoad/hexo-filter-image.git --save

由于本身Hexo带有缓存会导致插件第一次使用可能会出现无效果,请使用hexo clean清除缓存后即可正常使用


配置(可选)

请向Hexo的 _config.yml 文件或主题的 _config.yml 文件中添加配置.

filter_image:
  # 日志是否启用
  log: true
  # 是否使用jsdelivr加速
  jsdelivr: null

jsdelivr参数:

  • null => 不使用jsdelivr加速。一般本地调试使用。
  • :path => 加速地址一般为https://cdn.jsdelivr.net/gh/:user/:repo,user为用户名称,repo为项目名称

eg:

jsdelivr: https://cdn.jsdelivr.net/gh/yyitroad/yyitroad.github.io/

Example

    当Hexo配置文件的属性root值变化时,无需改变Markdown内容的图片地址,此插件会自动将图片映射成绝对路径

文章内容示例

![](/img/test.jpg)

Hexo配置文件

root: /testPath/
jsdelivr: https://cdn.jsdelivr.net/gh/yyitroad/yyitroad.github.io/

jsdelivr为null生成后的图片路径为/testPath/img/test.jpg

使用CDN加速后的图片路径为https://cdn.jsdelivr.net/gh/yyitroad/yyitroad.github.io/testPath/img/test.jpg

LICENSE

LICENSE

hexo-filter-image's People

Contributors

joeybling avatar yyitroad avatar

Watchers

James Cloos avatar

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.