From 9c9ca9a5e1f701b8414a56f99c116a6a9c1382a0 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 1 Jun 2016 15:31:09 -0400 Subject: [PATCH] Replace {% highlight %} tags with GitHub Flavored Markdown backticks --- _posts/2011-03-10-sample-post.md | 10 ++--- _posts/2013-05-22-sample-post-images.md | 18 ++++----- _posts/2013-06-25-video-post.md | 10 ++--- _posts/2013-08-16-code-highlighting-post.md | 26 ++++++------- _posts/2013-10-26-background-image.md | 4 +- theme-setup/index.md | 42 +++++++++------------ 6 files changed, 48 insertions(+), 62 deletions(-) diff --git a/_posts/2011-03-10-sample-post.md b/_posts/2011-03-10-sample-post.md index 6b4c236947..a075a8c919 100644 --- a/_posts/2011-03-10-sample-post.md +++ b/_posts/2011-03-10-sample-post.md @@ -70,15 +70,15 @@ HTML and CSS are our tools. Mauris a a ## Code Snippets -Syntax highlighting via Pygments +Syntax highlighting via Rouge -{% highlight css %} +```css #container { float: left; margin: 0 -240px 0 0; width: 100%; } -{% endhighlight %} +``` Non Pygments code example @@ -90,9 +90,9 @@ Non Pygments code example Make any link standout more when applying the `.btn` class. -{% highlight html %} +```html Success Button -{% endhighlight %} +```
Primary Button
Success Button
diff --git a/_posts/2013-05-22-sample-post-images.md b/_posts/2013-05-22-sample-post-images.md index 08700a560c..7c411202b0 100644 --- a/_posts/2013-05-22-sample-post-images.md +++ b/_posts/2013-05-22-sample-post-images.md @@ -20,13 +20,13 @@ Here are some examples of what a post with images might look like. If you want t Apply the `half` class like so to display two images side by side that share the same caption. -{% highlight html %} +```html
Caption describing these two images.
-{% endhighlight %} +``` And you'll get something that looks like this: @@ -42,14 +42,14 @@ And you'll get something that looks like this: Apply the `third` class like so to display three images side by side that share the same caption. -{% highlight html %} +```html
Caption describing these three images.
-{% endhighlight %} +``` And you'll get something that looks like this: @@ -71,16 +71,14 @@ and fill the block with any number of links to images. You can mix relative and Here is the block you might want to use: -{% highlight jinja %} -{% raw %} -{% capture images %} +```liquid +{% raw %}{% capture images %} /images/abstract-10.jpg /images/abstract-11.jpg http://upload.wikimedia.org/wikipedia/en/2/24/Lenna.png {% endcapture %} -{% include gallery images=images caption="Test images" cols=3 %} -{% endraw %} -{% endhighlight %} +{% include gallery images=images caption="Test images" cols=3 %}{% endraw %} +``` Parameters: diff --git a/_posts/2013-06-25-video-post.md b/_posts/2013-06-25-video-post.md index 0ea69a0354..9a0d217373 100644 --- a/_posts/2013-06-25-video-post.md +++ b/_posts/2013-06-25-video-post.md @@ -5,12 +5,10 @@ description: "Custom written post descriptions are the way to go... if you're no tags: [sample post, video] --- - + Video embeds are responsive and scale with the width of the main content block with the help of [FitVids](http://fitvidsjs.com/). -Not sure if this only effects Kramdown or if it's an issue with Markdown in general. But adding YouTube video embeds causes errors when building your Jekyll site. To fix add a space between the ` -{% endhighlight %} \ No newline at end of file +```html + +``` \ No newline at end of file diff --git a/_posts/2013-08-16-code-highlighting-post.md b/_posts/2013-08-16-code-highlighting-post.md index 66329f2947..ccf93da47c 100644 --- a/_posts/2013-08-16-code-highlighting-post.md +++ b/_posts/2013-08-16-code-highlighting-post.md @@ -2,7 +2,7 @@ layout: post title: Syntax Highlighting Post description: "Demo post displaying the various ways of highlighting code in Markdown." -modified: 2016-02-01 +modified: 2016-06-01T15:27:45-04:00 tags: [sample post, code, highlighting] image: feature: abstract-10.jpg @@ -18,28 +18,26 @@ Syntax highlighting is a feature that displays source code, in different colors To modify styling and highlight colors edit `/_sass/_syntax.scss`. -{% highlight css %} +```css #container { float: left; margin: 0 -240px 0 0; width: 100%; } -{% endhighlight %} +``` -{% highlight html %} -{% raw %} -{% endraw %} +``` -{% highlight ruby %} +```ruby module Jekyll class TagIndex < Page def initialize(site, base, dir, tag) @@ -57,21 +55,19 @@ module Jekyll end end end -{% endhighlight %} +``` ### Standard Code Block - {% raw %} - {% endraw %} ### Fenced Code Blocks diff --git a/_posts/2013-10-26-background-image.md b/_posts/2013-10-26-background-image.md index 5992f9d5e0..95d3c17d57 100644 --- a/_posts/2013-10-26-background-image.md +++ b/_posts/2013-10-26-background-image.md @@ -9,10 +9,10 @@ image: Here be a sample post with a custom background image. To utilize this "feature" just add the following YAML to a post's front matter. -{% highlight yaml %} +```yaml image: background: filename.png -{% endhighlight %} +``` This little bit of YAML makes the assumption that your background image asset is in the `/images` folder. If you place it somewhere else or are hotlinking from the web, just include the full http(s):// URL. Either way you should have a background image that is tiled. diff --git a/theme-setup/index.md b/theme-setup/index.md index 45073b5b13..43cb696b8c 100644 --- a/theme-setup/index.md +++ b/theme-setup/index.md @@ -46,17 +46,17 @@ The preferred method for running Jekyll is with `bundle exec`, but if you're wil > >However, this is unreliable and is the source of considerable pain. Even if it looks like it works, it may not work in the future or on another machine. -{% highlight text %} +```bash bundle exec jekyll build bundle exec jekyll serve -{% endhighlight %} +``` --- ## Folder Structure -{% highlight bash %} +```bash hpstr-jekyll-theme/ ├── _includes | ├── browser-upgrade.html # prompt to upgrade browser on < IE8 @@ -83,7 +83,7 @@ hpstr-jekyll-theme/ ├── posts/ # all posts ├── tags/ # all posts grouped by tag └── index.html # home page with pagination -{% endhighlight %} +``` --- @@ -95,17 +95,17 @@ Most of the variables found here are used in the .html files found in `_includes Create a [Disqus](http://disqus.com) account and change `disqus_shortname` in `_config.yml` to the Disqus *shortname* you just setup. By default comments appear on all post and pages if you assigned a shortname. To disable commenting on a post or page, add the following to its YAML Front Matter: -{% highlight yaml %} +```yaml comments: false -{% endhighlight %} +``` ### Social Share Links To disable Facebook, Twitter, and Google+ share links on a post or page, add the following to its front matter: -{% highlight yaml %} +```yaml share: false -{% endhighlight %} +``` ### Owner/Author Information @@ -119,13 +119,13 @@ Your Google Analytics ID goes here along with meta tags for [Google Webmaster To To add additional links in the drop down menu edit `_data/navigation.yml`. Use the following format to set the URL and title for as many links as you'd like. *External links will open in a new window.* -{% highlight yaml %} +```yaml - title: Portfolio url: /portfolio/ - title: Made Mistakes url: http://mademistakes.com -{% endhighlight %} +``` --- @@ -151,27 +151,27 @@ A good rule of thumb is to keep feature images nice and wide so you don't push t The two layouts make the assumption that the feature images live in the *images* folder. To add a feature image to a post or page just include the filename in the front matter like so. -{% highlight yaml %} +```yaml image: feature: feature-image-filename.jpg thumb: thumbnail-image.jpg #keep it square 200x200 px is good -{% endhighlight %} +``` If you want to apply attribution to a feature image use the following YAML front matter on posts or pages. Image credits appear directly below the feature image with a link back to the original source. -{% highlight yaml %} +```yaml image: feature: feature-image-filename.jpg credit: Michael Rose #name of the person or site you want to credit creditlink: http://mademistakes.com #url to their site or licensing -{% endhighlight %} +``` By default the `
` containing feature images is set to have a minimum height of 400px with CSS. Anything taller is hidden with an `overflow: hidden` declaration. You can customize the height of the homepage feature image and those appearing on posts/pages by modifying the following variables in `/_sass/_variables.scss`. -{% highlight sass %} +```scss $feature-image-height: 400px; // min 150px recommended $front-page-feature-image-height: 400px; // min 150px recommended -{% endhighlight %} +``` #### Post/Page Thumbnails for OG and Twitter Cards @@ -185,12 +185,6 @@ Here's an example of what a tweet to your site could look like if you activate T Video embeds are responsive and scale with the width of the main content block with the help of [FitVids](http://fitvidsjs.com/). -Not sure if this only effects Kramdown or if it's an issue with Markdown in general. But adding YouTube video embeds causes errors when building your Jekyll site. To fix add a space between the ` -{% endhighlight %} - ### Twitter Cards Twitter cards make it possible to attach images and post summaries to Tweets that link to your content. Summary Card meta tags have been added to `head.html` to support this, you just need to [validate and apply your domain](https://dev.twitter.com/docs/cards) to turn it on. @@ -209,9 +203,9 @@ For example if you wanted a red background instead of white you'd change `$bodyc To modify the site's JavaScript files I setup a Grunt build script to lint/concatenate/minify all scripts into `scripts.min.js`. [Install Node.js](http://nodejs.org/), then [install Grunt](http://gruntjs.com/getting-started), and then finally install the dependencies for the theme contained in `package.json`: -{% highlight bash %} +```bash npm install -{% endhighlight %} +``` From the theme's root, use `grunt` to concatenate JavaScript files and optimize `.jpg`, `.png` and `.svg` files in the `images/` folder.