<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Jekyll |</title><link>https://kristianeschenburg.netlify.app/tag/jekyll/</link><atom:link href="https://kristianeschenburg.netlify.app/tag/jekyll/index.xml" rel="self" type="application/rss+xml"/><description>Jekyll</description><generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Sun, 12 Aug 2018 02:14:14 -0700</lastBuildDate><image><url>https://kristianeschenburg.netlify.app/img/Bayes.jpg</url><title>Jekyll</title><link>https://kristianeschenburg.netlify.app/tag/jekyll/</link></image><item><title>Enabling Custom Jekyll Plugins with TravisCI</title><link>https://kristianeschenburg.netlify.app/post/enabling-custom-jekyll-plugins/</link><pubDate>Sun, 12 Aug 2018 02:14:14 -0700</pubDate><guid>https://kristianeschenburg.netlify.app/post/enabling-custom-jekyll-plugins/</guid><description>&lt;p>I just learned about
&lt;a href="https://travis-ci.org/" target="_blank" rel="noopener">TravisCI&lt;/a> (actually, about continuous integration (CI) in general) after attending
&lt;a href="http://neurohackademy.org/" target="_blank" rel="noopener">Neurohackademy 2018&lt;/a>. We learned about CI from the perspective of ensuring that your code builds properly when you update files in your packages, incorporate new methods, refactor your code, etc. Pretty neat.&lt;/p>
&lt;p>Fast forward a couple days, and I&amp;rsquo;m trying to incorporate custom Jekyll plugins into my blog &amp;ndash; I quickly realized GitHub doesn&amp;rsquo;t allow this for security reasons, but I couldn&amp;rsquo;t find a convenient work-around. Some posts suggested using a separate repo branch to build the site, and then push the static HTML files up to a remote repo to do the actual hosting, but for some reason I couldn&amp;rsquo;t get that approach to work.&lt;/p>
&lt;p>Finally, I saw some mentions of using TravisCI and
&lt;a href="https://circleci.com/pricing/?utm_source=gb&amp;amp;utm_medium=SEM&amp;amp;utm_campaign=SEM-gb-200-Eng-ni&amp;amp;utm_content=SEM-gb-200-Eng-ni-Circle-CI&amp;amp;gclid=Cj0KCQjwtb_bBRCFARIsAO5fVvGQIO23w0ahWrTj3v8MrGLEnjI00KcEClqUuQda-Q_cz05h8jjEC5QaAjeREALw_wcB" target="_blank" rel="noopener">CircleCI&lt;/a> to build and push the site using continuous integration. I ended up using the approach suggested by
&lt;a href="http://joshfrankel.me/blog/deploying-a-jekyll-blog-to-github-pages-with-custom-plugins-and-travisci/" target="_blank" rel="noopener">Josh Frankel&lt;/a>.&lt;/p>
&lt;p>Josh&amp;rsquo;s site gives a really clear explanation of the necessary steps, given some very minmal prequisite knowledge about using Git. His instructions actually worked almost perfectly for me, so I won&amp;rsquo;t repeat them again here (just follow the link above, if you&amp;rsquo;re interested) &amp;ndash; however, there were a few issues that arose on my end:&lt;/p>
&lt;ol>
&lt;li>
&lt;p>For some reason, I had an &lt;code>about.html&lt;/code> file and &lt;code>index.html&lt;/code> file in the main repo directory &amp;ndash; my built blog wouldn&amp;rsquo;t register any updates I made to &lt;code>about.md&lt;/code> or &lt;code>index.md&lt;/code> while these files were around, so I deleted the HTML files. This might have been an obvious bug to someone with more web programming experience, but I&amp;rsquo;m a novice at that. If you&amp;rsquo;re seeing any wonky behavior, check to make sure you don&amp;rsquo;t have any unnecessary files hanging around.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Ruby version&lt;/strong>: I had to change the version of Ruby I was using to &lt;code>ruby-2.4.1&lt;/code>.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Plugins&lt;/strong>: Make sure any Jekyll plugins you want to use are already installed.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Emails&lt;/strong>: You can turn off email reporting from TravisCI by adding
&lt;code>notifications: email: false&lt;/code> to your &lt;code>.travis.yml&lt;/code> file.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;p>But now, you can incorporate custom, user-built Jekyll plugins and let TravisCI do the heavy lifting! I specifically wanted the ability to reference papers using BibTex-style citation links with Jekyll, like you can with LaTex or Endnote &amp;ndash; this capability isn&amp;rsquo;t currently supported by GitHub. Happy blogging!&lt;/p></description></item><item><title>Rendering LaTex In Markdown Using Jekyll</title><link>https://kristianeschenburg.netlify.app/post/rendering-latex-in-markdown-using-jekyll/</link><pubDate>Sat, 11 Aug 2018 02:14:14 -0700</pubDate><guid>https://kristianeschenburg.netlify.app/post/rendering-latex-in-markdown-using-jekyll/</guid><description>&lt;p>In putting together this blog, I wanted to be able to talk about various mathematical topics that I found interesting, which inevitably lead to using LaTex in my posts.&lt;/p>
&lt;p>I&amp;rsquo;m currently using Atom as my editor (having converted from Sublime), and needed to install a bunch of packages first. First and foremost, I wanted to be able to render my markdown posts before hosting them on the blog, and consequentially needed a way to render LaTex. For this, I installed a few Atom packages:&lt;/p>
&lt;ul>
&lt;li>
&lt;a href="https://atom.io/packages/markdown-it-preview" target="_blank" rel="noopener">Markdown-Preview&lt;/a>&lt;/li>
&lt;li>
&lt;a href="https://atom.io/packages/latex" target="_blank" rel="noopener">Latex&lt;/a>&lt;/li>
&lt;li>
&lt;a href="https://atom.io/packages/language-latex" target="_blank" rel="noopener">Language-Latex&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>To preview your post in Atom, you just type &lt;code>ctrl+shift+M&lt;/code>, which will display both in-line and block math sections.&lt;/p>
&lt;p>However, if you build your site locally with the command &lt;code>bundle exec jekyll serve&lt;/code> or push it to a remote repo, the LaTex no longer renders properly. After Googling around a bit, I determined that this was due to the way markdown converters in Jekyll, like &lt;strong>kramdown&lt;/strong> and &lt;strong>redcarpet&lt;/strong>, do the conversion using MathJax &amp;ndash; specifically, in-line math segments are not properly rendered. I wanted a way to both preview the LaTex in Atom, and properly render it usng Jekyll. I found two links that solved the problem for me:&lt;/p>
&lt;ul>
&lt;li>
&lt;a href="http://www.gastonsanchez.com/visually-enforced/opinion/2014/02/16/Mathjax-with-jekyll/" target="_blank" rel="noopener">Visually Enforced&lt;/a>&lt;/li>
&lt;li>
&lt;a href="http://www.iangoodfellow.com/blog/jekyll/markdown/tex/2016/11/07/latex-in-markdown.html" target="_blank" rel="noopener">LaTeX in Jekyll&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>In short, the following steps solved the problem of LaTex not rendering for me. I&amp;rsquo;m using the &lt;strong>minima&lt;/strong> theme, so I first found the theme directory with &lt;code>bundle show minima&lt;/code>. In this directory, I copied the &lt;strong>./layouts/post.html&lt;/strong> to a local directory in my project folder called &lt;strong>./_layouts/post.html&lt;/strong>.&lt;/p>
&lt;p>Within this file, I pasted the following two sections of HTML code:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-html" data-lang="html">&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">script&lt;/span> &lt;span class="na">type&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;text/x-mathjax-config&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">MathJax&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">Hub&lt;/span>&lt;span class="p">.&lt;/span>&lt;span class="nx">Config&lt;/span>&lt;span class="p">({&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">tex2jax&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="p">{&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">skipTags&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="p">[&lt;/span>&lt;span class="s1">&amp;#39;script&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;noscript&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;style&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;textarea&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="s1">&amp;#39;pre&amp;#39;&lt;/span>&lt;span class="p">],&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">inlineMath&lt;/span>&lt;span class="o">:&lt;/span> &lt;span class="p">[[&lt;/span>&lt;span class="s1">&amp;#39;$&amp;#39;&lt;/span>&lt;span class="p">,&lt;/span>&lt;span class="s1">&amp;#39;$&amp;#39;&lt;/span>&lt;span class="p">]]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">});&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="p">&amp;lt;/&lt;/span>&lt;span class="nt">script&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">&amp;lt;&lt;/span>&lt;span class="nt">script&lt;/span> &lt;span class="na">src&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&amp;#34;&lt;/span> &lt;span class="na">type&lt;/span>&lt;span class="o">=&lt;/span>&lt;span class="s">&amp;#34;text/javascript&amp;#34;&lt;/span>&lt;span class="p">&amp;gt;&amp;lt;/&lt;/span>&lt;span class="nt">script&lt;/span>&lt;span class="p">&amp;gt;&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>And voila &amp;ndash; building the posts now correctly renders LaTex!&lt;/p></description></item></channel></rss>