Skip to content

Commit

Permalink
Improve layout.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Oct 23, 2014
1 parent 8b013c0 commit 5f5d24a
Show file tree
Hide file tree
Showing 28 changed files with 559 additions and 268 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
_output
_site
_/site
94 changes: 0 additions & 94 deletions Gemfile.lock

This file was deleted.

8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
all:
jekyll build
PORT := 3000

watch:
jekyll serve &
git ls-files | entr make
start:
env BUNDLE_GEMFILE=./_/Gemfile bundle exec jekyll serve --drafts --watch --port ${PORT}
File renamed without changes.
115 changes: 115 additions & 0 deletions _/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
GEM
remote: https://rubygems.org/
specs:
RedCloth (4.2.9)
activesupport (4.1.6)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
blankslate (2.1.2.4)
celluloid (0.15.2)
timers (~> 1.1.0)
classifier-reborn (2.0.1)
fast-stemmer (~> 1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.7.0)
colorator (0.1)
execjs (2.2.1)
fast-stemmer (1.0.2)
ffi (1.9.3)
gemoji (2.1.0)
github-pages (28)
RedCloth (= 4.2.9)
jekyll (= 2.4.0)
jekyll-coffeescript (= 1.0.0)
jekyll-mentions (= 0.1.3)
jekyll-redirect-from (= 0.6.2)
jekyll-sass-converter (= 1.2.0)
jekyll-sitemap (= 0.6.0)
jemoji (= 0.3.0)
kramdown (= 1.3.1)
liquid (= 2.6.1)
maruku (= 0.7.0)
pygments.rb (= 0.6.0)
rdiscount (= 2.1.7)
redcarpet (= 3.1.2)
html-pipeline (1.9.0)
activesupport (>= 2)
nokogiri (~> 1.4)
i18n (0.6.11)
jekyll (2.4.0)
classifier-reborn (~> 2.0)
colorator (~> 0.1)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 2.6.1)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-coffeescript (1.0.0)
coffee-script (~> 2.2)
jekyll-gist (1.1.0)
jekyll-mentions (0.1.3)
html-pipeline (~> 1.9.0)
jekyll (~> 2.0)
jekyll-paginate (1.0.0)
jekyll-redirect-from (0.6.2)
jekyll (~> 2.0)
jekyll-sass-converter (1.2.0)
sass (~> 3.2)
jekyll-sitemap (0.6.0)
jekyll-watch (1.1.1)
listen (~> 2.7)
jemoji (0.3.0)
gemoji (~> 2.0)
html-pipeline (~> 1.9)
jekyll (~> 2.0)
json (1.8.1)
kramdown (1.3.1)
liquid (2.6.1)
listen (2.7.9)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
maruku (0.7.0)
mercenary (0.3.4)
mini_portile (0.6.0)
minitest (5.4.2)
nokogiri (1.6.2.1)
mini_portile (= 0.6.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.8)
pygments.rb (0.6.0)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rdiscount (2.1.7)
redcarpet (3.1.2)
safe_yaml (1.0.1)
sass (3.2.19)
thread_safe (0.3.4)
timers (1.1.0)
toml (0.1.1)
parslet (~> 1.5.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
yajl-ruby (1.1.0)

PLATFORMS
ruby

DEPENDENCIES
github-pages
19 changes: 19 additions & 0 deletions _/layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% include head.html %}

<div class='blog-header'>
<div>
<h1><a href="/">{{ site.meta.name }}</a></h1>
</div>
</div>

<div class='article-item -cheatsheet'>
<div class='article-headline -cheatsheet'>
<h1>{{ page.title }}</h1>
</div>

<div class='article-content -cheatsheet'>
{{ content }}
</div>
</div>

{% include foot.html %}
21 changes: 21 additions & 0 deletions _/layouts/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
html_class: home
---
{% include head.html %}

<div class='blog-header'>
<div>
<h1><a href="/">{{ site.meta.name }}</a></h1>
</div>
</div>

<div class='pages-list'>
{% for page in site.pages %}
<a href=".{{ page.url }}">
<span class='title'>{{ page.title }}</span>
<span class='date'>{{ page.url }}</span>
</a>
{% endfor %}
</div>

{% include foot.html %}
Empty file added _/sass/.gitignore
Empty file.
21 changes: 21 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
# files
layouts: ./_/layouts
destination: ./_/site
sass:
sass_dir: ./_/sass

# Markdown
highlighter: pygments
markdown: kramdown
kramdown:
input: GFM
hard_wrap: false
parse_block_html: true
use_coderay: true

coderay:
coderay_line_numbers: nil
coderay_line_numbers_start: 1
coderay_tab_width: 4
coderay_bold_every: 10
coderay_css: class

defaults:
- scope:
path: ""
values:
layout: "default"
meta:
name: "Cheatsheets"
25 changes: 24 additions & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,30 @@
<head>
<meta charset="UTF-8" />
<title>{{ page.title }} cheatsheet</title>
<link href="assets/style.css" rel="stylesheet" />
<link href="http://ricostacruz.com/assets/article.css" rel="stylesheet" />
<style>
.article-content pre, .with-footnote pre , .panorama-section pre , .article-content > .panorama-section pre {
/*max-width: 900px; */
}
.article-content pre > code, .with-footnote pre > code, .panorama-section pre > code, .article-content > .panorama-section pre > code {
background: transparent;
overflow: visible;
border-left-width: 3px;
border-top: solid 1px #eee;
border-top-left-radius: 3px;
padding-bottom: 0;
font-size: 0.85em;
}

.article-headline h1:after {
content: '';
display: block;
width: 80px;
height: 1px;
background: #ddd;
margin: 40px auto;
}
</style>
</head>
<body>
<div class='all'>
13 changes: 0 additions & 13 deletions _layouts/default.html

This file was deleted.

16 changes: 0 additions & 16 deletions _layouts/home.html

This file was deleted.

29 changes: 21 additions & 8 deletions assets/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,28 @@
}
})();

/* unorphan */
(function () {
if (!window.JekyllEscape) return;
var tags = document.querySelectorAll('pre code, pre span');
var els = document.querySelectorAll('h1 a, h1, h2, p.brief-intro, .pull-quote');
for (var i = 0, len = els.length; i < len; i++) {
var el = els[i];
var last = el.lastChild;

for (var i=0, len=tags.length; i<len; i++) {
var tag = tags[i];
if (~tag.innerHTML.indexOf('{\\%'))
tag.innerHTML = tag.innerHTML.replace(/{\\%/g, '{%');
if (~tag.innerHTML.indexOf('{\\{'))
tag.innerHTML = tag.innerHTML.replace(/{\\{/g, '{{');
if (last && last.nodeType === 3) {
console.log('=>', last.nodeValue, last.nodeValue.replace(/\s+([^\s]+\s*)$/g, '\xA0$1'));
last.nodeValue = last.nodeValue.replace(/\s+([^\s]+\s*)$/g, '\xA0$1');
}
}
})();

/* loaded */
document.documentElement.className += ' loaded';

/* hljs */
(function () {
var codes = document.querySelectorAll('pre > code');
for (var i = 0, len = codes.length; i < len; i++) {
var block = codes[i];
hljs.highlightBlock(block);
}
})();
Loading

0 comments on commit 5f5d24a

Please sign in to comment.