diff --git a/.gitmodules b/.gitmodules index 7b9c85801dc533411ca7da36235492ffe42ecef3..873a633bc0bbb53cfc9ebffe58ca2f9dcc4bb97f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "third_party/foundation-sites"] path = third_party/foundation-sites url = https://github.com/zurb/foundation-sites.git +[submodule "third_party/mathjax"] + path = third_party/mathjax + url = https://github.com/mathjax/MathJax.git diff --git a/src/site.hs b/src/site.hs index 53c69a68b0df361b0e1241d9e3cfa7e3aecb39fb..51c5dd0379e9f4758f980fae04ff731997c34d96 100644 --- a/src/site.hs +++ b/src/site.hs @@ -91,6 +91,12 @@ main = hakyllServeWith serveConf $ do match "third_party/font-awesome/fonts/*" $ do route $ gsubRoute "third_party/font-awesome/" (const "") compile copyFileCompiler + mapM_ matchThirdPartyJSAndCopy + [ "third_party/mathjax/MathJax.js" + , "third_party/mathjax/config/**" + , "third_party/mathjax/extensions/**" + , "third_party/mathjax/jax/**" + ] create ["scss/app.scss"] $ do route $ gsubRoute "scss/" (const "css/") `composeRoutes` setExtension "css" @@ -332,6 +338,11 @@ matchAndCopy (path, extension) = match path $ do route $ dropContentPrefix `composeRoutes` setExtension extension compile copyFileCompiler +matchThirdPartyJSAndCopy :: Pattern -> Rules () +matchThirdPartyJSAndCopy dir = match dir $ do + route $ gsubRoute "third_party/" (const "js/") + compile copyFileCompiler + -- IDENTIFIER HELPERS --------------------------------------------------------- grouper :: MonadMetadata m => [Identifier] -> m [[Identifier]] diff --git a/templates/default.html b/templates/default.html index 08adf372a1741b3520dfb8d574213bcc89767b9e..caafaf554e2a014484bb0fe93b69870dafb31ffd 100644 --- a/templates/default.html +++ b/templates/default.html @@ -119,7 +119,7 @@ </div> <script async type="text/javascript" - src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> + src="/js/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> </body> </html> diff --git a/third_party/mathjax b/third_party/mathjax new file mode 160000 index 0000000000000000000000000000000000000000..82590066f9cc3561d4a6b6355ce82af324cb161d --- /dev/null +++ b/third_party/mathjax @@ -0,0 +1 @@ +Subproject commit 82590066f9cc3561d4a6b6355ce82af324cb161d