Skip to content

Commit a90f575

Browse files
committed
add jekyll components
1 parent b43d418 commit a90f575

22 files changed

+711
-106
lines changed

_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
permalink: pretty
2+
markdown: kramdown
3+
timezone: America/Los_Angeles
4+
future: true
5+
url: https://docs-next.witheve.com

_includes/test.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: default
3+
title: "woot"
4+
---
5+
6+
#this is a test
7+
This is some crazy text
8+

_layouts/default.html

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Eve</title>
5+
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=10.0; user-scalable=1;" />
6+
<link rel="stylesheet" type="text/css" href="{{ site.url }}/css/blog.css" />
7+
<link rel="stylesheet" type="text/css" href="{{ site.url }}/css/syntax.css" />
8+
<link rel="icon" type="image/png" href="/blog/images/icon.png">
9+
<link rel="alternate" type="application/atom+xml" title="Eve Programming Language" href="/atom.xml" />
10+
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,700' rel='stylesheet' type='text/css'>
11+
<meta name="Description" content="This is the development blog of the Eve programming language">
12+
</head>
13+
<body>
14+
15+
<div class="layer-wrapper header-wrapper">
16+
<header class="layer">
17+
<a href="http://witheve.com">
18+
<div class="logo">
19+
<img src="https://witheve.github.io/assets/images/logo_square.png" />
20+
<h1><img alt="EVE" src="http://docs.witheve.com/images/eve.svg" /></h1>
21+
</div>
22+
</a>
23+
<div class="flex-spacer"></div>
24+
<nav>
25+
<a class="btn rounded cta secondary play-cta" href="http://play.witheve.com">Play</a>
26+
27+
<a href="{{ site.url }}">Blog</a>
28+
<a href="http://docs.witheve.com">Docs</a>
29+
<a href="https://groups.google.com/forum/#!forum/eve-talk">Community</a>
30+
</nav>
31+
</header>
32+
</div>
33+
34+
35+
<main class="main layer-wrapper">
36+
<div class="toplayer">
37+
38+
<div class="drawer">
39+
<div class="wrapper">
40+
<a href="https://cmontella.github.io/blog/archive/">Archive</a>
41+
</div>
42+
</div>
43+
44+
45+
<article class="article">
46+
<div class="wrapper">
47+
{{ content }}
48+
</div>
49+
</article>
50+
</div>
51+
</main>
52+
53+
<script>
54+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
55+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
56+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
57+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
58+
59+
ga('create', 'UA-36105397-2', 'auto');
60+
ga('send', 'pageview');
61+
62+
</script>
63+
</body>
64+
</head>
65+
</html>

_layouts/post.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
layout: default
3+
---
4+
5+
<div id="blogposts">
6+
<div class="post" id="{{page.link}}">
7+
<h1>{{page.title}}</h1>
8+
<p class="date">{{page.author}}&nbsp;-&nbsp;{{page.date | date_to_string }}</p>
9+
{{ content }}
10+
</div>
11+
12+
{% if site.related_posts.first %}
13+
<div id="related">
14+
<h3>Related</h3>
15+
<ul class="posts">
16+
{% for post in site.related_posts limit:3 %}
17+
<li><a href="{{ site.url}}{{ post.url }}"><span>{{ post.title }}</span></a></li>
18+
{% endfor %}
19+
</ul>
20+
</div>
21+
{% endif %}
22+
</div>

_layouts/specpost.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: default
3+
---
4+
<div id="post">
5+
{{ content }}
6+
</div>
7+
8+
{% if site.related_posts.first %}
9+
<div id="related">
10+
<h3>Related Posts</h3>
11+
<ul class="posts">
12+
{% for post in site.related_posts limit:3 %}
13+
<li><a href="{{ post.url }}"><span>{{ post.date | date_to_string }}</span> - {{ post.title }}</a></li>
14+
{% endfor %}
15+
</ul>
16+
</div>
17+
{% endif %}
18+

_layouts/tutorial.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
layout: default
3+
---
4+
<div id="tutorial">
5+
<h1><a href="{{page.url}}">{{page.title}}</a></h1>
6+
{{ content }}
7+
</div>

_plugins/redcarpet2_markdown.rb

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
require 'fileutils'
2+
require 'digest/md5'
3+
require 'redcarpet'
4+
require 'albino'
5+
6+
PYGMENTS_CACHE_DIR = File.expand_path('../../_cache', __FILE__)
7+
FileUtils.mkdir_p(PYGMENTS_CACHE_DIR)
8+
9+
class Redcarpet2Markdown < Redcarpet::Render::HTML
10+
def block_code(code, lang)
11+
lang = lang || "text"
12+
path = File.join(PYGMENTS_CACHE_DIR, "#{lang}-#{Digest::MD5.hexdigest code}.html")
13+
cache(path) do
14+
colorized = Albino.colorize(code, lang.downcase)
15+
add_code_tags(colorized, lang)
16+
end
17+
end
18+
19+
def add_code_tags(code, lang)
20+
code.sub(/<pre>/, "<pre><code class=\"#{lang}\">").
21+
sub(/<\/pre>/, "</code></pre>")
22+
end
23+
24+
def cache(path)
25+
if File.exist?(path)
26+
File.read(path)
27+
else
28+
content = yield
29+
File.open(path, 'w') {|f| f.print(content) }
30+
content
31+
end
32+
end
33+
end
34+
35+
class Jekyll::MarkdownConverter
36+
def extensions
37+
Hash[ *@config['redcarpet']['extensions'].map {|e| [e.to_sym, true] }.flatten ]
38+
end
39+
40+
def markdown
41+
@markdown ||= Redcarpet::Markdown.new(Redcarpet2Markdown.new(extensions), extensions)
42+
end
43+
44+
def convert(content)
45+
return super unless @config['markdown'] == 'redcarpet2'
46+
markdown.render(content)
47+
end
48+
end

0 commit comments

Comments
 (0)