Skip to content

Commit

Permalink
feat: support MathJax in default theme
Browse files Browse the repository at this point in the history
This closes InkProject#95 .
  • Loading branch information
w568w committed Jan 31, 2023
1 parent dfba340 commit d25798d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions template/source/ink-blog-tool-en.md
Expand Up @@ -23,6 +23,21 @@ InkPaper is a static blog generator developed in Golang. No dependencies, cross
- Open `http://localhost:8000` in your browser to preview

### Features
- YAML format configuration
- Markdown format articles
- No dependencies, cross platform
- Super fast build times
- Continuously improving theme and typography
- Multiple article authors support
- Archive and tag generation
- Real-time preview when saving
- Offline full-text keyword search
- $\LaTeX$ style math formula support (MathJax):

$$
\int_{-\infty}^\infty g(x) dx = \frac{1}{2\pi i} \oint_{\gamma} \frac{f(z)}{z-g(x)} dz
$$
### Website Configuration
Edit `config.yml`, use this format:

Expand Down
5 changes: 5 additions & 0 deletions template/source/ink-blog-tool.md
Expand Up @@ -34,6 +34,11 @@ preview: 纸小墨(InkPaper)是一个GO语言编写的开源静态博客构
- 归档与标签自动生成
- 保存时实时预览页面
- 离线的全文关键字搜索
- $\LaTeX$ 风格的数学公式支持(MathJax):

$$
\int_{-\infty}^\infty g(x) dx = \frac{1}{2\pi i} \oint_{\gamma} \frac{f(z)}{z-g(x)} dz
$$

### 配置网站
编辑`config.yml`,使用如下格式:
Expand Down
4 changes: 4 additions & 0 deletions template/theme/_head.html
Expand Up @@ -51,6 +51,10 @@
};
var root = '{{.Site.Root}}';
</script>

<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>

{{if .Develop}}
<script type="text/javascript">
var conn, reloadTimer, connectTimer;
Expand Down

0 comments on commit d25798d

Please sign in to comment.