tupui
tupui

Reputation: 6528

Gitlab pages mathjax

I am using Gitlab Pages to host a documentation generated with Sphinx.

Is it possible to render math with MathJax using Gitlab Pages? From my testing, equations are not rendered. Do I need to install MathJax along with doc in order for this to work? The generated documentation render properly on a local machine.

Upvotes: 0

Views: 675

Answers (2)

Max Baroi
Max Baroi

Reputation: 31

I'm not using Sphinx but a different static site generator for gitlab pages. Rendering with mathjax is working perfectly fine for me. I didn't have to do anything special, I just have the following snippet in my <head> element:

<script type="text/javascript" id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js">
</script>

Upvotes: 0

Steve Piercy
Steve Piercy

Reputation: 15065

No. From: https://docs.gitlab.com/ee/user/project/pages/getting_started_part_one.html#static-sites

GitLab Pages only supports static websites, meaning, your output files must be HTML, CSS, and JavaScript only.

It would be up to you to render the static site through a process either on your local computer and pushing the result to your repository or with continuous integration using GitLab CI. Here's a blog post where GitLab uses Nanoc instead of Sphinx, but you could replace it in your CI.

Upvotes: 1

Related Questions