-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a few website features. (#366)
- Loading branch information
Showing
5 changed files
with
101 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
_site | ||
.sass-cache | ||
build | ||
.firebaserc | ||
|
||
# Dart ignores. | ||
.packages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<div class="row"> | ||
<div class="row-fluid"> | ||
|
||
<!-- PREV --> | ||
<div class="col-md-4"> | ||
{% if page.prev-page %} | ||
<a href="{{ page.prev-page }}"><i class="fa fa-arrow-left"> </i> {{ page.prev-page-title }}</a> | ||
{% endif %} | ||
</div> | ||
|
||
<!-- NEXT --> | ||
<div class="col-md-8"> | ||
{% if page.next-page %} | ||
<a href="{{ page.next-page }}" class="pull-right">{{ page.next-page-title }} <i class="fa fa-arrow-right"></i></a> | ||
{% endif %} | ||
</div> | ||
<p> </p> | ||
|
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
layout: page | ||
--- | ||
|
||
{% if page.points %} | ||
<div class="panel" background-color:"0xEEEEEE"> | ||
<h4>What's the point?</h4> | ||
<ul> | ||
{% for point in page.points %} | ||
<li>{{ point }}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endif %} | ||
{{ content }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | ||
# for details. All rights reserved. Use of this source code is governed by a | ||
# BSD-style license that can be found in the LICENSE file. | ||
|
||
require 'cgi' | ||
|
||
module Prettify | ||
|
||
# Wraps code with tags for Prettify. | ||
# | ||
# Example usage: | ||
# | ||
# {% prettify dart %} | ||
# // dart code here | ||
# {% endprettify %} | ||
# | ||
# The language name can be ommitted if it is not known. | ||
class Tag < Liquid::Block | ||
|
||
Syntax = /\s*(\w+)\s*/o | ||
|
||
def initialize(tag_name, markup, tokens) | ||
super | ||
if markup =~ Syntax | ||
@lang = $1 | ||
end | ||
end | ||
|
||
def render(context) | ||
# out = '<pre class="prettyprint linenums' | ||
out = '<pre class="prettyprint' | ||
unless @lang.nil? | ||
out += ' lang-' + @lang | ||
end | ||
out += '">' | ||
|
||
contents = super #.strip | ||
contents = CGI::escapeHTML(contents) | ||
|
||
contents.gsub!('[[strike]]', '<code class="nocode strike">') | ||
contents.gsub!('[[/strike]]', '</code>') | ||
|
||
contents.gsub!('[[highlight]]', '<code class="nocode highlight">') | ||
contents.gsub!('[[/highlight]]', '</code>') | ||
|
||
contents.gsub!('[[note]]', '<code class="nocode note">') | ||
contents.gsub!('[[/note]]', '</code>') | ||
|
||
contents.gsub!('[[red]]', '<code class="nocode red">') | ||
contents.gsub!('[[/red]]', '</code>') | ||
|
||
out += contents + "</pre>" | ||
end | ||
|
||
end | ||
end | ||
|
||
Liquid::Template.register_tag('prettify', Prettify::Tag) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters