Skip to content

Commit d1cd52c

Browse files
committed
Syntax highlighting.
1 parent b183842 commit d1cd52c

File tree

5 files changed

+221
-161
lines changed

5 files changed

+221
-161
lines changed

_config.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ google_analytics:
2323

2424
# Links used for your social icons
2525
links:
26-
github: https://github.com/YOUR-USERNAME
27-
twitter: https://twitter.com/YOUR-USERNAME
28-
#linkedin: https://linkedin.com/in/YOUR-USERNAME
26+
github: your-username
27+
twitter: your-username
2928

3029
markdown: rdiscount
30+
pygments: true
31+
permalink: /:title
3132

3233
# Exclude these files from your production _site
3334
exclude:

_layouts/default.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@
3737

3838
<footer class="footer">
3939
<ul>
40-
<li><a href="http://github.com/{{ site.github }}">@{{ site.github }} on GitHub</a></li>
41-
<li><a href="http://twitter.com/{{ site.twitter }}">@{{ site.twitter }} on Twitter</a></li>
42-
<li><a href="http://instagram.com/{{ site.instagram }}">@{{ site.instagram }} on Instagram</a></li>
43-
<li><a href="http://dribbble.com/{{ site.dribbble }}">@{{ site.dribbble }} on Dribbble</a></li>
40+
<li><a href="http://github.com/{{ site.links.github }}">{{ site.links.github }} on GitHub</a></li>
41+
<li><a href="http://twitter.com/{{ site.links.twitter }}">{{ site.links.twitter }} on Twitter</a></li>
4442
</ul>
4543
</footer>
4644

_posts/2014-2-2-Markdown-Cheatsheet.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ An image, located within /images
2222
- alternative syntax 1
2323
+ alternative syntax 2
2424
- an indented list item
25-
25+
2626
1. An
2727
2. ordered
2828
3. list
@@ -36,20 +36,21 @@ Inline markup styles:
3636
> Blockquote
3737
>> Nested Blockquote
3838
39-
Code:
40-
41-
// Code is just text indented a bit
42-
which(is_easy) to_remember();
43-
44-
~~~
45-
46-
// Markdown extra adds un-indented code blocks too
47-
48-
if (this_is_more_code == true && !indented) {
49-
// tild wrapped code blocks, also not indented
50-
}
39+
Syntax highlighting can be used by wrapping your code in a liquid tag like so:
40+
41+
{{ "{% highlight javascript " }}%}
42+
/* Some pointless Javascript */
43+
var rawr = ["r", "a", "w", "r"];
44+
{{ "{% endhighlight " }}%}
45+
46+
creates...
47+
48+
{% highlight javascript %}
5149

52-
~~~
50+
/* Some pointless Javascript */
51+
var rawr = ["r", "a", "w", "r"];
52+
53+
{% endhighlight %}
5354

5455
Use two trailing spaces
5556
on the right

scss/_highlights.scss

Lines changed: 87 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,87 @@
1-
.highlight { background: #ffffff; }
2-
.highlight .c { color: #999988; font-style: italic } /* Comment */
3-
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
4-
.highlight .k { font-weight: bold } /* Keyword */
5-
.highlight .o { font-weight: bold } /* Operator */
6-
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
7-
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
8-
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
9-
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
10-
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
11-
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
12-
.highlight .ge { font-style: italic } /* Generic.Emph */
13-
.highlight .gr { color: #aa0000 } /* Generic.Error */
14-
.highlight .gh { color: #999999 } /* Generic.Heading */
15-
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
16-
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
17-
.highlight .go { color: #888888 } /* Generic.Output */
18-
.highlight .gp { color: #555555 } /* Generic.Prompt */
19-
.highlight .gs { font-weight: bold } /* Generic.Strong */
20-
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
21-
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
22-
.highlight .kc { font-weight: bold } /* Keyword.Constant */
23-
.highlight .kd { font-weight: bold } /* Keyword.Declaration */
24-
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
25-
.highlight .kr { font-weight: bold } /* Keyword.Reserved */
26-
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
27-
.highlight .m { color: #009999 } /* Literal.Number */
28-
.highlight .s { color: #d14 } /* Literal.String */
29-
.highlight .na { color: #008080 } /* Name.Attribute */
30-
.highlight .nb { color: #0086B3 } /* Name.Builtin */
31-
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
32-
.highlight .no { color: #008080 } /* Name.Constant */
33-
.highlight .ni { color: #800080 } /* Name.Entity */
34-
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
35-
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
36-
.highlight .nn { color: #555555 } /* Name.Namespace */
37-
.highlight .nt { color: #000080 } /* Name.Tag */
38-
.highlight .nv { color: #008080 } /* Name.Variable */
39-
.highlight .ow { font-weight: bold } /* Operator.Word */
40-
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
41-
.highlight .mf { color: #009999 } /* Literal.Number.Float */
42-
.highlight .mh { color: #009999 } /* Literal.Number.Hex */
43-
.highlight .mi { color: #009999 } /* Literal.Number.Integer */
44-
.highlight .mo { color: #009999 } /* Literal.Number.Oct */
45-
.highlight .sb { color: #d14 } /* Literal.String.Backtick */
46-
.highlight .sc { color: #d14 } /* Literal.String.Char */
47-
.highlight .sd { color: #d14 } /* Literal.String.Doc */
48-
.highlight .s2 { color: #d14 } /* Literal.String.Double */
49-
.highlight .se { color: #d14 } /* Literal.String.Escape */
50-
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
51-
.highlight .si { color: #d14 } /* Literal.String.Interpol */
52-
.highlight .sx { color: #d14 } /* Literal.String.Other */
53-
.highlight .sr { color: #009926 } /* Literal.String.Regex */
54-
.highlight .s1 { color: #d14 } /* Literal.String.Single */
55-
.highlight .ss { color: #990073 } /* Literal.String.Symbol */
56-
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
57-
.highlight .vc { color: #008080 } /* Name.Variable.Class */
58-
.highlight .vg { color: #008080 } /* Name.Variable.Global */
59-
.highlight .vi { color: #008080 } /* Name.Variable.Instance */
60-
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
1+
.highlight {
2+
background-color: $darkerGray;
3+
padding: 5px 10px;
4+
margin: 20px 0;
5+
}
6+
7+
.highlight pre {
8+
// overflow: scroll; // Prefer no word wrap? Uncomment this line and comment out the 2 lines below.
9+
word-break: break-all;
10+
word-wrap: break-word;
11+
}
12+
13+
code {
14+
font-family: 'Courier', monospace;
15+
font-size: 14px;
16+
}
17+
18+
// Solarized Light Pygments
19+
// Thanks https://gist.github.com/edwardhotchkiss/2005058
20+
.highlight .c, .highlight .c1 { color: #586E75 } /* Comment */
21+
.highlight .err { color: #93A1A1 } /* Error */
22+
.highlight .g { color: #93A1A1 } /* Generic */
23+
.highlight .k { color: #859900 } /* Keyword */
24+
.highlight .l { color: #93A1A1 } /* Literal */
25+
.highlight .n { color: #93A1A1 } /* Name */
26+
.highlight .o { color: #859900 } /* Operator */
27+
.highlight .x { color: #CB4B16 } /* Other */
28+
.highlight .p { color: #93A1A1 } /* Punctuation */
29+
.highlight .cm { color: #586E75 } /* Comment.Multiline */
30+
.highlight .cp { color: #859900 } /* Comment.Preproc */
31+
.highlight .c1 { color: #586E75 } /* Comment.Single */
32+
.highlight .cs { color: #859900 } /* Comment.Special */
33+
.highlight .gd { color: #2AA198 } /* Generic.Deleted */
34+
.highlight .ge { color: #93A1A1; font-style: italic } /* Generic.Emph */
35+
.highlight .gr { color: #DC322F } /* Generic.Error */
36+
.highlight .gh { color: #CB4B16 } /* Generic.Heading */
37+
.highlight .gi { color: #859900 } /* Generic.Inserted */
38+
.highlight .go { color: #93A1A1 } /* Generic.Output */
39+
.highlight .gp { color: #93A1A1 } /* Generic.Prompt */
40+
.highlight .gs { color: #93A1A1; font-weight: bold } /* Generic.Strong */
41+
.highlight .gu { color: #CB4B16 } /* Generic.Subheading */
42+
.highlight .gt { color: #93A1A1 } /* Generic.Traceback */
43+
.highlight .kc { color: #CB4B16 } /* Keyword.Constant */
44+
.highlight .kd { color: #268BD2 } /* Keyword.Declaration */
45+
.highlight .kn { color: #859900 } /* Keyword.Namespace */
46+
.highlight .kp { color: #859900 } /* Keyword.Pseudo */
47+
.highlight .kr { color: #268BD2 } /* Keyword.Reserved */
48+
.highlight .kt { color: #DC322F } /* Keyword.Type */
49+
.highlight .ld { color: #93A1A1 } /* Literal.Date */
50+
.highlight .m { color: #2AA198 } /* Literal.Number */
51+
.highlight .s { color: #2AA198 } /* Literal.String */
52+
.highlight .na { color: #93A1A1 } /* Name.Attribute */
53+
.highlight .nb { color: #B58900 } /* Name.Builtin */
54+
.highlight .nc { color: #268BD2 } /* Name.Class */
55+
.highlight .no { color: #CB4B16 } /* Name.Constant */
56+
.highlight .nd { color: #268BD2 } /* Name.Decorator */
57+
.highlight .ni { color: #CB4B16 } /* Name.Entity */
58+
.highlight .ne { color: #CB4B16 } /* Name.Exception */
59+
.highlight .nf { color: #268BD2 } /* Name.Function */
60+
.highlight .nl { color: #93A1A1 } /* Name.Label */
61+
.highlight .nn { color: #93A1A1 } /* Name.Namespace */
62+
.highlight .nx { color: #555 } /* Name.Other */
63+
.highlight .py { color: #93A1A1 } /* Name.Property */
64+
.highlight .nt { color: #268BD2 } /* Name.Tag */
65+
.highlight .nv { color: #268BD2 } /* Name.Variable */
66+
.highlight .ow { color: #859900 } /* Operator.Word */
67+
.highlight .w { color: #93A1A1 } /* Text.Whitespace */
68+
.highlight .mf { color: #2AA198 } /* Literal.Number.Float */
69+
.highlight .mh { color: #2AA198 } /* Literal.Number.Hex */
70+
.highlight .mi { color: #2AA198 } /* Literal.Number.Integer */
71+
.highlight .mo { color: #2AA198 } /* Literal.Number.Oct */
72+
.highlight .sb { color: #586E75 } /* Literal.String.Backtick */
73+
.highlight .sc { color: #2AA198 } /* Literal.String.Char */
74+
.highlight .sd { color: #93A1A1 } /* Literal.String.Doc */
75+
.highlight .s2 { color: #2AA198 } /* Literal.String.Double */
76+
.highlight .se { color: #CB4B16 } /* Literal.String.Escape */
77+
.highlight .sh { color: #93A1A1 } /* Literal.String.Heredoc */
78+
.highlight .si { color: #2AA198 } /* Literal.String.Interpol */
79+
.highlight .sx { color: #2AA198 } /* Literal.String.Other */
80+
.highlight .sr { color: #DC322F } /* Literal.String.Regex */
81+
.highlight .s1 { color: #2AA198 } /* Literal.String.Single */
82+
.highlight .ss { color: #2AA198 } /* Literal.String.Symbol */
83+
.highlight .bp { color: #268BD2 } /* Name.Builtin.Pseudo */
84+
.highlight .vc { color: #268BD2 } /* Name.Variable.Class */
85+
.highlight .vg { color: #268BD2 } /* Name.Variable.Global */
86+
.highlight .vi { color: #268BD2 } /* Name.Variable.Instance */
87+
.highlight .il { color: #2AA198 } /* Literal.Number.Integer.Long */

0 commit comments

Comments
 (0)