- Auto add anchor title (if not exists)
- Auto determine anchor external link and nofollow them
Auto replace broken images- Auto compress CSS JS HTML
- Auto add alternate and title of images
- Auto add sitemap (forked from yoast seo wordpress plugin)
- Auto add google news sitemap
- Tested on hexo instances with 1000 more posts and pages
- Concatenate all javascripts into one file
- Rich snippets (breadcrumbs, website, article)
Separated due to very high memory usage and risk of HEAP MEMORY errors. so I will merge it to https://github.com/dimaslanjaka/static-blog-generator as a specific task
demo site generated with hexo-seo
Using NPM Repository (Production)
npm i hexo-seo
Using Git Repository (Development)
npm i git+https://github.com/dimaslanjaka/hexo-seo.git#pre-release
Using tarball is useful for git which not installed properly or for you in chinese mainland
description | link |
---|---|
full link tarball (recommended) | https://github.com/dimaslanjaka/hexo-seo/raw/master/release/hexo-seo.tgz |
repository tarball | https://github.com/dimaslanjaka/hexo-seo/tarball/master |
git repository | git+https://github.com/dimaslanjaka/hexo-seo.git |
Configuration
# https://github.com/dimaslanjaka/hexo-seo
seo:
# minify html
html:
enable: true
# fix invalid html
fix: true
# exclude from minify
exclude:
- "*.min.{htm,html}"
# minify css
css:
enable: true
# If you want to customize the css minifier settings, you can put below
# exclude css from minifying, multiple supported
exclude:
- "**/*.min.css"
# minify js
js:
enable: true
# concatenate all js into one tag
## WARNING: DO NOT USING ANOTHER MINIFIER PLUGIN
concat: false
# If you want to customize the js minifier settings, you can put below
# exclude css from minifying, multiple supported
exclude:
- "**/*.min.js"
# this is terser options, you can customize minifier with terser options https://github.com/terser/terser
# below is config example
options:
compress:
dead_code: true
mangle:
toplevel: true
safari10: true
# add rich snippets on every posts and pages
schema:
article:
enable: true
breadcrumb:
enable: true
sitelink:
enable: true
searchUrl: https://www.webmanajemen.com/search?q={search_term_string}
# this function still under development because JAVASCRIPT HEAP MEMORY and my device is 8GB RAM
img:
enable: true
# fix broken images
broken: false
# default broken images
default: https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg
# broken images methods
# serverside : process broken images from server side (caused javascript heap out of memory, if your post large and your device has insufficient memory)
# clientside : process broken image from client side browser with webjs
onerror: serverside
# external links fix
links:
# enable or false
enable: true
# allowed following links, otherwise nofollow others
exclude:
- webmanajemen.com
- web-manajemen.blogspot.com
# auto generate seo friendly sitemap on http://yoursite.com/sitemap.xml
# forked from yoast seo
sitemap: true
this plugin will run the functions based on development mode or production mode
development mode
set NODE_ENV=development && hexo server
hexo.on('exit')
not called at end of process
no more issue Hexo On Exit Event this plugin already have schedule function
- node_libcurl binding not found
sudo apt-get install libcurl4-openssl-dev -y
# run below codes only if above package already installed
rm -rf node_modules/node-libcurl
npm install node-libcurl --build-from-source
- Fix javascript heap out of memory
# POSIX
export NODE_OPTIONS=--max_old_space_size=8096
# windows
set NODE_OPTIONS=--max_old_space_size=8096
- important after you update this plugin, you could cleaning the temp folders with:
hexo clean # this will cleaning temporarily folders of this plugin