目次と要約

目次と要約

2020-05-29


hexo 目次生成生成プラグイン インストール

hexo

プラグインhexo-toc

目次

1
2
3
4
5
6
7
8
9
10
11
hamkaz@debian1-de-kaz:~/js/hexo/blog$ npm install hexo-toc --save
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated gulp-header@1.8.12: Removed event-stream from gulp-header
+ hexo-toc@1.1.0
added 95 packages from 113 contributors, removed 193 packages, moved 8 packages and audited 381 packages in 14.302s

6 packages are looking for funding
run `npm fund` for details

found 5 vulnerabilities (3 low, 2 high)
run `npm audit fix` to fix them, or `npm audit` for details
1
2
3
4
5
6
7
hamkaz@debian1-de-kaz:~/js/hexo/blog$ hexo generate
INFO Start processing
INFO Files loaded in 322 ms
INFO Generated: index.html
INFO Generated: ka-ki-ku-ke-ko/kiri-no-ii/index.html
INFO Generated: images/kiri-no-ii.jpg
INFO 3 files generated in 316 ms

抜粋をアーカイブリストに表示する

hexo

ツリー構造

1
2
3
4
5
6
/js/hexo/hiker/themes/hiker
.
├── layout
│   ├── _partial
│   │   ├── archive.ejs
│   │   ├── article.ejs

推測方法

トップページ index.html <- index.ejs

1
2
3
index.ejs

<%- partial('_partial/archive', {pagination: 2, index: true}) %>

ここでいうarchiveは、archive.ejsのこと

1
2
3
archive.ejs

<%- partial('article', {post: post, index: true}) %>

ここでいうarticleは、article.ejsのこと

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
article.ejs

<div class="article-entry" itemprop="articleBody">
<% if (theme.post_excerpt && index){ %>
<p class="article-excerpt-content">
<%- (post.excerpt) %>
</p>
<p class="article-more-link">
<a href="<%- url_for(post.path) %>#more"><%= __('read_more') %></a>
</p>
<% } else if (post.excerpt && index){ %>
<%- post.excerpt %>
<% } else { %>
<%- post.content %>
<% } %>
</div>