落公的小站

vuePress-theme-reco 落公    2020 - 2021
落公的小站 落公的小站

Choose mode

  • dark
  • auto
  • light
首页
指北
分类
  • 其它
  • IT
  • 想法
标签
时间轴
关于我
网站导航 (opens new window)
GitHub (opens new window)
author-avatar

落公

24

文章

13

标签

首页
指北
分类
  • 其它
  • IT
  • 想法
标签
时间轴
关于我
网站导航 (opens new window)
GitHub (opens new window)

博客搭建

vuePress-theme-reco 落公    2020 - 2021

博客搭建

落公 2020-09-29 11:19:11 博客

# 博客搭建

# vuepress 安装 markdown-it-katex 插件

yarn add markdown-it-katex
1

katex 需要引用css文件和js文件,官方文档:https://katex.org/docs/browser.html(opens new window)

vueprss 配置文件,需要添加一下代码即可:

head: [
    ['link', {
        rel: 'stylesheet',
        href: 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css'
    }],
    ['link', {
        rel: "stylesheet",
        href: "https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/2.10.0/github-markdown.min.css"
    }],
]

markdown: {
    // 代码块函数显示
    lineNumbers: true,
    extendMarkdown: md => {
        md.set({
            html: true
        })
        md.use(require('markdown-it-katex'))
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21