├── .gitignore ├── Gemfile ├── _layouts ├── page.html ├── post.html └── default.html ├── images ├── lambda.png ├── lambda-xl.png ├── screenshot.png ├── github-repo.png └── github-repository.png ├── about.md ├── 404.md ├── _includes ├── post_footer.html ├── disqus.html ├── post.html ├── header.html ├── footer.html └── head.html ├── index.html ├── _config.yml ├── _posts └── 2014-09-18-example-post.md ├── README.md ├── feed.xml ├── Gemfile.lock ├── css ├── syntax.css ├── lambda.css └── main.css ├── LICENSE └── Rakefile /.gitignore: -------------------------------------------------------------------------------- 1 | _site/ 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'github-pages' -------------------------------------------------------------------------------- /_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | {% include post.html %} -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | {% include post.html %} -------------------------------------------------------------------------------- /images/lambda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lauris/jekyll-lambda/HEAD/images/lambda.png -------------------------------------------------------------------------------- /images/lambda-xl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lauris/jekyll-lambda/HEAD/images/lambda-xl.png -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lauris/jekyll-lambda/HEAD/images/screenshot.png -------------------------------------------------------------------------------- /images/github-repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lauris/jekyll-lambda/HEAD/images/github-repo.png -------------------------------------------------------------------------------- /images/github-repository.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lauris/jekyll-lambda/HEAD/images/github-repository.png -------------------------------------------------------------------------------- /about.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: About 4 | permalink: /about/ 5 | comments: false 6 | author_footer: false 7 | --- 8 | 9 | About page, add content here. 10 | -------------------------------------------------------------------------------- /404.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | title: 404 – Not Found 4 | permalink: /404.html 5 | comments: false 6 | author_footer: false 7 | --- 8 | 9 | This page is not found. Start from [home](/). 10 | -------------------------------------------------------------------------------- /_includes/post_footer.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ post.author }} Avatar 4 |
5 |
6 |

Assembled by {{ site.author }}

7 | Single line description about the author 8 |
9 |
-------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% include head.html %} 5 | 6 | 7 | 8 |
9 | 10 | {% include header.html %} 11 | 12 |
13 |
14 |
15 | {{ content }} 16 |
17 |
18 |
19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 | 7 | {% assign index = true %} 8 | 9 | {% for post in site.posts %} 10 | {% assign page = post %} 11 | {% include post.html %} 12 | {% endfor %} 13 | 14 |

Subscribe via RSS or browse source on GitHub.

15 | 16 |
17 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Site settings 2 | title: Site Title 3 | author: Your Name 4 | author_avatar: https://gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=50 5 | email: alias@domain.tld 6 | description: Blog about whatever. 7 | baseurl: "" # optional 8 | url: "https://foo_bar.github.io" 9 | #twitter_username: foo_bar 10 | #github_username: foo_bar 11 | github_repo: foo_bar/foo_bar.github.io 12 | #google_analytics: UA-80085-YOUR-ID 13 | # disqus: disqus-id 14 | 15 | # Build settings 16 | markdown: kramdown 17 | permalink: pretty 18 | excerpt_separator: "" 19 | 20 | gems: 21 | - jekyll-sitemap -------------------------------------------------------------------------------- /_includes/disqus.html: -------------------------------------------------------------------------------- 1 |
2 | 10 | 11 | -------------------------------------------------------------------------------- /_posts/2014-09-18-example-post.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | title: "Example Post" 4 | category: test 5 | --- 6 | 7 | This is an example post. Please remove it and add your own content. 8 | 9 | Fix looked intently at his companion, whose countenance was as serene as possible, and laughed with him. But Passepartout persisted in chaffing him by asking him if he made much by his present occupation. 10 | 11 | Ah, if you would only go on with us! An agent of the Peninsular Company, you know, can't stop on the way! You were only going to Bombay, and here you are in China. America is not far off, and from America to Europe is only a step. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | jekyll-lambda 2 | ============= 3 | 4 | An ascetic theme for Jekyll. Originally used at http://lauris.github.io 5 | 6 | ## Screenshot and Demo 7 | 8 | You can view the theme live at [my blog](http://lauris.github.io). 9 | 10 | ![Jekyll Lambda Demo](https://raw.githubusercontent.com/lauris/jekyll-lambda/master/images/screenshot.png) 11 | 12 | ## Usage 13 | 14 | Install Jekyll. 15 | 16 | ``` 17 | gem install jekyll 18 | ``` 19 | 20 | Fork and clone this repo. 21 | 22 | ``` 23 | git clone git@github.com:YourUsername/jekyll-lambda.git 24 | ``` 25 | 26 | Edit, add and modify the theme and content as you wish. Then run with Jekyll command line utility. 27 | 28 | ``` 29 | jekyll serve -w 30 | ``` 31 | 32 | Profit? 33 | 34 | ## License 35 | 36 | This project is licensed under the Apache 2.0 license. More info in LICENSE file. -------------------------------------------------------------------------------- /_includes/post.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 |

{{ page.title }}

7 | 11 |
12 | 13 |
14 | {% if content %} 15 | {{ content }} 16 | {% else %} 17 | {{ page.excerpt }} 18 | {% if page.content contains '' %} 19 |

Read more »

20 | {% endif %} 21 | {% endif %} 22 |
23 | 24 |
25 | 26 |
27 | {% if content and page.author_footer != false %} 28 | 29 | {% include post_footer.html %} 30 | 31 | {% if page.comments != false %} 32 | {% include disqus.html %} 33 | {% endif %} 34 | 35 | {% endif %} 36 | -------------------------------------------------------------------------------- /_includes/header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | {{ site.title }} 4 |
5 | 23 |
24 | -------------------------------------------------------------------------------- /_includes/footer.html: -------------------------------------------------------------------------------- 1 | 40 | -------------------------------------------------------------------------------- /feed.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: 3 | --- 4 | 5 | 6 | 7 | 8 | {{ site.title | xml_escape }} 9 | {{ site.description | xml_escape }} 10 | {{ site.url }}{{ site.baseurl }}/ 11 | 12 | {{ site.time | date_to_rfc822 }} 13 | {{ site.time | date_to_rfc822 }} 14 | Jekyll v{{ jekyll.version }} 15 | {% for post in site.posts limit:10 %} 16 | 17 | {{ post.title | xml_escape }} 18 | {{ post.content | xml_escape }} 19 | {{ post.date | date_to_rfc822 }} 20 | {{ post.url | prepend: site.baseurl | prepend: site.url }} 21 | {{ post.url | prepend: site.baseurl | prepend: site.url }} 22 | {% for tag in post.tags %} 23 | {{ tag | xml_escape }} 24 | {% endfor %} 25 | {% for cat in post.categories %} 26 | {{ cat | xml_escape }} 27 | {% endfor %} 28 | 29 | {% endfor %} 30 | 31 | 32 | -------------------------------------------------------------------------------- /_includes/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %} 5 | 6 | 7 | 8 | 9 | {% if page.image %}{% endif %} 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | {% if site.google_analytics %} 21 | 30 | {% endif %} 31 | 32 | 33 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | RedCloth (4.2.9) 5 | activesupport (4.1.4) 6 | i18n (~> 0.6, >= 0.6.9) 7 | json (~> 1.7, >= 1.7.7) 8 | minitest (~> 5.1) 9 | thread_safe (~> 0.1) 10 | tzinfo (~> 1.1) 11 | blankslate (2.1.2.4) 12 | celluloid (0.15.2) 13 | timers (~> 1.1.0) 14 | classifier (1.3.4) 15 | fast-stemmer (>= 1.0.0) 16 | coffee-script (2.3.0) 17 | coffee-script-source 18 | execjs 19 | coffee-script-source (1.7.1) 20 | colorator (0.1) 21 | execjs (2.2.1) 22 | fast-stemmer (1.0.2) 23 | ffi (1.9.3) 24 | gemoji (2.1.0) 25 | github-pages (22) 26 | RedCloth (= 4.2.9) 27 | jekyll (= 2.2.0) 28 | jekyll-coffeescript (= 1.0.0) 29 | jekyll-mentions (= 0.1.3) 30 | jekyll-redirect-from (= 0.4.0) 31 | jekyll-sass-converter (= 1.2.0) 32 | jekyll-sitemap (= 0.5.1) 33 | jemoji (= 0.3.0) 34 | kramdown (= 1.3.1) 35 | liquid (= 2.6.1) 36 | maruku (= 0.7.0) 37 | pygments.rb (= 0.6.0) 38 | rdiscount (= 2.1.7) 39 | redcarpet (= 3.1.2) 40 | html-pipeline (1.9.0) 41 | activesupport (>= 2) 42 | nokogiri (~> 1.4) 43 | i18n (0.6.11) 44 | jekyll (2.2.0) 45 | classifier (~> 1.3) 46 | colorator (~> 0.1) 47 | jekyll-coffeescript (~> 1.0) 48 | jekyll-gist (~> 1.0) 49 | jekyll-paginate (~> 1.0) 50 | jekyll-sass-converter (~> 1.0) 51 | jekyll-watch (~> 1.0) 52 | kramdown (~> 1.3) 53 | liquid (~> 2.6.1) 54 | mercenary (~> 0.3.3) 55 | pygments.rb (~> 0.6.0) 56 | redcarpet (~> 3.1) 57 | safe_yaml (~> 1.0) 58 | toml (~> 0.1.0) 59 | jekyll-coffeescript (1.0.0) 60 | coffee-script (~> 2.2) 61 | jekyll-gist (1.1.0) 62 | jekyll-mentions (0.1.3) 63 | html-pipeline (~> 1.9.0) 64 | jekyll (~> 2.0) 65 | jekyll-paginate (1.0.0) 66 | jekyll-redirect-from (0.4.0) 67 | jekyll (~> 2.0) 68 | jekyll-sass-converter (1.2.0) 69 | sass (~> 3.2) 70 | jekyll-sitemap (0.5.1) 71 | jekyll-watch (1.1.0) 72 | listen (~> 2.7) 73 | jemoji (0.3.0) 74 | gemoji (~> 2.0) 75 | html-pipeline (~> 1.9) 76 | jekyll (~> 2.0) 77 | json (1.8.1) 78 | kramdown (1.3.1) 79 | liquid (2.6.1) 80 | listen (2.7.9) 81 | celluloid (>= 0.15.2) 82 | rb-fsevent (>= 0.9.3) 83 | rb-inotify (>= 0.9) 84 | maruku (0.7.0) 85 | mercenary (0.3.4) 86 | mini_portile (0.6.0) 87 | minitest (5.4.0) 88 | nokogiri (1.6.3.1) 89 | mini_portile (= 0.6.0) 90 | parslet (1.5.0) 91 | blankslate (~> 2.0) 92 | posix-spawn (0.3.9) 93 | pygments.rb (0.6.0) 94 | posix-spawn (~> 0.3.6) 95 | yajl-ruby (~> 1.1.0) 96 | rb-fsevent (0.9.4) 97 | rb-inotify (0.9.5) 98 | ffi (>= 0.5.0) 99 | rdiscount (2.1.7) 100 | redcarpet (3.1.2) 101 | safe_yaml (1.0.3) 102 | sass (3.3.14) 103 | thread_safe (0.3.4) 104 | timers (1.1.0) 105 | toml (0.1.1) 106 | parslet (~> 1.5.0) 107 | tzinfo (1.2.2) 108 | thread_safe (~> 0.1) 109 | yajl-ruby (1.1.0) 110 | 111 | PLATFORMS 112 | ruby 113 | 114 | DEPENDENCIES 115 | github-pages 116 | -------------------------------------------------------------------------------- /css/syntax.css: -------------------------------------------------------------------------------- 1 | .highlight { background: #ffffff; } 2 | .highlight .c { color: #999988; font-style: italic } /* Comment */ 3 | .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 4 | .highlight .k { font-weight: bold } /* Keyword */ 5 | .highlight .o { font-weight: bold } /* Operator */ 6 | .highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 7 | .highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ 8 | .highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ 9 | .highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ 10 | .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 11 | .highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ 12 | .highlight .ge { font-style: italic } /* Generic.Emph */ 13 | .highlight .gr { color: #aa0000 } /* Generic.Error */ 14 | .highlight .gh { color: #999999 } /* Generic.Heading */ 15 | .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 16 | .highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ 17 | .highlight .go { color: #888888 } /* Generic.Output */ 18 | .highlight .gp { color: #555555 } /* Generic.Prompt */ 19 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 20 | .highlight .gu { color: #aaaaaa } /* Generic.Subheading */ 21 | .highlight .gt { color: #aa0000 } /* Generic.Traceback */ 22 | .highlight .kc { font-weight: bold } /* Keyword.Constant */ 23 | .highlight .kd { font-weight: bold } /* Keyword.Declaration */ 24 | .highlight .kp { font-weight: bold } /* Keyword.Pseudo */ 25 | .highlight .kr { font-weight: bold } /* Keyword.Reserved */ 26 | .highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 27 | .highlight .m { color: #009999 } /* Literal.Number */ 28 | .highlight .s { color: #d14 } /* Literal.String */ 29 | .highlight .na { color: #008080 } /* Name.Attribute */ 30 | .highlight .nb { color: #0086B3 } /* Name.Builtin */ 31 | .highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ 32 | .highlight .no { color: #008080 } /* Name.Constant */ 33 | .highlight .ni { color: #800080 } /* Name.Entity */ 34 | .highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ 35 | .highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ 36 | .highlight .nn { color: #555555 } /* Name.Namespace */ 37 | .highlight .nt { color: #000080 } /* Name.Tag */ 38 | .highlight .nv { color: #008080 } /* Name.Variable */ 39 | .highlight .ow { font-weight: bold } /* Operator.Word */ 40 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 41 | .highlight .mf { color: #009999 } /* Literal.Number.Float */ 42 | .highlight .mh { color: #009999 } /* Literal.Number.Hex */ 43 | .highlight .mi { color: #009999 } /* Literal.Number.Integer */ 44 | .highlight .mo { color: #009999 } /* Literal.Number.Oct */ 45 | .highlight .sb { color: #d14 } /* Literal.String.Backtick */ 46 | .highlight .sc { color: #d14 } /* Literal.String.Char */ 47 | .highlight .sd { color: #d14 } /* Literal.String.Doc */ 48 | .highlight .s2 { color: #d14 } /* Literal.String.Double */ 49 | .highlight .se { color: #d14 } /* Literal.String.Escape */ 50 | .highlight .sh { color: #d14 } /* Literal.String.Heredoc */ 51 | .highlight .si { color: #d14 } /* Literal.String.Interpol */ 52 | .highlight .sx { color: #d14 } /* Literal.String.Other */ 53 | .highlight .sr { color: #009926 } /* Literal.String.Regex */ 54 | .highlight .s1 { color: #d14 } /* Literal.String.Single */ 55 | .highlight .ss { color: #990073 } /* Literal.String.Symbol */ 56 | .highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ 57 | .highlight .vc { color: #008080 } /* Name.Variable.Class */ 58 | .highlight .vg { color: #008080 } /* Name.Variable.Global */ 59 | .highlight .vi { color: #008080 } /* Name.Variable.Instance */ 60 | .highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /css/lambda.css: -------------------------------------------------------------------------------- 1 | /* reset */ 2 | html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;} 3 | 4 | body { 5 | font: 14px/18px "Helvetica Neue", Arial, sans-serif; 6 | padding-bottom: 40px; 7 | } 8 | 9 | a { 10 | text-decoration: underline; 11 | color: #2868a4; 12 | } 13 | a:hover { 14 | text-decoration: none; 15 | } 16 | hr { 17 | border-bottom: 1px solid #ccc; 18 | border-top-style: none; 19 | } 20 | h1, h2, h3, h4, .links { 21 | font-family:"Open Sans", "Helvetica Neue", Arial, sans-serif; 22 | } 23 | h1, h2 { 24 | font-weight: 700; 25 | } 26 | h1 a, h2 a { 27 | color: black; 28 | text-decoration: none; 29 | } 30 | h1 a:hover, h2 a:hover { 31 | text-decoration: underline; 32 | } 33 | em { 34 | font-style: italic; 35 | } 36 | 37 | .wrapper { 38 | max-width: 700px; 39 | margin: 0 auto; 40 | padding: 0 30px; 41 | } 42 | 43 | #main-header { 44 | padding-bottom: 25px; 45 | border-bottom: 2px solid black; 46 | margin: 40px auto 0 auto; 47 | } 48 | #site-title { 49 | font-weight: 700; 50 | font-size: 25px; 51 | line-height: normal; 52 | vertical-align: middle; 53 | } 54 | #site-title a { 55 | color: black; 56 | text-decoration: none; 57 | } 58 | #site-title a:hover { 59 | text-decoration: underline; 60 | } 61 | #site-title a, #site-title img { 62 | vertical-align: middle; 63 | } 64 | 65 | 66 | .links { 67 | margin-top: 5px; 68 | font-size: 16px; 69 | vertical-align: middle; 70 | line-height: normal; 71 | color: #777; 72 | padding-left: 1px; 73 | } 74 | .links a { 75 | text-decoration: none; 76 | color: #777; 77 | font-weight: 600; 78 | margin-right: 10px; 79 | } 80 | .links a:hover { 81 | text-decoration: underline; 82 | } 83 | .links a.active { 84 | color: #444; 85 | } 86 | .links img { 87 | vertical-align: top; 88 | margin-right: 2px; 89 | } 90 | .links .github-link { 91 | float: right; 92 | } 93 | 94 | #content { 95 | margin: 40px 0 0 0; 96 | } 97 | 98 | #articles { 99 | margin: auto; 100 | } 101 | #articles .notice { 102 | padding: 0 0 20px 195px; 103 | } 104 | 105 | .entry { 106 | overflow: auto; 107 | margin: 0 0 35px 0; 108 | padding-top: 35px; 109 | border-top: 1px solid #e7e7e7; 110 | } 111 | .entry h1 { 112 | font-weight: 700; 113 | } 114 | .article-list { 115 | margin-top: 30px; 116 | } 117 | .article-list .entry:first-child { 118 | border-top-style: none; 119 | padding-top: 0; 120 | } 121 | .entry .entry-date, .entry .entry-content { 122 | float: left; 123 | } 124 | .entry .entry-content { 125 | width: 100%; 126 | overflow: hidden; 127 | } 128 | .entry .entry-date { 129 | padding: 30px 0 0 0; 130 | font-size: 12px; 131 | color: #707070; 132 | width: 195px; 133 | text-indent: 25px; 134 | display: none; 135 | } 136 | .entry h1 { 137 | font-size: 42px; 138 | line-height: 45px; 139 | margin-bottom: 10px; 140 | } 141 | .entry .entry-meta { 142 | font-size: 12px; 143 | color: #707070; 144 | } 145 | 146 | .entry .entry-body { 147 | margin: 20px 0 15px 0; 148 | font-size: 16px; 149 | line-height: 27px; 150 | } 151 | .entry .entry-body strong, 152 | .entry .entry-body b { 153 | font-weight: 600; 154 | } 155 | .entry .entry-body p { 156 | margin: 15px 0; 157 | } 158 | .entry .entry-body p.caption { 159 | font-size: 14px; 160 | text-align: center; 161 | font-style: italic; 162 | margin-top: -5px; 163 | display: block; 164 | } 165 | .entry .entry-body h2 { 166 | font-size: 18px; 167 | } 168 | .entry .entry-body ul, ol { 169 | margin: 15px 0 15px 10px; 170 | } 171 | .entry .entry-body ul li { 172 | list-style: disc; 173 | margin-left: 15px; 174 | } 175 | .entry .entry-body ol li { 176 | list-style: decimal; 177 | margin-left: 15px; 178 | } 179 | .entry .entry-body img { 180 | margin: 10px 0 0 0; 181 | max-width: 100%; 182 | display: block; 183 | } 184 | 185 | .article-backlink { 186 | padding-bottom: 13px; 187 | border-bottom: 1px solid #e7e7e7; 188 | padding-left: 163px; 189 | } 190 | .article-backlink a { 191 | display: inline-block; 192 | background: url(../img/blog/back.gif) no-repeat left center; 193 | height: 24px; 194 | line-height: 23px; 195 | padding-left: 32px; 196 | font-size: 12px; 197 | } 198 | 199 | 200 | .article-author { 201 | margin-bottom: 40px; 202 | padding-top: 20px; 203 | font-size: 14px; 204 | border-top: 1px solid #e7e7e7; 205 | overflow: auto; 206 | } 207 | .article-author .avatar { 208 | float: left; 209 | } 210 | .article-author .name { 211 | margin-top: 5px; 212 | float: left; 213 | } 214 | .article-author h4 { 215 | font-size: 18px; 216 | margin-bottom: 6px; 217 | } 218 | .article-author h4 b { 219 | font-weight: 600; 220 | } 221 | .article-author img { 222 | border-radius: 50%; 223 | vertical-align: middle; 224 | margin-right: 15px; 225 | } 226 | .article-author span { 227 | margin-right: 10px; 228 | } 229 | 230 | 231 | .gist { 232 | font-size: 14px; 233 | } 234 | 235 | .entry pre code { 236 | border: 0; 237 | padding-right: 0; 238 | padding-left: 0; 239 | font-size: 14px; 240 | } 241 | .entry pre { 242 | line-height: 18px; 243 | border: 2px solid #ddd; 244 | background: #fafafa; 245 | padding: 10px 12px; 246 | border-radius: 5px; 247 | overflow: scroll; 248 | } 249 | 250 | /* terminal */ 251 | .entry pre.terminal { 252 | border: 1px solid #000; 253 | background-color: #333; 254 | color: #FFF; 255 | -webkit-border-radius: 3px; 256 | -moz-border-radius: 3px; 257 | border-radius: 3px; 258 | } 259 | .post pre.terminal code { 260 | background-color: #333; 261 | } 262 | 263 | @media all and (max-width: 550px) { 264 | #site-title img { 265 | width: 25px; 266 | } 267 | .links a { 268 | margin-right: 2px; 269 | font-size: 14px; 270 | } 271 | .links .github-link { 272 | float: none; 273 | } 274 | .links .github-link img { 275 | display: none; 276 | } 277 | .wrapper { 278 | padding-left: 15px; 279 | padding-right: 15px; 280 | } 281 | .entry h1 { 282 | font-size: 28px; 283 | line-height: 30px; 284 | margin-bottom: 7px; 285 | } 286 | .article-author img { 287 | display: none; 288 | } 289 | } 290 | -------------------------------------------------------------------------------- /css/main.css: -------------------------------------------------------------------------------- 1 | /* Base */ 2 | /* ----------------------------------------------------------*/ 3 | 4 | * { 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | html, body { height: 100%; } 10 | 11 | body { 12 | font-family: Helvetica, Arial, sans-serif; 13 | font-size: 16px; 14 | line-height: 1.5; 15 | font-weight: 300; 16 | background-color: #fdfdfd; 17 | } 18 | 19 | h1, h2, h3, h4, h5, h6 { font-size: 100%; font-weight: 400; } 20 | 21 | a { color: #2a7ae2; text-decoration: none; } 22 | a:hover { color: #000; text-decoration: underline; } 23 | a:visited { color: #205caa; } 24 | 25 | /* Utility */ 26 | 27 | .wrap:before, 28 | .wrap:after { content:""; display:table; } 29 | .wrap:after { clear: both; } 30 | .wrap { 31 | max-width: 800px; 32 | padding: 0 30px; 33 | margin: 0 auto; 34 | zoom: 1; 35 | } 36 | 37 | 38 | /* Layout Styles */ 39 | /* ----------------------------------------------------------*/ 40 | 41 | /* Site header */ 42 | 43 | .site-header { 44 | border-top: 5px solid #333; 45 | border-bottom: 1px solid #e8e8e8; 46 | min-height: 56px; 47 | background-color: white; 48 | } 49 | 50 | .site-title, 51 | .site-title:hover, 52 | .site-title:visited { 53 | display: block; 54 | color: #333; 55 | font-size: 26px; 56 | letter-spacing: -1px; 57 | float: left; 58 | line-height: 56px; 59 | position: relative; 60 | z-index: 1; 61 | } 62 | 63 | .site-nav { 64 | float: right; 65 | line-height: 56px; 66 | } 67 | 68 | .site-nav .menu-icon { display: none; } 69 | 70 | .site-nav .page-link { 71 | margin-left: 20px; 72 | color: #727272; 73 | letter-spacing: -.5px; 74 | } 75 | 76 | /* Site footer */ 77 | 78 | .site-footer { 79 | border-top: 1px solid #e8e8e8; 80 | padding: 30px 0; 81 | } 82 | 83 | .footer-heading { 84 | font-size: 18px; 85 | font-weight: 300; 86 | letter-spacing: -.5px; 87 | margin-bottom: 15px; 88 | } 89 | 90 | .site-footer .column { float: left; margin-bottom: 15px; } 91 | 92 | .footer-col-1 { 93 | width: 270px; /*fallback*/ 94 | width: -webkit-calc(35% - 10px); 95 | width: -moz-calc(35% - 10px); 96 | width: -o-calc(35% - 10px); 97 | width: calc(35% - 10px); 98 | margin-right: 10px 99 | } 100 | .footer-col-2 { 101 | width: 175px; /*fallback*/ 102 | width: -webkit-calc(23.125% - 10px); 103 | width: -moz-calc(23.125% - 10px); 104 | width: -o-calc(23.125% - 10px); 105 | width: calc(23.125% - 10px); 106 | margin-right: 10px 107 | } 108 | .footer-col-3 { 109 | width: 335px; /*fallback*/ 110 | width: -webkit-calc(41.875%); 111 | width: -moz-calc(41.875%); 112 | width: -o-calc(41.875%); 113 | width: calc(41.875%); 114 | } 115 | 116 | .site-footer ul { list-style: none; } 117 | 118 | .site-footer li, 119 | .site-footer p { 120 | font-size: 15px; 121 | letter-spacing: -.3px; 122 | color: #828282; 123 | } 124 | 125 | .github-icon-svg, 126 | .twitter-icon-svg { 127 | display: inline-block; 128 | width: 16px; 129 | height: 16px; 130 | position: relative; 131 | top: 3px; 132 | } 133 | 134 | 135 | /* Page Content styles */ 136 | /* ----------------------------------------------------------*/ 137 | 138 | .page-content { 139 | padding: 30px 0; 140 | background-color: #fff; 141 | } 142 | 143 | 144 | /* Home styles */ 145 | /* ----------------------------------------------------------*/ 146 | 147 | .home h1 { margin-bottom: 25px; } 148 | 149 | .posts { list-style-type: none; } 150 | 151 | .posts li { margin-bottom: 30px; } 152 | 153 | .posts .post-link { 154 | font-size: 24px; 155 | letter-spacing: -1px; 156 | line-height: 1; 157 | } 158 | 159 | .posts .post-date { 160 | display: block; 161 | font-size: 15px; 162 | color: #818181; 163 | } 164 | 165 | 166 | /* Post styles */ 167 | /* ----------------------------------------------------------*/ 168 | 169 | .post-header { margin: 10px 0 30px; } 170 | 171 | .post-header h1 { 172 | font-size: 42px; 173 | letter-spacing: -1.75px; 174 | line-height: 1; 175 | font-weight: 300; 176 | } 177 | 178 | .post-header .meta { 179 | font-size: 15px; 180 | color: #818181; 181 | margin-top: 5px; 182 | } 183 | 184 | .post-content { margin: 0 0 30px; } 185 | 186 | .post-content > * { margin: 20px 0; } 187 | 188 | 189 | .post-content h1, 190 | .post-content h2, 191 | .post-content h3, 192 | .post-content h4, 193 | .post-content h5, 194 | .post-content h6 { 195 | line-height: 1; 196 | font-weight: 300; 197 | margin: 40px 0 20px; 198 | } 199 | 200 | .post-content h2 { 201 | font-size: 32px; 202 | letter-spacing: -1.25px; 203 | } 204 | 205 | .post-content h3 { 206 | font-size: 26px; 207 | letter-spacing: -1px; 208 | } 209 | 210 | .post-content h4 { 211 | font-size: 20px; 212 | letter-spacing: -1px; 213 | } 214 | 215 | .post-content blockquote { 216 | border-left: 4px solid #e8e8e8; 217 | padding-left: 20px; 218 | font-size: 18px; 219 | opacity: .6; 220 | letter-spacing: -1px; 221 | font-style: italic; 222 | margin: 30px 0; 223 | } 224 | 225 | .post-content ul, 226 | .post-content ol { padding-left: 20px; } 227 | 228 | .post pre, 229 | .post code { 230 | border: 1px solid #d5d5e9; 231 | background-color: #eef; 232 | padding: 8px 12px; 233 | -webkit-border-radius: 3px; 234 | -moz-border-radius: 3px; 235 | border-radius: 3px; 236 | font-size: 15px; 237 | overflow:scroll; 238 | } 239 | 240 | .post code { padding: 1px 5px; } 241 | 242 | .post ul, 243 | .post ol { margin-left: 1.35em; } 244 | 245 | .post pre code { 246 | border: 0; 247 | padding-right: 0; 248 | padding-left: 0; 249 | } 250 | 251 | /* terminal */ 252 | .post pre.terminal { 253 | border: 1px solid #000; 254 | background-color: #333; 255 | color: #FFF; 256 | -webkit-border-radius: 3px; 257 | -moz-border-radius: 3px; 258 | border-radius: 3px; 259 | } 260 | 261 | .post pre.terminal code { background-color: #333; } 262 | 263 | /* Syntax highlighting styles */ 264 | /* ----------------------------------------------------------*/ 265 | 266 | .highlight { background: #ffffff; } 267 | .highlight .c { color: #999988; font-style: italic } /* Comment */ 268 | .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 269 | .highlight .k { font-weight: bold } /* Keyword */ 270 | .highlight .o { font-weight: bold } /* Operator */ 271 | .highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */ 272 | .highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ 273 | .highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ 274 | .highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ 275 | .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 276 | .highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ 277 | .highlight .ge { font-style: italic } /* Generic.Emph */ 278 | .highlight .gr { color: #aa0000 } /* Generic.Error */ 279 | .highlight .gh { color: #999999 } /* Generic.Heading */ 280 | .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 281 | .highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ 282 | .highlight .go { color: #888888 } /* Generic.Output */ 283 | .highlight .gp { color: #555555 } /* Generic.Prompt */ 284 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 285 | .highlight .gu { color: #aaaaaa } /* Generic.Subheading */ 286 | .highlight .gt { color: #aa0000 } /* Generic.Traceback */ 287 | .highlight .kc { font-weight: bold } /* Keyword.Constant */ 288 | .highlight .kd { font-weight: bold } /* Keyword.Declaration */ 289 | .highlight .kp { font-weight: bold } /* Keyword.Pseudo */ 290 | .highlight .kr { font-weight: bold } /* Keyword.Reserved */ 291 | .highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ 292 | .highlight .m { color: #009999 } /* Literal.Number */ 293 | .highlight .s { color: #d14 } /* Literal.String */ 294 | .highlight .na { color: #008080 } /* Name.Attribute */ 295 | .highlight .nb { color: #0086B3 } /* Name.Builtin */ 296 | .highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ 297 | .highlight .no { color: #008080 } /* Name.Constant */ 298 | .highlight .ni { color: #800080 } /* Name.Entity */ 299 | .highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ 300 | .highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ 301 | .highlight .nn { color: #555555 } /* Name.Namespace */ 302 | .highlight .nt { color: #000080 } /* Name.Tag */ 303 | .highlight .nv { color: #008080 } /* Name.Variable */ 304 | .highlight .ow { font-weight: bold } /* Operator.Word */ 305 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 306 | .highlight .mf { color: #009999 } /* Literal.Number.Float */ 307 | .highlight .mh { color: #009999 } /* Literal.Number.Hex */ 308 | .highlight .mi { color: #009999 } /* Literal.Number.Integer */ 309 | .highlight .mo { color: #009999 } /* Literal.Number.Oct */ 310 | .highlight .sb { color: #d14 } /* Literal.String.Backtick */ 311 | .highlight .sc { color: #d14 } /* Literal.String.Char */ 312 | .highlight .sd { color: #d14 } /* Literal.String.Doc */ 313 | .highlight .s2 { color: #d14 } /* Literal.String.Double */ 314 | .highlight .se { color: #d14 } /* Literal.String.Escape */ 315 | .highlight .sh { color: #d14 } /* Literal.String.Heredoc */ 316 | .highlight .si { color: #d14 } /* Literal.String.Interpol */ 317 | .highlight .sx { color: #d14 } /* Literal.String.Other */ 318 | .highlight .sr { color: #009926 } /* Literal.String.Regex */ 319 | .highlight .s1 { color: #d14 } /* Literal.String.Single */ 320 | .highlight .ss { color: #990073 } /* Literal.String.Symbol */ 321 | .highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ 322 | .highlight .vc { color: #008080 } /* Name.Variable.Class */ 323 | .highlight .vg { color: #008080 } /* Name.Variable.Global */ 324 | .highlight .vi { color: #008080 } /* Name.Variable.Instance */ 325 | .highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ 326 | 327 | 328 | /* media queries */ 329 | /* ----------------------------------------------------------*/ 330 | 331 | 332 | @media screen and (max-width: 750px) { 333 | 334 | .footer-col-1 { width: 50%; } 335 | 336 | .footer-col-2 { 337 | width: 45%; /*fallback*/ 338 | width: -webkit-calc(50% - 10px); 339 | width: -moz-calc(50% - 10px); 340 | width: -o-calc(50% - 10px); 341 | width: calc(50% - 10px); 342 | margin-right: 0; 343 | } 344 | 345 | .site-footer .column.footer-col-3 { 346 | width: auto; 347 | float: none; 348 | clear: both; 349 | } 350 | 351 | } 352 | 353 | @media screen and (max-width: 600px) { 354 | 355 | .wrap { padding: 0 12px; } 356 | 357 | .site-nav { 358 | position: fixed; 359 | z-index: 10; 360 | top: 14px; right: 8px; 361 | background-color: white; 362 | -webkit-border-radius: 5px; 363 | -moz-border-radius: 5px; 364 | border-radius: 5px; 365 | border: 1px solid #e8e8e8; 366 | } 367 | 368 | .site-nav .menu-icon { 369 | display: block; 370 | font-size: 24px; 371 | color: #505050; 372 | float: right; 373 | width: 36px; 374 | text-align: center; 375 | line-height: 36px; 376 | } 377 | 378 | .site-nav .menu-icon svg { width: 18px; height: 16px; } 379 | 380 | .site-nav .trigger { 381 | clear: both; 382 | margin-bottom: 5px; 383 | display: none; 384 | } 385 | 386 | .site-nav:hover .trigger { display: block; } 387 | 388 | .site-nav .page-link { 389 | display: block; 390 | text-align: right; 391 | line-height: 1.25; 392 | padding: 5px 10px; 393 | margin: 0; 394 | } 395 | 396 | .post-header h1 { font-size: 36px; } 397 | .post-content h2 { font-size: 28px; } 398 | .post-content h3 { font-size: 22px; } 399 | .post-content h4 { font-size: 18px; } 400 | .post-content blockquote { padding-left: 10px; } 401 | .post-content ul, 402 | .post-content ol { padding-left: 10px; } 403 | 404 | .site-footer .column { 405 | float: none; 406 | clear: both; 407 | width: auto; 408 | margin: 0 0 15px; } 409 | 410 | } 411 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "rubygems" 2 | require 'rake' 3 | require 'yaml' 4 | require 'time' 5 | 6 | SOURCE = "." 7 | CONFIG = { 8 | 'version' => "0.3.0", 9 | 'themes' => File.join(SOURCE, "_includes", "themes"), 10 | 'layouts' => File.join(SOURCE, "_layouts"), 11 | 'posts' => File.join(SOURCE, "_posts"), 12 | 'post_ext' => "md", 13 | 'theme_package_version' => "0.1.0" 14 | } 15 | 16 | # Path configuration helper 17 | module JB 18 | class Path 19 | SOURCE = "." 20 | Paths = { 21 | :layouts => "_layouts", 22 | :themes => "_includes/themes", 23 | :theme_assets => "assets/themes", 24 | :theme_packages => "_theme_packages", 25 | :posts => "_posts" 26 | } 27 | 28 | def self.base 29 | SOURCE 30 | end 31 | 32 | # build a path relative to configured path settings. 33 | def self.build(path, opts = {}) 34 | opts[:root] ||= SOURCE 35 | path = "#{opts[:root]}/#{Paths[path.to_sym]}/#{opts[:node]}".split("/") 36 | path.compact! 37 | File.__send__ :join, path 38 | end 39 | 40 | end #Path 41 | end #JB 42 | 43 | # Usage: rake post title="A Title" [date="2012-02-09"] [tags=[tag1,tag2]] [category="category"] 44 | desc "Begin a new post in #{CONFIG['posts']}" 45 | task :post do 46 | abort("rake aborted: '#{CONFIG['posts']}' directory not found.") unless FileTest.directory?(CONFIG['posts']) 47 | title = ENV["title"] || "new-post" 48 | tags = ENV["tags"] || "[]" 49 | category = ENV["category"] || "" 50 | category = "\"#{category.gsub(/-/,' ')}\"" if !category.empty? 51 | slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '') 52 | begin 53 | date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d') 54 | rescue => e 55 | puts "Error - date format must be YYYY-MM-DD, please check you typed it correctly!" 56 | exit -1 57 | end 58 | filename = File.join(CONFIG['posts'], "#{date}-#{slug}.#{CONFIG['post_ext']}") 59 | if File.exist?(filename) 60 | abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' 61 | end 62 | 63 | puts "Creating new post: #{filename}" 64 | open(filename, 'w') do |post| 65 | post.puts "---" 66 | post.puts "layout: post" 67 | post.puts "title: \"#{title.gsub(/-/,' ')}\"" 68 | post.puts "category: #{category}" 69 | post.puts "---" 70 | post.puts "" 71 | end 72 | end # task :post 73 | 74 | # Usage: rake page name="about.html" 75 | # You can also specify a sub-directory path. 76 | # If you don't specify a file extention we create an index.html at the path specified 77 | desc "Create a new page." 78 | task :page do 79 | name = ENV["name"] || "new-page.md" 80 | filename = File.join(SOURCE, "#{name}") 81 | filename = File.join(filename, "index.html") if File.extname(filename) == "" 82 | title = File.basename(filename, File.extname(filename)).gsub(/[\W\_]/, " ").gsub(/\b\w/){$&.upcase} 83 | if File.exist?(filename) 84 | abort("rake aborted!") if ask("#{filename} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' 85 | end 86 | 87 | mkdir_p File.dirname(filename) 88 | puts "Creating new page: #{filename}" 89 | open(filename, 'w') do |post| 90 | post.puts "---" 91 | post.puts "layout: page" 92 | post.puts "title: \"#{title}\"" 93 | post.puts 'description: ""' 94 | post.puts "---" 95 | post.puts "{% include JB/setup %}" 96 | end 97 | end # task :page 98 | 99 | desc "Launch preview environment" 100 | task :preview do 101 | system "jekyll serve -w" 102 | end # task :preview 103 | 104 | # Public: Alias - Maintains backwards compatability for theme switching. 105 | task :switch_theme => "theme:switch" 106 | 107 | namespace :theme do 108 | 109 | # Public: Switch from one theme to another for your blog. 110 | # 111 | # name - String, Required. name of the theme you want to switch to. 112 | # The theme must be installed into your JB framework. 113 | # 114 | # Examples 115 | # 116 | # rake theme:switch name="the-program" 117 | # 118 | # Returns Success/failure messages. 119 | desc "Switch between Jekyll-bootstrap themes." 120 | task :switch do 121 | theme_name = ENV["name"].to_s 122 | theme_path = File.join(CONFIG['themes'], theme_name) 123 | settings_file = File.join(theme_path, "settings.yml") 124 | non_layout_files = ["settings.yml"] 125 | 126 | abort("rake aborted: name cannot be blank") if theme_name.empty? 127 | abort("rake aborted: '#{theme_path}' directory not found.") unless FileTest.directory?(theme_path) 128 | abort("rake aborted: '#{CONFIG['layouts']}' directory not found.") unless FileTest.directory?(CONFIG['layouts']) 129 | 130 | Dir.glob("#{theme_path}/*") do |filename| 131 | next if non_layout_files.include?(File.basename(filename).downcase) 132 | puts "Generating '#{theme_name}' layout: #{File.basename(filename)}" 133 | 134 | open(File.join(CONFIG['layouts'], File.basename(filename)), 'w') do |page| 135 | if File.basename(filename, ".html").downcase == "default" 136 | page.puts "---" 137 | page.puts File.read(settings_file) if File.exist?(settings_file) 138 | page.puts "---" 139 | else 140 | page.puts "---" 141 | page.puts "layout: default" 142 | page.puts "---" 143 | end 144 | page.puts "{% include JB/setup %}" 145 | page.puts "{% include themes/#{theme_name}/#{File.basename(filename)} %}" 146 | end 147 | end 148 | 149 | puts "=> Theme successfully switched!" 150 | puts "=> Reload your web-page to check it out =)" 151 | end # task :switch 152 | 153 | # Public: Install a theme using the theme packager. 154 | # Version 0.1.0 simple 1:1 file matching. 155 | # 156 | # git - String, Optional path to the git repository of the theme to be installed. 157 | # name - String, Optional name of the theme you want to install. 158 | # Passing name requires that the theme package already exist. 159 | # 160 | # Examples 161 | # 162 | # rake theme:install git="https://github.com/jekyllbootstrap/theme-twitter.git" 163 | # rake theme:install name="cool-theme" 164 | # 165 | # Returns Success/failure messages. 166 | desc "Install theme" 167 | task :install do 168 | if ENV["git"] 169 | manifest = theme_from_git_url(ENV["git"]) 170 | name = manifest["name"] 171 | else 172 | name = ENV["name"].to_s.downcase 173 | end 174 | 175 | packaged_theme_path = JB::Path.build(:theme_packages, :node => name) 176 | 177 | abort("rake aborted! 178 | => ERROR: 'name' cannot be blank") if name.empty? 179 | abort("rake aborted! 180 | => ERROR: '#{packaged_theme_path}' directory not found. 181 | => Installable themes can be added via git. You can find some here: http://github.com/jekyllbootstrap 182 | => To download+install run: `rake theme:install git='[PUBLIC-CLONE-URL]'` 183 | => example : rake theme:install git='git@github.com:jekyllbootstrap/theme-the-program.git' 184 | ") unless FileTest.directory?(packaged_theme_path) 185 | 186 | manifest = verify_manifest(packaged_theme_path) 187 | 188 | # Get relative paths to packaged theme files 189 | # Exclude directories as they'll be recursively created. Exclude meta-data files. 190 | packaged_theme_files = [] 191 | FileUtils.cd(packaged_theme_path) { 192 | Dir.glob("**/*.*") { |f| 193 | next if ( FileTest.directory?(f) || f =~ /^(manifest|readme|packager)/i ) 194 | packaged_theme_files << f 195 | } 196 | } 197 | 198 | # Mirror each file into the framework making sure to prompt if already exists. 199 | packaged_theme_files.each do |filename| 200 | file_install_path = File.join(JB::Path.base, filename) 201 | if File.exist? file_install_path and ask("#{file_install_path} already exists. Do you want to overwrite?", ['y', 'n']) == 'n' 202 | next 203 | else 204 | mkdir_p File.dirname(file_install_path) 205 | cp_r File.join(packaged_theme_path, filename), file_install_path 206 | end 207 | end 208 | 209 | puts "=> #{name} theme has been installed!" 210 | puts "=> ---" 211 | if ask("=> Want to switch themes now?", ['y', 'n']) == 'y' 212 | system("rake switch_theme name='#{name}'") 213 | end 214 | end 215 | 216 | # Public: Package a theme using the theme packager. 217 | # The theme must be structured using valid JB API. 218 | # In other words packaging is essentially the reverse of installing. 219 | # 220 | # name - String, Required name of the theme you want to package. 221 | # 222 | # Examples 223 | # 224 | # rake theme:package name="twitter" 225 | # 226 | # Returns Success/failure messages. 227 | desc "Package theme" 228 | task :package do 229 | name = ENV["name"].to_s.downcase 230 | theme_path = JB::Path.build(:themes, :node => name) 231 | asset_path = JB::Path.build(:theme_assets, :node => name) 232 | 233 | abort("rake aborted: name cannot be blank") if name.empty? 234 | abort("rake aborted: '#{theme_path}' directory not found.") unless FileTest.directory?(theme_path) 235 | abort("rake aborted: '#{asset_path}' directory not found.") unless FileTest.directory?(asset_path) 236 | 237 | ## Mirror theme's template directory (_includes) 238 | packaged_theme_path = JB::Path.build(:themes, :root => JB::Path.build(:theme_packages, :node => name)) 239 | mkdir_p packaged_theme_path 240 | cp_r theme_path, packaged_theme_path 241 | 242 | ## Mirror theme's asset directory 243 | packaged_theme_assets_path = JB::Path.build(:theme_assets, :root => JB::Path.build(:theme_packages, :node => name)) 244 | mkdir_p packaged_theme_assets_path 245 | cp_r asset_path, packaged_theme_assets_path 246 | 247 | ## Log packager version 248 | packager = {"packager" => {"version" => CONFIG["theme_package_version"].to_s } } 249 | open(JB::Path.build(:theme_packages, :node => "#{name}/packager.yml"), "w") do |page| 250 | page.puts packager.to_yaml 251 | end 252 | 253 | puts "=> '#{name}' theme is packaged and available at: #{JB::Path.build(:theme_packages, :node => name)}" 254 | end 255 | 256 | end # end namespace :theme 257 | 258 | # Internal: Download and process a theme from a git url. 259 | # Notice we don't know the name of the theme until we look it up in the manifest. 260 | # So we'll have to change the folder name once we get the name. 261 | # 262 | # url - String, Required url to git repository. 263 | # 264 | # Returns theme manifest hash 265 | def theme_from_git_url(url) 266 | tmp_path = JB::Path.build(:theme_packages, :node => "_tmp") 267 | abort("rake aborted: system call to git clone failed") if !system("git clone #{url} #{tmp_path}") 268 | manifest = verify_manifest(tmp_path) 269 | new_path = JB::Path.build(:theme_packages, :node => manifest["name"]) 270 | if File.exist?(new_path) && ask("=> #{new_path} theme package already exists. Override?", ['y', 'n']) == 'n' 271 | remove_dir(tmp_path) 272 | abort("rake aborted: '#{manifest["name"]}' already exists as theme package.") 273 | end 274 | 275 | remove_dir(new_path) if File.exist?(new_path) 276 | mv(tmp_path, new_path) 277 | manifest 278 | end 279 | 280 | # Internal: Process theme package manifest file. 281 | # 282 | # theme_path - String, Required. File path to theme package. 283 | # 284 | # Returns theme manifest hash 285 | def verify_manifest(theme_path) 286 | manifest_path = File.join(theme_path, "manifest.yml") 287 | manifest_file = File.open( manifest_path ) 288 | abort("rake aborted: repo must contain valid manifest.yml") unless File.exist? manifest_file 289 | manifest = YAML.load( manifest_file ) 290 | manifest_file.close 291 | manifest 292 | end 293 | 294 | def ask(message, valid_options) 295 | if valid_options 296 | answer = get_stdin("#{message} #{valid_options.to_s.gsub(/"/, '').gsub(/, /,'/')} ") while !valid_options.include?(answer) 297 | else 298 | answer = get_stdin(message) 299 | end 300 | answer 301 | end 302 | 303 | def get_stdin(message) 304 | print message 305 | STDIN.gets.chomp 306 | end 307 | 308 | #Load custom rake scripts 309 | Dir['_rake/*.rake'].each { |r| load r } 310 | --------------------------------------------------------------------------------