All Projects → theme-next → hexo-filter-optimize

theme-next / hexo-filter-optimize

Licence: MIT license
A Hexo plugin that optimize the pages loading speed.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to hexo-filter-optimize

hexo-filter-mathjax
💯 Server side MathJax renderer plugin for Hexo.
Stars: ✭ 76 (+85.37%)
Mutual labels:  hexo, hexo-plugin
hexo-tag-hint
A Hexo tag plugin to display text hint/spoiler tooltip.
Stars: ✭ 26 (-36.59%)
Mutual labels:  hexo, hexo-plugin
hexo-covers
Microbrowser covers for Hexo static site generator
Stars: ✭ 15 (-63.41%)
Mutual labels:  hexo, hexo-plugin
hexo-filter-plantuml
Using PlantUML to generate UML Diagram for hexo
Stars: ✭ 23 (-43.9%)
Mutual labels:  hexo, hexo-plugin
hexo-reading-time
Plugin for Hexo CMS to display reading time for article
Stars: ✭ 28 (-31.71%)
Mutual labels:  hexo, hexo-plugin
hexo-netlify-cms
☕ A cup of coffee time to enable Netlify CMS
Stars: ✭ 29 (-29.27%)
Mutual labels:  hexo, hexo-plugin
hexo-steam-games
为Hexo添加Steam游戏库页面
Stars: ✭ 24 (-41.46%)
Mutual labels:  hexo, hexo-plugin
hexo-hide-posts
A plugin to hide specific posts from your Hexo blog and make them only accessible by links. (隐藏 Hexo 文章)
Stars: ✭ 149 (+263.41%)
Mutual labels:  hexo, hexo-plugin
hexo-tag-xvideos
🔞 Embed xvideos player in your Hexo posts/pages
Stars: ✭ 17 (-58.54%)
Mutual labels:  hexo, hexo-plugin
hexo-include-markdown
Easily load markdownfiles in Markdown .
Stars: ✭ 16 (-60.98%)
Mutual labels:  hexo, hexo-plugin
hexo-directory-category
Automatically add category to Hexo article according to the article file directory.
Stars: ✭ 35 (-14.63%)
Mutual labels:  hexo, hexo-plugin
hexo-tag-instagram
Embed instagram photo and movie tag plugin for Hexo.
Stars: ✭ 23 (-43.9%)
Mutual labels:  hexo, hexo-plugin
hexo-instagram-wall
Displays up to 18 most recent images from your Instagram account
Stars: ✭ 12 (-70.73%)
Mutual labels:  hexo, hexo-plugin
hexo-douban-card
在hexo文章中插入豆瓣读书,豆瓣电影,豆瓣音乐组件
Stars: ✭ 56 (+36.59%)
Mutual labels:  hexo, hexo-plugin
hexo-bilibili-bangumi
hexo 番剧页面插件,可选数据源:Bilibili, Bangumi
Stars: ✭ 252 (+514.63%)
Mutual labels:  hexo, hexo-plugin
Windows-System-Wide-Filter
Windows WDM driver filters to filter IO to devices and file systems
Stars: ✭ 49 (+19.51%)
Mutual labels:  filter
peach-blog
🍑 a blog based on flask
Stars: ✭ 55 (+34.15%)
Mutual labels:  hexo
webpack-json-access-optimizer
Webpack plugin to tree-shake and minify JSON modules
Stars: ✭ 34 (-17.07%)
Mutual labels:  optimize
openapi-filter
Filter internal paths, operations, parameters, schemas etc from OpenAPI/Swagger/AsyncAPI definitions
Stars: ✭ 112 (+173.17%)
Mutual labels:  filter
hpc
Learning and practice of high performance computing (CUDA, Vulkan, OpenCL, OpenMP, TBB, SSE/AVX, NEON, MPI, coroutines, etc. )
Stars: ✭ 39 (-4.88%)
Mutual labels:  optimize

hexo-filter-optimize

travis-image npm-image lic-image

A hexo plugin that optimize the pages loading speed.

It will auto filter your html file, find the <link rel="stylesheet"> block and replace them into a javascript to optimize CSS delivery.

And inline the main.css into the html page like @maple3142 does.

It will improve your pages loading and get a higher score in the Google PageSpeed Insights.

Known Issues: This plugin may cause Font Awesome and PJAX to fail to load.

Installation

size-image dm-image dt-image

npm install hexo-filter-optimize

Usage

Activate the plugin in hexo's _config.yml like this:

filter_optimize:
  enable: true
  # remove the surrounding comments in each of the bundled files
  remove_comments: false
  css:
    # minify all css files
    minify: true
    # bundle loaded css files into one
    bundle: true
    # use a script block to load css elements dynamically
    delivery: true
    # make specific css content inline into the html page
    #   - only support the full path
    #   - default is ['css/main.css']
    inlines:
    excludes:
  js:
    # minify all js files
    minify: true
    # bundle loaded js files into one
    bundle: true
    excludes:
  # set the priority of this plugin,
  # lower means it will be executed first, default of Hexo is 10
  priority: 12

This plugin can be disabled by NODE_ENV in development to boost hexo generate:

export NODE_ENV=development

Comparison

Here is a result from GTmetrix to show you the changes between before and after. (Same web server located in Tokyo, Japan, vultr.com)

  • Remove query strings from static resources - let all the proxies could cache resources well. (https://gtmetrix.com/remove-query-strings-from-static-resources.html)
  • Make fewer HTTP requests - through combined the loaded js files into the one.
  • Prefer asynchronous resources - change the css delivery method using a script block instead of link tag.
  • And TODOs ...

Comparison

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].