Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Jekyll 3 and rouge crystal highlighter #67

Merged
merged 4 commits into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: ruby
rvm: 2.2.6
rvm: 2.5.1
sudo: false
cache:
directories:
Expand Down
13 changes: 5 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
source 'https://rubygems.org'

gem 'rake'

gem 'github-pages'
gem 'haml'
gem 'jekyll-assets'
gem 'less'
gem 'therubyracer'
gem 'uglifier'
gem 'jekyll'
gem 'jekyll-assets', '~> 2.4.0'
gem 'jekyll-timeago'
gem 'jekyll-seo-tag'
gem 'haml'
gem 'rouge', git: 'https://github.com/manastech/rouge.git', branch: 'crystal'
221 changes: 79 additions & 142 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,162 +1,99 @@
GIT
remote: https://github.com/manastech/rouge.git
revision: fb0ac75b5e28497baeff5df660f16e77591f8167
branch: crystal
specs:
rouge (3.2.1)

GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.6)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
colorator (0.1)
commonjs (0.2.7)
concurrent-ruby (1.0.4)
ethon (0.9.0)
ffi (>= 1.3.0)
execjs (2.6.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
fastimage (1.8.1)
addressable (~> 2.3, >= 2.3.5)
ffi (1.9.10)
gemoji (2.1.0)
github-pages (78)
github-pages-health-check (= 1.1.0)
jekyll (= 3.0.5)
jekyll-coffeescript (= 1.0.1)
jekyll-feed (= 0.5.1)
jekyll-gist (= 1.4.0)
jekyll-github-metadata (= 1.11.1)
jekyll-mentions (= 1.1.2)
jekyll-paginate (= 1.1.0)
jekyll-redirect-from (= 0.10.0)
jekyll-sass-converter (= 1.3.0)
jekyll-seo-tag (= 1.4.0)
jekyll-sitemap (= 0.10.0)
jemoji (= 0.6.2)
kramdown (= 1.10.0)
liquid (= 3.0.6)
listen (= 3.0.6)
mercenary (~> 0.3)
rouge (= 1.10.1)
terminal-table (~> 1.4)
github-pages-health-check (1.1.0)
addressable (~> 2.3)
net-dns (~> 0.8)
octokit (~> 4.0)
public_suffix (~> 1.4)
typhoeus (~> 0.7)
haml (4.0.7)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
concurrent-ruby (1.0.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
extras (0.3.0)
forwardable-extended (~> 2.5)
fastimage (2.1.3)
ffi (1.9.25)
forwardable-extended (2.6.0)
haml (5.0.4)
temple (>= 0.8.0)
tilt
html-pipeline (2.4.1)
activesupport (>= 2, < 5)
nokogiri (>= 1.4)
i18n (0.7.0)
jekyll (3.0.5)
colorator (~> 0.1)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.8.3)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
jekyll-watch (~> 2.0)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
rouge (~> 1.7)
pathutil (~> 0.9)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-assets (2.1.3)
fastimage (~> 1.8)
jekyll (~> 3.0)
sprockets (~> 3.3)
sprockets-helpers (~> 1.2)
tilt (~> 2.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-feed (0.5.1)
jekyll-gist (1.4.0)
octokit (~> 4.2)
jekyll-github-metadata (1.11.1)
octokit (~> 4.0)
jekyll-mentions (1.1.2)
html-pipeline (~> 2.3)
jekyll (~> 3.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.10.0)
jekyll (>= 2.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-seo-tag (1.4.0)
jekyll (~> 3.0)
jekyll-sitemap (0.10.0)
jekyll-timeago (0.9.2)
jekyll-watch (1.4.0)
listen (~> 3.0, < 3.1)
jemoji (0.6.2)
gemoji (~> 2.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0)
json (1.8.3)
kramdown (1.10.0)
less (2.6.0)
commonjs (~> 0.2.7)
libv8 (3.16.14.11)
liquid (3.0.6)
listen (3.0.6)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
jekyll-assets (2.4.0)
concurrent-ruby (~> 1.0)
extras (~> 0.2)
fastimage (~> 2.0, >= 1.8)
jekyll (~> 3.1, >= 3.0)
pathutil (>= 0.8)
rack (~> 1.6)
sprockets (~> 3.3, < 3.8)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-seo-tag (2.5.0)
jekyll (~> 3.3)
jekyll-timeago (0.11.0)
mini_i18n (~> 0.4.0)
jekyll-watch (2.0.0)
listen (~> 3.0)
kramdown (1.17.0)
liquid (4.0.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
mini_portile2 (2.0.0)
minitest (5.8.4)
multipart-post (2.0.0)
net-dns (0.8.0)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
public_suffix (1.5.3)
rack (2.0.1)
rake (10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
ref (2.0.0)
rouge (1.10.1)
mini_i18n (0.4.0)
pathutil (0.16.1)
forwardable-extended (~> 2.6)
public_suffix (3.0.3)
rack (1.6.10)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
ruby_dep (1.5.0)
safe_yaml (1.0.4)
sass (3.4.22)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)
sprockets (3.7.1)
sass (3.5.7)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-helpers (1.2.1)
sprockets (>= 2.2)
terminal-table (1.5.2)
therubyracer (0.12.2)
libv8 (~> 3.16.14.0)
ref
thread_safe (0.3.5)
tilt (2.0.1)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.0)
execjs (>= 0.3.0, < 3)
temple (0.8.0)
tilt (2.0.8)

PLATFORMS
ruby

DEPENDENCIES
github-pages
haml
jekyll-assets
jekyll
jekyll-assets (~> 2.4.0)
jekyll-seo-tag
jekyll-timeago
less
rake
therubyracer
uglifier
rouge!

BUNDLED WITH
1.11.2
1.16.4
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ twitter:
highlighter: rouge
markdown: kramdown
exclude: ["Gemfile", "Gemfile.lock", "Rakefile", "*.haml", "scripts/*.cr", "vendor", "docker-compose.yml"]
gems:
plugins:
- jekyll-seo-tag
- jekyll-assets
- jekyll-timeago
Expand Down
2 changes: 1 addition & 1 deletion _includes/sample_bindings.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% highlight ruby %}
{% highlight crystal %}
# Fragment of the BigInt implementation that uses GMP
@[Link("gmp")]
lib LibGMP
Expand Down
2 changes: 1 addition & 1 deletion _includes/sample_concurrency.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% highlight ruby %}
{% highlight crystal %}
channel = Channel(Int32).new
total_lines = 0
files = Dir.glob("*.txt")
Expand Down
2 changes: 1 addition & 1 deletion _includes/sample_macros.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% highlight ruby %}
{% highlight crystal %}
class Object
def has_instance_var?(name) : Bool
{% raw %}{{ @type.instance_vars.map &.name.stringify }}{% endraw %}.includes? name
Expand Down
2 changes: 1 addition & 1 deletion _includes/sample_null.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% highlight ruby %}
{% highlight crystal %}
if rand(2) > 0
my_string = "hello world"
end
Expand Down
2 changes: 1 addition & 1 deletion _includes/sample_server.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% highlight ruby %}
{% highlight crystal %}
# A very basic HTTP server
require "http/server"

Expand Down
2 changes: 1 addition & 1 deletion _includes/sample_type_system.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% highlight ruby %}
{% highlight crystal %}
def shout(x)
# Notice that both Int32 and String respond_to `to_s`
x.to_s.upcase
Expand Down
2 changes: 1 addition & 1 deletion _posts/2017-02-21-crystal-0.21.0-released.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ As any release it includes numerous bugfixes, cool features and performance impr

# Exciting Changes

* **(breaking-change)** The compiler now reuses previous macro run compilations so `{{ run(...) }}` is only re-run if the code changes
* **(breaking-change)** The compiler now reuses previous macro run compilations so `{% raw %}{{ run(...) }}{% endraw %}` is only re-run if the code changes
* **(breaking-change)** Spec now uses `it { ... }` instead of `assert { ... }`
* **(breaking-change)** `String` can now hold invalid UTF-8 byte sequences, and they produce a unicode replacement character when traversed. Also `\xHH` escape sequences are now supported.
* **(breaking-change)** `Zlib` was split into `Flate`, `Gzip` and `Zlib`
Expand Down
12 changes: 6 additions & 6 deletions _posts/2018-08-27-crystal-0.26.1-released.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ Thanks to some other fixes included in 0.26.0, and the amount of metaprogramming

To understand this change let’s suppose we have a the following type hierarchy: `Human < Mammal`, `Cat < Mammal`. And we have a `TalkTo` module defined as follows:

<div class="code_section">{% highlight ruby %}
<div class="code_section">{% highlight crystal %}
module TalkTo(T)
def talk_to(t : T)
puts "#{self} is talking to #{t}"
end
end
{% endhighlight ruby %}</div>
{% endhighlight crystal %}</div>

If we want to make all mammals be able to talk to each other then the following snippet will do:

<div class="code_section">{% highlight ruby %}
<div class="code_section">{% highlight crystal %}
abstract class Mammal
include TalkTo(self)
end
Expand All @@ -48,19 +48,19 @@ end
sabrina = Human.new
salem = Cat.new
hilda = Human.new
{% endhighlight ruby %}</div>
{% endhighlight crystal %}</div>

Any instance instance of mammal will have a `#talk_to(t : Mammal)` method. Hence `sabrina.talk_to(salem)` would compile.

But if we need a less magical world we would need to `include TalkTo(self)` in each of the classes that inherit Mammal. In order to add some programmer’s happiness, if we want to state that each concrete class should have a method `talk_to` accepting only instance of the same class, then we need some metaprogramming.

<div class="code_section">{% highlight ruby %}
<div class="code_section">{% highlight crystal %}
abstract class Mammal
macro inherited
include TalkTo({% raw %}{{@type}}{% endraw %})
end
end
{% endhighlight ruby %}</div>
{% endhighlight crystal %}</div>

With the last snippet `sabrina.talk_to(salem)` would not compile. But `sabrina.talk_to(hilda)` would.

Expand Down
2 changes: 1 addition & 1 deletion blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="row">
<div class="col s12">
<h2>Articles</h2>
{% assign articles = site.posts | where: "release_notes",nil %}
{% assign articles = site.posts | where_exp: "item","item.release_notes != true" %}
<div class='post-list'>
{% for post in articles %}
{% include blog_row.html post=post %}
Expand Down
2 changes: 1 addition & 1 deletion community/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
icon="mail_outline"
%}

{% capture events_ical_url %}https://calendar.google.com/calendar/ical/{{ site.google_calendar_id \| uri_escape }}/public/basic.ics{% endcapture %}
{% capture events_ical_url %}https://calendar.google.com/calendar/ical/{{ site.google_calendar_id | uri_escape }}/public/basic.ics{% endcapture %}

{% include community_row.html
title="Events"
Expand Down
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ version: '2'

services:
web:
image: ruby:2.2
image: ruby:2.5
working_dir: /src
command: /bin/bash -c "bundle install --jobs=3 && jekyll serve --host=0.0.0.0 --incremental"
command: /bin/bash -c "(bundle check || bundle install --jobs=3) && jekyll serve --host=0.0.0.0 --incremental --livereload"
ports:
- "4000:4000"
- "35729:35729"
volumes:
- .:/src
- bundle:/usr/local/bundle
Expand Down
Loading