诗词格律作业

第一次作业—绝句

二月初一北京初雪

三千雪精灵,半日帝都行。

略施魔法力,北京变北平。

战风寒

周身炽炎炎,鼻中物黏黏。

七尺男子汉,何用双黄连?

第二次作业—律诗

玉渊潭公园赏樱花

枝上樱花一丛丛,四月日暖春意浓。

粉蕊新开饰柳绿,素衣方着映浅红。

几树樱花照水镜,巧借春风弄姿容。

同行皆是世俗客,独得花香润喉咙。

Hexo设置

渲染LaTeX公式

1、卸载marked渲染器,安装markdown it plus渲染器

1
2
npm uninstall hexo-render-marked --save
npm install hexo-renderer-markdown-it-plus --save

2、配置_config.yml文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
markdown_it_plus:
highlight: true
html: true
xhtmlOut: true
breaks: true
langPrefix:
linkify: true
typographer:
quotes: “”‘’
plugins:
- plugin:
name: markdown-it-katex
enable: true
- plugin:
name: markdown-it-mark
enable: false

3、在head中加载Katex的CSS样式

/themes/所选主题/layout/_partial/head.ejs中写入

1
<link href="https://cdn.bootcss.com/KaTeX/0.7.1/katex.min.css" rel="stylesheet">

4、遇到报错Cannot find module 'markdown-it-katex'

1
npm install markdown-it-katex --save