Skip to content
This repository has been archived by the owner on Aug 28, 2019. It is now read-only.

Commit

Permalink
Replace {% highlight %} tags with GitHub Flavored Markdown backticks
Browse files Browse the repository at this point in the history
  • Loading branch information
mmistakes committed Jun 1, 2016
1 parent a4fd821 commit 9c9ca9a
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 62 deletions.
10 changes: 5 additions & 5 deletions _posts/2011-03-10-sample-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ HTML and <abbr title="cascading stylesheets">CSS<abbr> 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

Expand All @@ -90,9 +90,9 @@ Non Pygments code example

Make any link standout more when applying the `.btn` class.

{% highlight html %}
```html
<a href="#" class="btn btn-success">Success Button</a>
{% endhighlight %}
```

<div markdown="0"><a href="#" class="btn">Primary Button</a></div>
<div markdown="0"><a href="#" class="btn btn-success">Success Button</a></div>
Expand Down
18 changes: 8 additions & 10 deletions _posts/2013-05-22-sample-post-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<figure class="half">
<img src="/images/image-filename-1.jpg" alt="">
<img src="/images/image-filename-2.jpg" alt="">
<figcaption>Caption describing these two images.</figcaption>
</figure>
{% endhighlight %}
```

And you'll get something that looks like this:

Expand All @@ -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
<figure class="third">
<a href="http://placehold.it/1200x600.jpg"><img src="http://placehold.it/600x300.jpg" alt=""></a>
<a href="http://placehold.it/1200x600.jpg"><img src="http://placehold.it/600x300.jpg" alt=""></a>
<a href="http://placehold.it/1200x600.jpg"><img src="http://placehold.it/600x300.jpg" alt=""></a>
<figcaption>Caption describing these three images.</figcaption>
</figure>
{% endhighlight %}
```

And you'll get something that looks like this:

Expand All @@ -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:

Expand Down
10 changes: 4 additions & 6 deletions _posts/2013-06-25-video-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ description: "Custom written post descriptions are the way to go... if you're no
tags: [sample post, video]
---

<iframe width="560" height="315" src="//www.youtube.com/embed/SU3kYxJmWuQ" frameborder="0"> </iframe>
<iframe width="560" height="315" src="//www.youtube.com/embed/SU3kYxJmWuQ" frameborder="0"></iframe>

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 `<iframe>` tags and remove `allowfullscreen`. Example below:

{% highlight html %}
<iframe width="560" height="315" src="//www.youtube.com/embed/SU3kYxJmWuQ" frameborder="0"> </iframe>
{% endhighlight %}
```html
<iframe width="560" height="315" src="//www.youtube.com/embed/SU3kYxJmWuQ" frameborder="0"></iframe>
```
26 changes: 11 additions & 15 deletions _posts/2013-08-16-code-highlighting-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 %}
<nav class="pagination" role="navigation">
```html
{% raw %}<nav class="pagination" role="navigation">
{% if page.previous %}
<a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a>
{% endif %}
{% if page.next %}
<a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a>
{% endif %}
</nav><!-- /.pagination -->
{% endraw %}
{% endhighlight %}
</nav><!-- /.pagination -->{% endraw %}
```

{% highlight ruby %}
```ruby
module Jekyll
class TagIndex < Page
def initialize(site, base, dir, tag)
Expand All @@ -57,21 +55,19 @@ module Jekyll
end
end
end
{% endhighlight %}
```


### Standard Code Block

{% raw %}
<nav class="pagination" role="navigation">
{% raw %}<nav class="pagination" role="navigation">
{% if page.previous %}
<a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a>
{% endif %}
{% if page.next %}
<a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a>
{% endif %}
</nav><!-- /.pagination -->
{% endraw %}
</nav><!-- /.pagination -->{% endraw %}


### Fenced Code Blocks
Expand Down
4 changes: 2 additions & 2 deletions _posts/2013-10-26-background-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
42 changes: 18 additions & 24 deletions theme-setup/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -83,7 +83,7 @@ hpstr-jekyll-theme/
├── posts/ # all posts
├── tags/ # all posts grouped by tag
└── index.html # home page with pagination
{% endhighlight %}
```

---

Expand All @@ -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
Expand All @@ -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 %}
```

---

Expand All @@ -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 `<div>` 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

Expand All @@ -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 `<iframe>` tags and remove `allowfullscreen`. Example below:

{% highlight html %}
<iframe width="560" height="315" src="http://www.youtube.com/embed/PWf4WUoMXwg" frameborder="0"> </iframe>
{% 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.
Expand All @@ -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.

Expand Down

0 comments on commit 9c9ca9a

Please sign in to comment.