Skip to content

Commit 644fa01

Browse files
committed
Switch to redcarpet markdown
1 parent b5796dc commit 644fa01

6 files changed

+16
-98
lines changed

_config.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ google_analytics_tracking_id: UA-177588-1
2828
#
2929
# Jekyll Settings
3030
#
31-
markdown: rdiscount
31+
markdown: redcarpet
3232
pygments: true
3333
permalink: /archive/:year/:month/:day/:title/
34-
rdiscount:
35-
extensions: [smart]
3634
paginate: 5
3735
paginate_path: "page/:num"
3836
category_dir: categories

_includes/head.html

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
<link rel="stylesheet" href="/css/code.css" type="text/css">
3232
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
3333
<script src="/js/slash.js" async></script>
34-
<script src="/js/highlight.pack.js"></script>
3534

3635
{% include google_analytics.html %}
3736
</head>

_posts/2013-12-09-preserving-disqus-comments-with-jekyll.markdown

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ In my last post, I showed how to preserve such a URL, but it's not quite exact.
1414

1515
Fortunately, Disqus allows you to set a [Disqus Identifier](http://help.disqus.com/customer/portal/articles/472099-what-is-a-disqus-identifier-) that it uses to look up a page's comment thread. For example, if you view source [on a migrated post of mine](http://haacked.com/archive/2013/10/28/code-review-like-you-mean-it.aspx/), you'll see something like this:
1616

17-
<pre><code>
18-
&lt;script type="text/javascript">
17+
```html
18+
<script type="text/javascript">
1919
var disqus_shortname = 'haacked';
2020
2121
var disqus_identifier = '18902';
2222
var disqus_url = 'http://haacked.com/archive/2013/10/28/code-review-like-you-mean-it.aspx/';
2323
2424
// ...omitted
25-
&lt;/script>
26-
</code></pre>
25+
</script>
26+
```
2727

2828
The `disqus_identifier` can pretty much be any string. Subtext, my old blog engine, set this to the database generated ID of the blog post. So to keep my post comments, I just needed to preserve that as I migrated over to Jekyll.
2929

3030
So what I did was add my own field to my migrated Jekyll posts. You can see an example by [clicking edit on one of the older posts](https://github.com/Haacked/haacked.com/edit/gh-pages/_posts/2013-10-28-code-review-like-you-mean-it.aspx.markdown). Here's the Yaml frontmatter for that post.
3131

32-
```
32+
```yaml
3333
---
3434
layout: post
3535
title: "Code Review Like You Mean It"
@@ -45,10 +45,10 @@ This adds a new `disqus_identifier` field that can be accessed in the Jekyll tem
4545
But here's the gist of that gist:
4646

4747
{% raw %}
48-
<pre><code>
48+
```js
4949
var disqus_identifier = '{% if page.disqus_identifier %}{{ page.disqus_identifier}}{% else %}{{ site.url }}{{ page.url }}{% endif %}';
5050
var disqus_url = '{{ site.url }}{{ page.url }}';
51-
</code></pre>
51+
```
5252
{% endraw %}
5353

5454
If your current blog engine doesn't explicitly set a `disqus_identifier`, the identifier is the exact URL where the comments are hosted. So you could set the `disqus_identifier` to that for your old posts and leave it empty for your new ones.

_posts/archived/2009-09-25-html-encoding-code-nuggets.aspx.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ One great new feature being introduced in ASP.NET 4 is a new code block
2020
team*) syntax which provides a convenient means to HTML encode output in
2121
an ASPX page or view.
2222

23-
```aspx
23+
```html
2424
<%: CodeExpression %>
2525
```
2626

@@ -31,7 +31,7 @@ view. Suppose you have a form which allows the user to submit their
3131
first and last name. After submitting the form, the same view is used to
3232
display the submitted values.
3333

34-
```aspx-cs
34+
```html
3535
First Name: <%: Model.FirstName %>
3636
Last Name: <%: Model.FirstName %>
3737

css/code.css

+6-84
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* Styles for C# Code Format http://www.manoli.net/csharpformat/format.aspx */
22

3-
.csharpcode .rem { color: #008000; }
4-
.csharpcode .kwrd { color: #0000ff; }
5-
.csharpcode .str { color: #a31515; }
3+
.csharpcode .rem, .highlight .c1, .highlight .cs, .highlight .c, .highlight .cm, .highlight .nn { color: #008000; }
4+
.csharpcode .kwrd, .highlight .kt, .highlight .k, .highlight .kd { color: #0000ff; }
5+
.csharpcode .str, .highlight .s, .highlight .s1 { color: #a31515; }
66
.csharpcode .op { color: #0000c0; }
77
.csharpcode .preproc { color: #cc6633; }
88
.csharpcode .asp { background-color: #ffff00; }
99
.csharpcode .html { color: #800000; }
10-
.csharpcode .attr { color: #ff0000; }
10+
.csharpcode .attr, .highlight .na { color: #ff0000; }
1111
.csharpcode .alt
1212
{
1313
background-color: #f4f4f4;
@@ -36,83 +36,5 @@ pre code {
3636
word-wrap: break-word;
3737
}
3838

39-
pre .comment,
40-
pre .annotation,
41-
pre .template_comment,
42-
pre .diff .header,
43-
pre .chunk,
44-
pre .apache .cbracket {
45-
color: rgb(0, 128, 0);
46-
}
47-
48-
pre .keyword,
49-
pre .id,
50-
pre .built_in,
51-
pre .smalltalk .class,
52-
pre .winutils,
53-
pre .bash .variable,
54-
pre .tex .command,
55-
pre .request,
56-
pre .status,
57-
pre .nginx .title,
58-
pre .xml .tag,
59-
pre .xml .tag .value {
60-
color: rgb(0, 0, 255);
61-
}
62-
63-
pre .string,
64-
pre .title,
65-
pre .parent,
66-
pre .tag .value,
67-
pre .rules .value,
68-
pre .rules .value .number,
69-
pre .ruby .symbol,
70-
pre .ruby .symbol .string,
71-
pre .aggregate,
72-
pre .template_tag,
73-
pre .django .variable,
74-
pre .addition,
75-
pre .flow,
76-
pre .stream,
77-
pre .apache .tag,
78-
pre .date,
79-
pre .tex .formula,
80-
pre .coffeescript .attribute {
81-
color: #006080;
82-
}
83-
84-
pre .ruby .string,
85-
pre .decorator,
86-
pre .filter .argument,
87-
pre .localvars,
88-
pre .array,
89-
pre .attr_selector,
90-
pre .pseudo,
91-
pre .pi,
92-
pre .doctype,
93-
pre .deletion,
94-
pre .envvar,
95-
pre .shebang,
96-
pre .preprocessor,
97-
pre .pragma,
98-
pre .userType,
99-
pre .apache .sqbracket,
100-
pre .nginx .built_in,
101-
pre .tex .special,
102-
pre .prompt {
103-
color: rgb(43, 145, 175);
104-
}
105-
106-
pre .phpdoc,
107-
pre .javadoc,
108-
pre .xmlDocTag {
109-
color: rgb(128, 128, 128);
110-
}
111-
112-
pre .vhdl .typename { font-weight: bold; }
113-
pre .vhdl .string { color: #666666; }
114-
pre .vhdl .literal { color: rgb(163, 21, 21); }
115-
pre .vhdl .attribute { color: #00B0E8; }
116-
117-
pre .xml .attribute { color: rgb(255, 0, 0); }
118-
39+
.highlight .m { color: #009999 } /* Literal Number */
40+
.highlight .o, .highlight .p, .highlight .p-indicator, .highlight .nv { color: #666666 } /* Operator */

0 commit comments

Comments
 (0)