yizeng / jekyll-theme-simple-texture

A gem-based responsive simple texture styled Jekyll theme.
https://yizeng.github.io/jekyll-theme-simple-texture/
MIT License
189 stars 216 forks source link

add MathJax for LaTeX support #25

Open HHONG-WM opened 5 years ago

yizeng commented 5 years ago

@HHONG-WM

Sorry for the wait!

Just had a look, a small tweak is needed. Basically, what I'm trying to change:

Tried to tweak a bit directly on GitHub, but only managed to remove but not to add. Below is needed, could you please add it in your branch? Thanks

  1. Add confugration key load_math_jax in both of the _config.yml files:

jekyll-theme-simple-texture/_config.yml jekyll-theme-simple-texture/starter-kit/_config.yml

# Site Settings
encoding: UTF-8
exclude: ["*.gem", "*.gemspec", "Gemfile", "Gemfile.lock", "node_modules", "Rakefile", "starter-kit", "vendor"]
lang: en # Language code as defined in _data/i18n.yml. en, en-gb, en-us, zh, zh-cn, zh-tw etc.
permalink: /blog/:year/:month/:day/:title/

whitelist: [jekyll-feed, jekyll-redirect-from, jekyll-seo-tag, jekyll-sitemap]
plugins:
  - jekyll-feed
  - jekyll-redirect-from
  - jekyll-seo-tag
  - jekyll-sitemap

markdown: kramdown
kramdown:
  auto_id_prefix: 'heading-'
  smart_quotes: ["apos", "apos", "quot", "quot"]
  toc_levels: 1..3

sass:
  style: compressed

# Site Data
url: # the base hostname & protocol for your site, e.g. http://example.com
baseurl: # the subpath of your site, e.g. /blog
title: Simple Texture
description: "A gem-based responsive simple texture styled Jekyll theme."
keywords: 'jekyll,theme,gem-based,blog'
author:
  name:
  job_title:
  location:
  email:
  social_links:
    - name: facebook
      url:
    - name: github
      url: https://github.com/yizeng/jekyll-theme-simple-texture
    - name: instagram
      url:
    - name: linkedin
      url:
    - name: stackoverflow
      url:
    - name: twitter
      url: 
    - name: vk
      url:
home:
  section1: <h1>Simple Texutre</h1>
  section2: <h2>A gem-based responsive simple texture styled Jekyll theme</h2>
  section3: <div class="social-links"><a class="ico-github btn" href="https://github.com/yizeng/jekyll-theme-simple-texture" title="View on GitHub"></a></div>
blog:
  cc_license: http://creativecommons.org/licenses/by-sa/4.0/ # A link to CC License of your choice.
  cc_license_image: /assets/images/theme/cc-by-sa.png # An image of your CC License. 
  footer_content: A gem-based responsive simple texture styled <a href="http://jekyllrb.com/">Jekyll</a> theme.

disqus:
  shortname: # e.g. yizeng
  public_key: # e.g. ULZ0b9TFefCUJHKQd4JCKv2v3u27YoG7YG8zXPewkWrT333Z0Se9YnxLzoV6VM8W
google_tag_manager: # e.g. 'GTM-KCQJXZ8F'
addthis_public_id: # AddThis sharing plugin. See http://www.addthis.com/. E.g. ra-53329e27694534j5 
load_math_jax: # true to turn it on.

paths:
  home: /
  blog: /blog/
  categories: /blog/categories/
  tags: /blog/tags/
  1. Inside jekyll-theme-simple-texture/_layouts/post.html add the following at the end (with the correct spacing (4 spaces)):

    {% if site.load_math_jax %} {% include common/math-jax.html %} {% endif %}

  2. Have a test around to see if it still works as you intended