Hexo(桜)の記事は、ワードカウントを追加し、長い機能を読み取るためにする場合

読み込み時にまず、記事の長さは、ワードカウント機能を追加します

1.インストールhexo-WORDCOUNT

まず、次のコマンドを入力し、関連するプラグイン端子をインストールします。

npm install hexo-wordcount --save

2.設定ファイル(ステップ3)

2.1 theme\sakura\layout\_partial\の下に作成word.ejsファイル(表示スタイル):

	<div style="margin-top:10px;">
	    <span class="post-time">
	      <span class="post-meta-item-icon">
	        <i class="fa fa-keyboard-o"></i>
	        <span class="post-meta-item-text">  字数统计: </span>
	        <!-- 安装插件npm install hexo-wordcount --save -->
	        <span class="post-count"><%= wordcount(post.content) %>字</span>
	      </span>
	    </span>
	
	    <span class="post-time">
	      &nbsp; | &nbsp;
	      <span class="post-meta-item-icon">
	        <i class="fa fa-hourglass-half"></i>
	        <span class="post-meta-item-text">  阅读时长: </span>
	        <span class="post-count"><%= min2read(post.content) %>分</span>
	      </span>
	    </span>
	</div>

2.2\themes\sakura\layout\_widget\共通article.ejs代わりに記事のタイトルは、:(追加追加する</head>タグの前)

		  <!-- 开始添加字数统计-->
	      <% if(theme.word_count && !post.no_word_count){%>
	        <%- partial('_partial/word') %>
	      <% } %>
	      <!-- 添加完成 -->

2.3 MyWeb\themes\sakura\_config.yml追加のコンフィギュレーション・ファイルの末尾:

	# 是否开启字数统计
	#不需要使用,直接设置值为false,或注释掉
	word_count: true
  1. 画像に示す動作結果
    ここに画像を挿入説明

第二に、画像やリンクの表示問題の修復

ここに画像を挿入説明
_POSTディレクトリに記事を書くMDときは、著者情報を追加する必要があります。
author(名称),authorLink(链接),avatar(头像),authorAbout(简介)

---
title: 2020年2月4日情人节随笔
author: cungudafa
authorLink: https://cungudafa.gitee.io
avatar: https://cdn.jsdelivr.net/gh/cungudafa/cdn/img/custom/cungudafa.jpg
authorAbout: 姑,一个学习记录者
date: 2020-02-13 22:59:10
tag: 随笔
categories: 生活
comment: true
description: 
photos: 
---

\themes\sakura\layout\_widget\共通article.ejs記事のタイトルは、スタイルを変更することができます。

ここに画像を挿入説明
ここに画像を挿入説明

公開された203元の記事 ウォンの賞賛352 ビュー130 000 +

おすすめ

転載: blog.csdn.net/cungudafa/article/details/104308312