Skip to content

Commit

Permalink
feat: add assets
Browse files Browse the repository at this point in the history
  • Loading branch information
berrywhj committed Apr 6, 2024
1 parent d609c2d commit 9f8e871
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/_posts/2024-04-06-Integrate-MathJax-into-jekyll.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
layout: post
title: "Integrate MathJax into Jekyll"
date: 2024-04-06 18:11:18 -0500
categories: github-pages Jekyll MathJax
---

Jekyll Markdown Support doesn't includes mathematical equations. If one wants to write mathematical equations, integrating
MathJax might be one possbile solution.

If you are also using minima as the theme, you can allow mathematical syntax in your post pages by performing following steps:
- Run `bundle info --path` followed by the name of the theme’s gem, e.g., `bundle info --path minima` for Jekyll’s default theme.
This returns the location of the gem-based theme files. For example, the Minima theme’s files might be located in /usr/local/lib/ruby/gems/2.6.0/gems/minima-2.5.1 on macOS.
- Open the themes directory, and find the `default.html` file under the `_layout folder`, `copy` that file into the _layouts folder of your project. If you have `no` `_layouts folder` under the `docs folder` in your project just like me, you might need to `create` that the _layouts folder.
- `Append` the following scirpts tag into the `default.html` file

{% highlight html %}
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
{% endhighlight %}

Now your default.html file under the _layouts folder might look like this:

![Defaul.html](/berrywhj.github.io/assets/img/defaul-html.png)


Then your post pages should be able to render mathematical equations properly.

![Mathematical Equations](/berrywhj.github.io/assets/img/mathematical-equations.png)
Binary file added docs/assets/img/defaul-html.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/img/mathematical-equations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9f8e871

Please sign in to comment.