map helper
You’ll find this post in your _posts
directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve
, which launches a web server and auto-regenerates your site when a file is updated.
Jekyll requires blog post files to be named according to the following format:
YEAR-MONTH-DAY-title.MARKUP
Where YEAR
is a four-digit number, MONTH
and DAY
are both two-digit numbers, and MARKUP
is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.
Jekyll also offers powerful support for code snippets:
https://github.com/jekyll/jekyll-compose
// Add some numbers
const code = `var data = 1;`;
// Returns a highlighted HTML string
const html = Prism.highlight(code, Prism.languages.javascript, 'javascript');
const Prism = require('prismjs');
// Missing jekyll minima folders: https://github.com/jekyll/minima/issues/38
// code fences: https://gettingthingstech.com/make-prism.js-show-line-numbers-by-default-without-css-classes/
// https://prismjs.com/index.html
// http://onesolved.com/post/prismjs/
// https://www.rubydoc.info/gems/mm-jekyll-prism/0.0.1
// https://mycyberuniverse.com/disable-rouge-syntax-highlighter.html
// https://mycyberuniverse.com/replace-rouge-highlighter-prismjs-jekyll.html
// The code snippet you want to highlight, as a string
const code = `var data = 1;`;
// Returns a highlighted HTML string
const html = Prism.highlight(code, Prism.languages.javascript, 'javascript');