推荐插件

  • hexo-autoprefixer 自动修复css文件或补充浏览器厂商前缀
  • hexo-deployer-git 介于用gitlab和coding直接部署十分方便,所以这个插件不再推荐
  • hexo-filter-lqip 图片懒加载和低质量异步加载原图
  • hexo-filter-responsive-images 生成多个尺寸的图片
  • hexo-filter-optimize 一个优化页面加载速度的 Hexo 插件。
  • hexo-generator-alias 重定向插件,页面重定向指定网址,或者多个路径重定向到当前文档
  • hexo-html-minifier
  • hexo-submit-urls-to-search-engine 主动推送Hexo博客新链接至谷歌必应百度搜索引擎,提升网站收录质量和速度。https://github.com/cjh0613/hexo-submit-urls-to-search-engine

hexo-generator-amp

https://github.com/tea3/hexo-generator-amp

自动生成 AMP,普通链接为 http://localhost:4000/posts/ AMP 链接为 http://localhost:4000/posts/amp/,另外需要在模板 head 文件配置 AMP 链接。

支持选择 AMP 模板,支持谷歌广告。

https://github.com/hvnobug/hexo-external-link

自动为 a 标签外链 增加 target='_blank', rel='external nofollow noopener noreferrer' 属性,并且可以自定义,还可以生成外链跳转页面 go.html。好像没有白名单功能。

安装

npm install hexo-external-link --save

hexo-autonofollow

https://github.com/liuzc/hexo-autonofollow

自动将 nofollow 相关属性 rel="external nofollow" target="_blank" 添加到文章中的外部链接,可以设置白名单

安装

npm install hexo-autonofollow --save

hexo-filter-nofollow nofollow白名单

https://github.com/hexojs/hexo-filter-nofollow

自动将 nofollow 相关属性 rel="noopener external nofollow noreferrer",可以设置白名单

安装

npm i hexo-filter-nofollow --save

hexo-abbrlink2

https://github.com/rozbo/hexo-abbrlink2

自动生成 url ,自动以 ID(数字) 递增,但是如果修改文件名会重新创建。

配置

permalink: posts/:abbrlink/

扩展配置

abbrlink:
  start: 1000 # 从多少开始,默认从 0 开始

生成演示

https://post.zz173.com/posts/1.html
https://post.zz173.com/posts/2.html
https://post.zz173.com/posts/3.html

https://github.com/rozbo/hexo-abbrlink

自动生成短链接,根据 crc16 或者 crc32 随机生成链接。

hexo-generator-random

https://github.com/Drew233/hexo-generator-random

随机打开一篇文章

插件必须依赖(前3个hexo一般已经集成)

  1. minimatch
  2. path
  3. fs
  4. object-assign

hexo-sitemap-generator

  • https://www.npmjs.com/package/hexo-sitemap-generator

安装

npm install hexo-sitemap-generator --save

在根目录 _config.yml 文件配置插件

sitemaps:
  path: 
    - sitemap.xml
    - sitemap.txt
    - sitemap.html
  # template: ./sitemap_template.xml
  # template_txt: ./sitemap_template.txt
  # template_html: ./sitemap_template.html
  rel: false
  tags: true
  categories: true

内容禁止添加到 sitemap 在内容 front matter 添加 sitemap: false


title: 页面找不到

sitemap: false

hexo-generator-alias

  • https://www.npmjs.com/package/hexo-generator-alias

安装

npm install hexo-generator-alias --save

根目录 _config.yml 文件配置指定页面URL的跳转

alias:
  about-page/index.html: about/
  site/github.html: https://github.com/

多个页面URL跳转到当前页面URL,配置 alias

---
title: 当前页面
alias: foo/index.html # 一个
 
alias: # 多个
- foo/index.html
- bar/index.html
--- 

当前页面跳转到其他页面,配置 redirect

--- 
title: 当前页面
redirect: http://1px.run/
--- 

回到顶部

Copyright © 2017-2024 1px.run (像素教程) Distributed by an MIT license.

Site updated at 2024-04-23 12:45