はじめに

hexoには様々な拡張機能がプラグインとして提供されている。
その中から,今自分が使っているモノのリストとその使い方をメモしておく。

目次

  1. はじめに
  2. インストール一覧
  3. インストール詳細
    1. コア関連
    2. 取り合えず入れとけば動くもの
    3. 投稿作成時に記述が必要なもの
  4. 最後に

インストール一覧

一覧というか,package.jsonを晒す。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.8.0"
},
"dependencies": {
"hexo": "^3.8.0",
"hexo-algoliasearch": "^0.3.0",
"hexo-autonofollow": "^1.0.1",
"hexo-browsersync": "^0.3.0",
"hexo-clean-css": "0.0.3",
"hexo-deployer-ftpsync": "^0.1.1",
"hexo-deployer-git": "^1.0.0",
"hexo-filter-flowchart": "^1.0.4",
"hexo-filter-sequence": "^1.0.3",
"hexo-fs": "^1.0.2",
"hexo-generator-archive": "^0.1.5",
"hexo-generator-category": "^0.1.3",
"hexo-generator-feed": "^1.2.2",
"hexo-generator-index": "^0.2.1",
"hexo-generator-seo-friendly-sitemap": "0.0.25",
"hexo-html-minifier": "0.0.2",
"hexo-i18n": "^0.2.1",
"hexo-imagemin": "^0.1.0",
"hexo-notify": "0.0.1",
"hexo-pagination": "^0.1.0",
"hexo-renderer-ejs2": "^0.1.0",
"hexo-renderer-marked": "^0.3.2",
"hexo-renderer-stylus": "^0.3.3",
"hexo-server": "^0.3.3",
"hexo-uglify": "0.0.5",
"hexo-util": "^0.6.3",
"install": "^0.12.2",
"jquery": "^3.4.0",
"jsdom": "^14.0.0",
"npm": "^6.9.0",
"prompt": "^1.0.0",
"uglify-js": "^3.5.4"
},
"devDependencies": {
"hexo-generator-tag": "^0.2.0"
}
}

“dependencies”に入っているのが,hexo関連。
以下に詳細を見ていく

インストール詳細

コア関連

取り合えず,何も考えずにぶち込んどけってやつ。

  • hexo-generator-archive……「アーカイブの生成」
hexo-generator-archive
1
2
3
4
5
archive_generator:
per_page: 10 #ページネーションの数
yearly: true #年毎のアーカイブ生成
monthly: true #月毎のアーカイブ生成
daily: false #日毎のアーカイブ生成
  • hexo-generator-category……「カテゴリーページの生成」

  • hexo-generator-feed……「AtomまたはRSSのフィードを作成」

  • hexo-generator-index……「最初のindexページの生成」

  • hexo-toc……「ポストがレンダリングされる前に、マークダウンTOC(目次)を挿入します。」

    hexo-generator-archive
    1
    2
    3
    4
    5
    6
    7
    8
    toc:
    maxdepth: 3 #最大深度以下の見出しを使用する。
    class: toc ♯tocのCSSクラス
    slugify: transliteration #どのslugify関数を使用するかを選択します。現在、uslug(デフォルト)と音訳をサポートしています
    anchor: # 見出しごとにアンカーが必要かどうか(Default is false)
    position: after #アンカーは、タイトルの前またはタイトルの後ろに置く必要があります。 (Default is after);
    symbol: '#' #どのシンボルをアンカーにしたいか(Default is #);
    style: header-anchor #アンカーのCSSクラス、(Default is header-anchor);
  • hexo-generator-seo-friendly-sitemap,……「googleエンジン用にサイトマップ(XML)を生成。投稿記事オプションにsitemap: falseを付けると,そのページは除外される」

  • hexo-generator-tag……「タグページの生成」

  • hexo-fs……「ファイルシステムモジュール」

  • hexo-i18n……「多言語対応のなめのi18nが使えるようになる」

  • hexo-renderer-ejs2……「テンプレートエンジンejs関連」

  • hexo-renderer-marked……「マークダウン用レンダラー」

  • hexo-imagemin……「画像のサイズを圧縮する」

    hexo-imagemin
    1
    2
    3
    4
    5
    6
    7
    imagemin:
    enable : true //プラグインのon/off
    interlaced : false //プログレシッブレタリングをするか
    multipass : false //svgの最適化
    optimizationLevel: 2 //最適化レベルを0~7で
    pngquant : false //pngquantプラグインを使用するか(別途インストール必要?)
    progressive: false //プログレッシブへの無損失変換
  • hexo-notify……お知らせ用?

  • hexo-pagination……「ページネーション用プラグイン」

  • hexo-server……「ローカルで確認するためのサーバー機能」

取り合えず入れとけば動くもの

  • hexo-algoliasearch……「Webサイト用の検索ボックスalgoliaを使用できるようにする。当然algoliaアカウントが必要

  • hexo-autonofollow……「hexoの外部リンクをすべてnofollow属性を付加」

  • hexo-clean-css……「clean-cssのhexo版」

    1
    2
    3
    clean_css:
    exclude:
    - *.min.css
  • hexo-deployer-ftpsync……「FTPでサーバーと繋ぐ」

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    deploy:
    type: ftpsync
    host: <host>
    user: <user>
    pass: <password>
    remote: [remote]
    port: [port]
    ignore: [ignore]
    connections: [connections]
    verbose: [true|false]
  • hexo-deployer-git……「gitにデプロイできるようにするプラグイン」

    hexo-deployer-git languages:yml
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    deploy:
    type: git
    repo: <repository url>
    branch: [branch]
    message: [message]
    name: [git user]
    email: [git email]
    extend_dirs: [extend directory]
    ignore_hidden: false # default is true

    # or this:
    deploy:
    type: git
    message: [message]
    repo:
    github: <repository url>,[branch]
    gitcafe: <repository url>,[branch]
    extend_dirs:
    - [extend directory]
    - [another extend directory]
    ignore_hidden:
    public: false
    [extend directory]: true
    [another extend directory]: false
  • hexo-html-minifier……「HTMLMinifier。HTMLのサイズを縮小して読み込み速度UP」

投稿作成時に記述が必要なもの

  • hexo-renderer-stylus……「NibというCSSライブラリを使えるようにする」

最後に

まだまだ使いこなせてないモノや便利なものがありそうなので,この記事は随時更新するかも。
兎に角迷ったらhexo公式のプラグインページへ

  • hexo
    - hexo-autonofollow
    - hexo-browsersync
    - hexo-clean-css
    - hexo-deployer-ftpsync
    - hexo-deployer-git
    - hexo-filter-flowchart
    - hexo-filter-sequence
    - hexo-filter-sub
    - hexo-filter-sup
    - hexo-fs
    - hexo-generator-archive
    - hexo-generator-category
    - hexo-generator-feed
    - hexo-generator-index
    - hexo-generator-seo-friendly-sitemap
    - hexo-generator-tag
    - hexo-html-minifier
    - hexo-i18n
    - hexo-imagemin
    - hexo-notify
    - hexo-pagination
    - hexo-renderer-ejs2
    - hexo-renderer-marked
    - hexo-renderer-stylus
    - hexo-server
    - hexo-toc
    - hexo-uglify
    - hexo-util