Skip to content

Commit

Permalink
feat: update mathjax usage
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzhuan committed Nov 1, 2024
1 parent 0f1fa36 commit 0cb12c8
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions _posts/2017-12-08-hello-jekyll.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,7 @@ MathJax = {
<script id="MathJax-script" async src="https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js"></script>
```

如果你用的是 Minima 主题,可以创建 `_includes/head.html` 文件,内容如下:

```html
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{%- seo -%}

{%- if page.use_math -%}
{%- include mathjax.html -%}
{%- endif -%}

<link rel="stylesheet" href="{{ "/assets/main.css" | relative_url }}">
{%- feed_meta -%}
{%- if jekyll.environment == 'production' and site.google_analytics -%}
{%- include google-analytics.html -%}
{%- endif -%}
</head>
```
然后将 `mathjax.html` 按需引入到布局文件中。比如,当 `use_math``true` 时,才包含这个文件。

在需要数学公式的文章顶部,设置 `use_math: true` front matter。

Expand Down

0 comments on commit 0cb12c8

Please sign in to comment.