From d063ad37187d4c2a0c2b5dd5a25462f868f16370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=C5=9Fk=C4=B1n=20Gedik?= Date: Sun, 27 Dec 2015 18:03:29 +0200 Subject: [PATCH] add site --- .gitignore | 4 + _config.yml | 29 +++ _docs/README.md | 37 ++++ _docs/getting_started.md | 90 +++++++++ _docs/http-requests.md | 44 ++++ _docs/json.md | 21 ++ _docs/middlewares.md | 19 ++ _docs/rest.md | 30 +++ _docs/static_files.md | 20 ++ _docs/statics.md | 36 ++++ _docs/utilities.md | 16 ++ _docs/views.md | 62 ++++++ _docs/websockets.md | 41 ++++ _includes/doc-sidebar.md | 26 +++ _includes/footer.html | 18 ++ _includes/head.html | 13 ++ _includes/header.html | 33 +++ _includes/icon-github.html | 1 + _includes/icon-github.svg | 1 + _includes/icon-twitter.html | 1 + _includes/icon-twitter.svg | 1 + _layouts/default.html | 20 ++ _layouts/doc.html | 23 +++ _layouts/home.html | 18 ++ _layouts/page.html | 14 ++ _layouts/post.html | 15 ++ _posts/2015-12-27-hello.md | 8 + _sass/_base.scss | 207 +++++++++++++++++++ _sass/_layout.scss | 348 ++++++++++++++++++++++++++++++++ _sass/_syntax-highlighting.scss | 65 ++++++ blog/index.html | 20 ++ css/bootstrap.min.css | 14 ++ css/main.scss | 58 ++++++ docs.md | 19 ++ feed.xml | 30 +++ img/kemal.png | Bin 0 -> 4985 bytes index.html | 85 ++++++++ 37 files changed, 1487 insertions(+) create mode 100644 .gitignore create mode 100644 _config.yml create mode 100644 _docs/README.md create mode 100644 _docs/getting_started.md create mode 100644 _docs/http-requests.md create mode 100644 _docs/json.md create mode 100644 _docs/middlewares.md create mode 100644 _docs/rest.md create mode 100644 _docs/static_files.md create mode 100644 _docs/statics.md create mode 100644 _docs/utilities.md create mode 100644 _docs/views.md create mode 100644 _docs/websockets.md create mode 100644 _includes/doc-sidebar.md create mode 100644 _includes/footer.html create mode 100644 _includes/head.html create mode 100644 _includes/header.html create mode 100644 _includes/icon-github.html create mode 100644 _includes/icon-github.svg create mode 100644 _includes/icon-twitter.html create mode 100644 _includes/icon-twitter.svg create mode 100644 _layouts/default.html create mode 100644 _layouts/doc.html create mode 100644 _layouts/home.html create mode 100644 _layouts/page.html create mode 100644 _layouts/post.html create mode 100644 _posts/2015-12-27-hello.md create mode 100644 _sass/_base.scss create mode 100644 _sass/_layout.scss create mode 100644 _sass/_syntax-highlighting.scss create mode 100644 blog/index.html create mode 100755 css/bootstrap.min.css create mode 100644 css/main.scss create mode 100644 docs.md create mode 100644 feed.xml create mode 100644 img/kemal.png create mode 100644 index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..45e8ddf --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +_site +.sass-cache +.jekyll-metadata +.DS_Store diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..57eabdd --- /dev/null +++ b/_config.yml @@ -0,0 +1,29 @@ +# Site settings +title: Kemal +email: dogruyolserdar@gmail.com +description: 'Lightning Fast, Super Simple web framework for Crystal. Inspired by Sinatra' +baseurl: "" # the subpath of your site, e.g. /blog +url: "http://yourdomain.com" # the base hostname & protocol for your site +twitter_username: sdogruyol +github_username: sdogruyol + +# Build settings +markdown: redcarpet +highlighter: pygments +permalink: /blog/:year/:month/:day/:title/ + +collections: + docs: + output: true + +nav_bars: + - title: "Documents" + url: "/docs/getting_started" + - title: "Blog" + url: "/blog" + - title: "Github" + url: "http://github.com/sdogruyol/kemal" + +examples: + - title: "How to connect to Database" + url: https://github.com/sdogruyol/kemal-pg-sample diff --git a/_docs/README.md b/_docs/README.md new file mode 100644 index 0000000..ef9437f --- /dev/null +++ b/_docs/README.md @@ -0,0 +1,37 @@ +--- +layout: doc +--- + +# Kemal Documentation + +This README includes documentation of Kemal, the Crystal Web Framework. + +## What is Kemal? + +Kemal is a micro web framework written in Crystal language. It's strongly inspired from [Sinatra](www.sinatrarb.com). + +## What is Crystal? + +Crystal is a programming language based on *Ruby* syntax. + +## Advantages of using Kemal + + - Easy to learn and start to develop. + - Since it's working on LLVM, it's too fast. + - Easy deployment to *Heroku*. + +## The Name + +Kemal means *Mature, grown up* in Turkish. + +## How to start? + + - [Getting Started Tutorial](./getting_started.md) + - [Restful Web Services](./rest.md) + - [Websockets](./websockets.md) + - [Using Dynamic Views](./views.md) + - [HTTP Requests and Responses](./http-requests.md) + - [Serving Static Files](./statics.md) + - [Serving JSON API](./json.md) + - [Middlewares](./middlewares.md) + - [How to connect to Database](https://github.com/sdogruyol/kemal-pg-sample) diff --git a/_docs/getting_started.md b/_docs/getting_started.md new file mode 100644 index 0000000..8addd66 --- /dev/null +++ b/_docs/getting_started.md @@ -0,0 +1,90 @@ +--- +layout: doc +title: "Getting Started" +--- + +# Kemal Tutorial + +## 1. Install Crystal + +``` +brew update +brew install crystal-lang +``` + +## 2. Installing Kemal + +You should create your application first: + +``` +crystal init app your_app +cd your_app +``` + +Then add *kemal* to the `shard.yml` file as a dependency. + +``` +dependencies: + kemal: + github: sdogruyol/kemal + branch: master +``` + +You should run `shards` to get dependencies: + +``` +shards install +``` + +It will output something like that: + +``` +$ shards install +Updating https://github.com/sdogruyol/kemal.git +Installing kemal (master) +``` + +## 3. Include Kemal into your project + +Open `your_app/src/your_app.cr` and require `kemal` to use Kemal. + +```ruby +require 'kemal' +``` + +## 4. Hack your project + +Do some awesome stuff with awesome Kemal. + +```ruby +get "/" do + "Hello World!" +end +``` + +All the code should look like this: + +```ruby +require "kemal" + +get "/" do + "Hello World!" +end +``` + +## 5. Run your awesome web project. + +``` +crystal build --release src/your_app.cr +./your_app +``` + +You should see some logs like these: + +``` +[development] Kemal is ready to lead at http://0.0.0.0:3000 +2015-12-01 13:47:48 +0200 | 200 | GET / - (666µs) +2015-12-05 13:47:48 +0200 | 404 | GET /favicon.ico - (14µs) +``` + +Now you can be happy with your new, very fast, readable web project. diff --git a/_docs/http-requests.md b/_docs/http-requests.md new file mode 100644 index 0000000..85f423e --- /dev/null +++ b/_docs/http-requests.md @@ -0,0 +1,44 @@ +--- +layout: doc +title: HTTP Requests and Responses +--- + +# HTTP Request / Response Lifecycle + +Accessing the HTTP request/response environment (query params, body, content_type, headers, status_code) is super easy. You can use the environment returned from the block: + +```ruby + # Matches /hello/kemal + get "/hello/:name" do |env| + name = env.params["name"] + "Hello back to #{name}" + end + + # Matches /resize?width=200&height=200 + get "/resize" do |env| + width = env.params["width"] + height = env.params["height"] + end + + # Easily access JSON payload from the params. + # The request content type needs to be application/json + # The payload + # {"name": "Serdar", "likes": ["Ruby", "Crystal"]} + post "/json_params" do |env| + name = env.params["name"] as String + likes = env.params["likes"] as Array + "#{name} likes #{likes.each.join(',')}" + end + + # Set the content as application/json and return JSON + get "/user.json" do |env| + kemal = {name: "Kemal", language: "Crystal"} + env.content_type = "application/json" + kemal.to_json + end + + # Add headers to your response + get "/headers" do |env| + env.add_header "Accept-Language", "tr" + env.add_header "Authorization", "Token 12345" + end diff --git a/_docs/json.md b/_docs/json.md new file mode 100644 index 0000000..475869c --- /dev/null +++ b/_docs/json.md @@ -0,0 +1,21 @@ +--- +layout: doc +title: Serving JSON API +--- + +# Serving JSON API + +You need to return a ```JSON``` object or need to convert the existing object via `to_json`. + +```ruby +require "kemal" +require "json" + +# You can easily access the context and set content_type like 'application/json'. +# Look how easy to build a JSON serving API. +get "/" do |env| + env.content_type = "application/json" + {name: "Serdar", age: 27}.to_json +end + +``` diff --git a/_docs/middlewares.md b/_docs/middlewares.md new file mode 100644 index 0000000..e0e550e --- /dev/null +++ b/_docs/middlewares.md @@ -0,0 +1,19 @@ +--- +layout: doc +title: Middlewares +--- + +# Middlewares + +You can create your own middlewares by inheriting from ```HTTP::Handler``` + +```ruby +class CustomHandler < HTTP::Handler + def call(request) + puts "Doing some custom stuff here" + call_next request + end +end + +Kemal.config.add_handler CustomHandler.new +``` diff --git a/_docs/rest.md b/_docs/rest.md new file mode 100644 index 0000000..89812c3 --- /dev/null +++ b/_docs/rest.md @@ -0,0 +1,30 @@ +--- +layout: doc +title: Restful Web Services +--- + +# Restful Web Services + +You can handle HTTP methods as easy as writing method names and the route with a code block. Kemal will handle all the hard work. + +``` + get "/" do + .. show something .. + end + + post "/" do + .. create something .. + end + + put "/" do + .. replace something .. + end + + patch "/" do + .. modify something .. + end + + delete "/" do + .. annihilate something .. + end +``` diff --git a/_docs/static_files.md b/_docs/static_files.md new file mode 100644 index 0000000..395179d --- /dev/null +++ b/_docs/static_files.md @@ -0,0 +1,20 @@ +--- +layout: doc +title: Serving Static Files +--- + +## Static Files + +Kemal has built-in support for serving your static files. You need to put your static files under your ```/public``` directory. + +E.g: A static file like ```/public/index.html``` will be served with the matching route ```/index.html```. + +## Production / Development Mode + +By default Kemal starts in ```development```mode and logs to STDOUT. + +You can use ```production``` mode to redirect the output to a file. By default Kemal logs the output to ```kemal.log```. + +You can start Kemal in production mode by: + +```./your_app -e production``` diff --git a/_docs/statics.md b/_docs/statics.md new file mode 100644 index 0000000..e689fce --- /dev/null +++ b/_docs/statics.md @@ -0,0 +1,36 @@ +--- +layout: doc +title: Statics +--- + +# Statics + +Add your files to `public` directory and Kemal will serve these files immediately. + +``` +app/ + src/ + your_app.cr + public/ + js/ + jquery.js + your_app.js + css/ + your_app.css + index.html +``` + +Open index.html and add + +```html + + + + + + + + ... + + +``` diff --git a/_docs/utilities.md b/_docs/utilities.md new file mode 100644 index 0000000..4658302 --- /dev/null +++ b/_docs/utilities.md @@ -0,0 +1,16 @@ +--- +layout: doc +title: Utilities +--- + +# Browser Redirect +Just like other things in `kemal`, browser redirection is super simple as well. Use `environment` variable in defined route's corresponding block and call `redirect` on it. + +```ruby + # Redirect browser + get "/logout" do |env| + # important stuff like clearing session etc. + redirect "/login" # redirect to /login page + end +``` +_Make sure to receive `env` as param in defined route's block or you might end-up having compile-time errors._ diff --git a/_docs/views.md b/_docs/views.md new file mode 100644 index 0000000..a48190f --- /dev/null +++ b/_docs/views.md @@ -0,0 +1,62 @@ +--- +layout: doc +title: Using Dynamic Views +--- + +# Views + +You can use ERB-like built-in **ECR** views to render files. + +```ruby +get '/:name' do + render "views/hello.ecr" +end +``` + +And you should have an `hello.ecr` view. It will have the same context as the method. + +```erb +Hello <%= env.params["name"] %> +``` + +## Using Layouts + +You can use **layouts** in Kemal. You should pass a second argument. + +```ruby +get '/:name' do + render "views/subview.ecr", "views/layouts/layout.ecr" +end +``` + +And you should use `content` variable (like `yield` in Rails) in layout file. + +```erb + + + <%= $title %> + + + <%= content %> + + +``` + +## Using Common Paths + +Since Crystal does not allow using variables in macro literals, you need to generate +another *helper macro* to make the code easier to read and write. + +```ruby +macro my_renderer(filename) + render "my/app/view/base/path/#{{{filename}}}.ecr", "my/app/view/base/path/layouts/layout.ecr" +end +``` + +And now you can use your new renderer. + +```ruby +get '/:name' do + my_renderer "subview" +end +``` diff --git a/_docs/websockets.md b/_docs/websockets.md new file mode 100644 index 0000000..eb180b4 --- /dev/null +++ b/_docs/websockets.md @@ -0,0 +1,41 @@ +--- +layout: doc +title: Websockets +--- + +# Using Websockets + +Using Websockets is super easy! By nature Websockets are a bit different than standard Http Request/Response lifecycle. + +You can easily create a websocket handler which matches the route of `ws://host:port/route. You can create more than 1 websocket handler +with different routes. + +```ruby +ws "/" do |socket| + +end + +ws "/route2" do |socket| + +end +``` + +Let's access the socket and create a simple echo server. + +```ruby +# Matches "/" +ws "/" do |socket| + # Send welcome message to the client + socket.send "Hello from Kemal!" + + # Handle incoming message and echo back to the client + socket.on_message do |message| + socket.send "Echo back from server #{message}" + end + + # Executes when the client is disconnected. You can do the cleaning up here. + socket.on_close do + puts "Closing socket" + end +end +``` diff --git a/_includes/doc-sidebar.md b/_includes/doc-sidebar.md new file mode 100644 index 0000000..6629996 --- /dev/null +++ b/_includes/doc-sidebar.md @@ -0,0 +1,26 @@ +
+ +

Guide

+ + + +

Examples

+ + +
diff --git a/_includes/footer.html b/_includes/footer.html new file mode 100644 index 0000000..5f6295c --- /dev/null +++ b/_includes/footer.html @@ -0,0 +1,18 @@ + diff --git a/_includes/head.html b/_includes/head.html new file mode 100644 index 0000000..6fb066a --- /dev/null +++ b/_includes/head.html @@ -0,0 +1,13 @@ + + + + + + {% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %} + + + + + + + diff --git a/_includes/header.html b/_includes/header.html new file mode 100644 index 0000000..cd06750 --- /dev/null +++ b/_includes/header.html @@ -0,0 +1,33 @@ + diff --git a/_includes/icon-github.html b/_includes/icon-github.html new file mode 100644 index 0000000..e501a16 --- /dev/null +++ b/_includes/icon-github.html @@ -0,0 +1 @@ +{% include icon-github.svg %}{{ include.username }} diff --git a/_includes/icon-github.svg b/_includes/icon-github.svg new file mode 100644 index 0000000..4422c4f --- /dev/null +++ b/_includes/icon-github.svg @@ -0,0 +1 @@ + diff --git a/_includes/icon-twitter.html b/_includes/icon-twitter.html new file mode 100644 index 0000000..e623dbd --- /dev/null +++ b/_includes/icon-twitter.html @@ -0,0 +1 @@ +{{ include.username }} diff --git a/_includes/icon-twitter.svg b/_includes/icon-twitter.svg new file mode 100644 index 0000000..dcf660e --- /dev/null +++ b/_includes/icon-twitter.svg @@ -0,0 +1 @@ + diff --git a/_layouts/default.html b/_layouts/default.html new file mode 100644 index 0000000..e4ab96f --- /dev/null +++ b/_layouts/default.html @@ -0,0 +1,20 @@ + + + + {% include head.html %} + + + + {% include header.html %} + +
+
+ {{ content }} +
+
+ + {% include footer.html %} + + + + diff --git a/_layouts/doc.html b/_layouts/doc.html new file mode 100644 index 0000000..0b6d00e --- /dev/null +++ b/_layouts/doc.html @@ -0,0 +1,23 @@ +--- +layout: default +--- + +
+ +
+ +
+

{{ page.title }}

+
+ +
+ {{ content }} +
+ +
+ +
+ {% include doc-sidebar.md %} +
+ +
diff --git a/_layouts/home.html b/_layouts/home.html new file mode 100644 index 0000000..4176004 --- /dev/null +++ b/_layouts/home.html @@ -0,0 +1,18 @@ + + + + {% include head.html %} + + + + {% include header.html %} + +
+ {{ content }} +
+ + {% include footer.html %} + + + + diff --git a/_layouts/page.html b/_layouts/page.html new file mode 100644 index 0000000..ce233ad --- /dev/null +++ b/_layouts/page.html @@ -0,0 +1,14 @@ +--- +layout: default +--- +
+ +
+

{{ page.title }}

+
+ +
+ {{ content }} +
+ +
diff --git a/_layouts/post.html b/_layouts/post.html new file mode 100644 index 0000000..3a0fb52 --- /dev/null +++ b/_layouts/post.html @@ -0,0 +1,15 @@ +--- +layout: default +--- +
+ +
+

{{ page.title }}

+ +
+ +
+ {{ content }} +
+ +
diff --git a/_posts/2015-12-27-hello.md b/_posts/2015-12-27-hello.md new file mode 100644 index 0000000..2fe8873 --- /dev/null +++ b/_posts/2015-12-27-hello.md @@ -0,0 +1,8 @@ +--- +layout: post +title: Hello World +--- + +Hello World! + + diff --git a/_sass/_base.scss b/_sass/_base.scss new file mode 100644 index 0000000..b52fdc4 --- /dev/null +++ b/_sass/_base.scss @@ -0,0 +1,207 @@ +/** + * Reset some basic elements + */ +body, h1, h2, h3, h4, h5, h6, +p, blockquote, pre, hr, +dl, dd, ol, ul, figure { + margin: 0; + padding: 0; +} + + + +/** + * Basic styling + */ +body { + font: $base-font-weight #{$base-font-size}/#{$base-line-height} $base-font-family; + color: $text-color; + background-color: $background-color; + -webkit-text-size-adjust: 100%; + -webkit-font-feature-settings: "kern" 1; + -moz-font-feature-settings: "kern" 1; + -o-font-feature-settings: "kern" 1; + font-feature-settings: "kern" 1; + font-kerning: normal; +} + + + +/** + * Set `margin-bottom` to maintain vertical rhythm + */ +h1, h2, h3, h4, h5, h6, +p, blockquote, pre, +ul, ol, dl, figure, +%vertical-rhythm { + margin-bottom: $spacing-unit / 2; +} + + + +/** + * Images + */ +img { + max-width: 100%; + vertical-align: middle; +} + + + +/** + * Figures + */ +figure > img { + display: block; +} + +figcaption { + font-size: $small-font-size; +} + + + +/** + * Lists + */ +ul, ol { + margin-left: $spacing-unit; +} + +li { + > ul, + > ol { + margin-bottom: 0; + } +} + + + +/** + * Headings + */ +h1, h2, h3, h4, h5, h6 { + font-weight: $base-font-weight; +} + + + +/** + * Links + */ +a { + color: $brand-color; + text-decoration: none; + + &:visited { + color: darken($brand-color, 15%); + } + + &:hover { + color: $red-color-light; + text-decoration: underline; + } +} + + + +/** + * Blockquotes + */ +blockquote { + color: $grey-color; + border-left: 4px solid $grey-color-light; + padding-left: $spacing-unit / 2; + font-size: 18px; + letter-spacing: -1px; + font-style: italic; + + > :last-child { + margin-bottom: 0; + } +} + + + +/** + * Code formatting + */ +pre, +code { + font-size: 15px; + border: 1px solid $grey-color-light; + border-radius: 3px; + background-color: #f9f9f9; +} + +code { + padding: 1px 5px; +} + +pre { + padding: 8px 12px; + overflow-x: auto; + + > code { + border: 0; + padding-right: 0; + padding-left: 0; + } +} + + + +/** + * Wrapper + */ +.wrapper { + max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit} * 2)); + max-width: calc(#{$content-width} - (#{$spacing-unit} * 2)); + margin-right: auto; + margin-left: auto; + padding-right: $spacing-unit; + padding-left: $spacing-unit; + @extend %clearfix; + + @include media-query($on-laptop) { + max-width: -webkit-calc(#{$content-width} - (#{$spacing-unit})); + max-width: calc(#{$content-width} - (#{$spacing-unit})); + padding-right: $spacing-unit / 2; + padding-left: $spacing-unit / 2; + } +} + + + +/** + * Clearfix + */ +%clearfix { + + &:after { + content: ""; + display: table; + clear: both; + } +} + + + +/** + * Icons + */ +.icon { + + > svg { + display: inline-block; + width: 16px; + height: 16px; + vertical-align: middle; + + path { + fill: $grey-color; + } + } +} + diff --git a/_sass/_layout.scss b/_sass/_layout.scss new file mode 100644 index 0000000..de08154 --- /dev/null +++ b/_sass/_layout.scss @@ -0,0 +1,348 @@ +/** + * Site header + */ +.site-header { + border-top: 7px solid $red-color; + border-bottom: 1px solid $grey-color-light; + min-height: 56px; + + // Positioning context for the mobile navigation icon + position: relative; +} + +.site-title { + font-size: 26px; + font-weight: 300; + line-height: 90px; + letter-spacing: -1px; + margin-bottom: 0; + float: left; + + &, + &:visited { + color: $grey-color-dark; + } +} +.site-title img { + width: 60px; +} + +.site-nav { + float: right; + line-height: 90px; + + .menu-icon { + display: none; + } + + .page-link { + color: $text-color; + line-height: $base-line-height; + + // Gaps between nav items, but not on the last one + &:not(:last-child) { + margin-right: 20px; + } + } + + @include media-query($on-palm) { + position: absolute; + top: 26px; + right: $spacing-unit / 2; + background-color: $background-color; + border: 1px solid $grey-color-light; + border-radius: 5px; + text-align: right; + + .menu-icon { + display: block; + float: right; + width: 36px; + height: 26px; + line-height: 0; + padding-top: 10px; + text-align: center; + + > svg { + width: 18px; + height: 15px; + + path { + fill: $grey-color-dark; + } + } + } + + .trigger { + clear: both; + display: none; + } + + &:hover .trigger { + display: block; + padding-bottom: 5px; + } + + .page-link { + display: block; + padding: 5px 10px; + + &:not(:last-child) { + margin-right: 0; + } + margin-left: 20px; + } + } +} + + + +/** + * Site footer + */ +.site-footer { + border-top: 1px solid $grey-color-light; + margin-top: 40px; + padding: $spacing-unit 0; +} + +.footer-heading { + font-size: 18px; + margin-bottom: $spacing-unit / 2; +} + +.contact-list, +.social-media-list { + list-style: none; + margin-left: 0; +} + +.footer-col-wrapper { + font-size: 15px; + color: $grey-color; + margin-left: -$spacing-unit / 2; + @extend %clearfix; +} + +.footer-col { + float: left; + margin-bottom: $spacing-unit / 2; + padding-left: $spacing-unit / 2; +} + +.footer-col-1 { + width: -webkit-calc(35% - (#{$spacing-unit} / 2)); + width: calc(35% - (#{$spacing-unit} / 2)); +} + +.footer-col-2 { + width: -webkit-calc(20% - (#{$spacing-unit} / 2)); + width: calc(20% - (#{$spacing-unit} / 2)); +} + +.footer-col-3 { + width: -webkit-calc(45% - (#{$spacing-unit} / 2)); + width: calc(45% - (#{$spacing-unit} / 2)); +} + +@include media-query($on-laptop) { + .footer-col-1, + .footer-col-2 { + width: -webkit-calc(50% - (#{$spacing-unit} / 2)); + width: calc(50% - (#{$spacing-unit} / 2)); + } + + .footer-col-3 { + width: -webkit-calc(100% - (#{$spacing-unit} / 2)); + width: calc(100% - (#{$spacing-unit} / 2)); + } +} + +@include media-query($on-palm) { + .footer-col { + float: none; + width: -webkit-calc(100% - (#{$spacing-unit} / 2)); + width: calc(100% - (#{$spacing-unit} / 2)); + } +} + + + +/** + * Page content + */ +.page-content { + padding: $spacing-unit 0; +} + +.page-heading { + font-size: 20px; +} + +.post-list { + margin-left: 0; + list-style: none; + + > li { + margin-bottom: $spacing-unit; + } +} + +.post-meta { + font-size: $small-font-size; + color: $grey-color; +} + +.post-link { + display: block; + font-size: 24px; +} + + + +/** + * Posts + */ +.post-header { + margin-bottom: $spacing-unit; +} + +.post-title { + font-size: 42px; + letter-spacing: -1px; + line-height: 1; + + @include media-query($on-laptop) { + font-size: 36px; + } +} + +.post-content { + margin-bottom: $spacing-unit; + + h2 { + font-size: 32px; + + @include media-query($on-laptop) { + font-size: 28px; + } + } + + h3 { + font-size: 26px; + + @include media-query($on-laptop) { + font-size: 22px; + } + } + + h4 { + font-size: 20px; + + @include media-query($on-laptop) { + font-size: 18px; + } + } +} + + +/** + * doc content + */ + +.doc-sidebar { + background: #f8f8f8; + // padding: $spacing-unit/2; + border-bottom: 1px solid #ccc; + text-shadow: 0 1px 0 #fff; + padding: 20px 24px; + -webkit-box-shadow: 0 0 3px rgba(0,0,0,0.4); + -moz-box-shadow: 0 0 3px rgba(0,0,0,0.4); + box-shadow: 0 0 3px rgba(0,0,0,0.4); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.doc { +} +.doc-content { +} + +.doc-heading { + padding: 0 0 9px; + border-bottom: 1px solid #ccc; + color: #111; + font-size: 20px; + line-height: 20px; +} + +.doc-list { + margin-left: 0px; + margin-bottom: 24px; + list-style: none; + + > li { + margin: 6px 0; + font-size: 15px; + line-height: 20px + } +} + +.doc-meta { + font-size: $small-font-size; + color: $grey-color; +} + +.doc-link { + display: block; + font-size: 13px; +} + +.hero { + background: #f1f1f1; + text-align: center; + padding: 40px 0; + margin-bottom: 40px; + img { + width: 13%; + } + h1 { + font-size: 55px; + margin: 0px; + } + .button { + display: inline-block; + background: $red-color-light; + color: white; + padding: 8px 20px; + font-size: 16px; + line-height: 20px; + text-decoration: none; + margin: 0 3px 0 0; + font-weight: normal; + -webkit-border-radius: 6px; + -moz-border-radius: 6px; + border-radius: 6px; + -webkit-box-shadow: 0 2px 0 $red-color-dark; + -moz-box-shadow: 0 2px 0 $red-color-dark; + box-shadow: 0 2px 0 $red-color-dark; + } +} + +.footer-develop { + text-align: right; + h4 { + font-size: 13px; + } + h5 { + font-size: 11px; + } +} + +.block { + margin-top: 40px; + h1 { + text-align: center; + } +} + diff --git a/_sass/_syntax-highlighting.scss b/_sass/_syntax-highlighting.scss new file mode 100644 index 0000000..15ad797 --- /dev/null +++ b/_sass/_syntax-highlighting.scss @@ -0,0 +1,65 @@ +.highlight .hll { background-color: #ffc; } +.highlight .c { color: #999; } /* Comment */ +.highlight .err { color: #a00; background-color: #faa } /* Error */ +.highlight .k { color: #069; } /* Keyword */ +.highlight .o { color: #555 } /* Operator */ +.highlight .cm { color: #09f; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #099 } /* Comment.Preproc */ +.highlight .c1 { color: #999; } /* Comment.Single */ +.highlight .cs { color: #999; } /* Comment.Special */ +.highlight .gd { background-color: #fcc; border: 1px solid #c00 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .gr { color: #f00 } /* Generic.Error */ +.highlight .gh { color: #030; } /* Generic.Heading */ +.highlight .gi { background-color: #cfc; border: 1px solid #0c0 } /* Generic.Inserted */ +.highlight .go { color: #aaa } /* Generic.Output */ +.highlight .gp { color: #009; } /* Generic.Prompt */ +.highlight .gs { } /* Generic.Strong */ +.highlight .gu { color: #030; } /* Generic.Subheading */ +.highlight .gt { color: #9c6 } /* Generic.Traceback */ +.highlight .kc { color: #069; } /* Keyword.Constant */ +.highlight .kd { color: #069; } /* Keyword.Declaration */ +.highlight .kn { color: #069; } /* Keyword.Namespace */ +.highlight .kp { color: #069 } /* Keyword.Pseudo */ +.highlight .kr { color: #069; } /* Keyword.Reserved */ +.highlight .kt { color: #078; } /* Keyword.Type */ +.highlight .m { color: #f60 } /* Literal.Number */ +.highlight .s { color: #d44950 } /* Literal.String */ +.highlight .na { color: #4f9fcf } /* Name.Attribute */ +.highlight .nb { color: #366 } /* Name.Builtin */ +.highlight .nc { color: #0a8; } /* Name.Class */ +.highlight .no { color: #360 } /* Name.Constant */ +.highlight .nd { color: #99f } /* Name.Decorator */ +.highlight .ni { color: #999; } /* Name.Entity */ +.highlight .ne { color: #c00; } /* Name.Exception */ +.highlight .nf { color: #c0f } /* Name.Function */ +.highlight .nl { color: #99f } /* Name.Label */ +.highlight .nn { color: #0cf; } /* Name.Namespace */ +.highlight .nt { color: #2f6f9f; } /* Name.Tag */ +.highlight .nv { color: #033 } /* Name.Variable */ +.highlight .ow { color: #000; } /* Operator.Word */ +.highlight .w { color: #bbb } /* Text.Whitespace */ +.highlight .mf { color: #f60 } /* Literal.Number.Float */ +.highlight .mh { color: #f60 } /* Literal.Number.Hex */ +.highlight .mi { color: #f60 } /* Literal.Number.Integer */ +.highlight .mo { color: #f60 } /* Literal.Number.Oct */ +.highlight .sb { color: #c30 } /* Literal.String.Backtick */ +.highlight .sc { color: #c30 } /* Literal.String.Char */ +.highlight .sd { color: #c30; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #c30 } /* Literal.String.Double */ +.highlight .se { color: #c30; } /* Literal.String.Escape */ +.highlight .sh { color: #c30 } /* Literal.String.Heredoc */ +.highlight .si { color: #a00 } /* Literal.String.Interpol */ +.highlight .sx { color: #c30 } /* Literal.String.Other */ +.highlight .sr { color: #3aa } /* Literal.String.Regex */ +.highlight .s1 { color: #c30 } /* Literal.String.Single */ +.highlight .ss { color: #fc3 } /* Literal.String.Symbol */ +.highlight .bp { color: #366 } /* Name.Builtin.Pseudo */ +.highlight .vc { color: #033 } /* Name.Variable.Class */ +.highlight .vg { color: #033 } /* Name.Variable.Global */ +.highlight .vi { color: #033 } /* Name.Variable.Instance */ +.highlight .il { color: #f60 } /* Literal.Number.Integer.Long */ + +.css .o, +.css .o + .nt, +.css .nt + .nt { color: #999; } diff --git a/blog/index.html b/blog/index.html new file mode 100644 index 0000000..8cfa282 --- /dev/null +++ b/blog/index.html @@ -0,0 +1,20 @@ +--- +layout: default +--- + +
+ +

Posts

+ + +
diff --git a/css/bootstrap.min.css b/css/bootstrap.min.css new file mode 100755 index 0000000..c38ee33 --- /dev/null +++ b/css/bootstrap.min.css @@ -0,0 +1,14 @@ +/*! + * Bootstrap v3.3.5 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! + * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=ff317cae859e2b9ad257) + * Config saved to config.json and https://gist.github.com/ff317cae859e2b9ad257 + *//*! + * Bootstrap v3.3.6 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:hover,a:focus{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}.clearfix:before,.clearfix:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after{content:" ";display:table}.clearfix:after,.container:after,.container-fluid:after,.row:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed} \ No newline at end of file diff --git a/css/main.scss b/css/main.scss new file mode 100644 index 0000000..210e146 --- /dev/null +++ b/css/main.scss @@ -0,0 +1,58 @@ +--- +# Only the main Sass file needs front matter (the dashes are enough) +--- +@charset "utf-8"; + + + +// Our variables +$base-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; +$base-font-size: 16px; +$base-font-weight: 400; +$small-font-size: $base-font-size * 0.875; +$base-line-height: 1.5; + +$spacing-unit: 30px; + +$text-color: #525252; +$background-color: #fdfdfd; +$brand-color: #2a7ae2; + +$grey-color: #828282; +// $grey-color: #525252; +$grey-color-light: lighten($grey-color, 40%); +$grey-color-dark: darken($grey-color, 25%); + +$red-color: #f92727; +$red-color-light: #ff4f4f; +$red-color-dark: darken($red-color, 25%); + +// Width of the content area +$content-width: 1024px; + +$on-palm: 600px; +$on-laptop: 800px; + + + +// Use media queries like this: +// @include media-query($on-palm) { +// .wrapper { +// padding-right: $spacing-unit / 2; +// padding-left: $spacing-unit / 2; +// } +// } +@mixin media-query($device) { + @media screen and (max-width: $device) { + @content; + } +} + + + +// Import partials from `sass_dir` (defaults to `_sass`) +@import + "base", + "layout", + "syntax-highlighting" +; diff --git a/docs.md b/docs.md new file mode 100644 index 0000000..343445b --- /dev/null +++ b/docs.md @@ -0,0 +1,19 @@ +--- +layout: default +--- + +
+ +

Documents

+ + + +
diff --git a/feed.xml b/feed.xml new file mode 100644 index 0000000..a6628bd --- /dev/null +++ b/feed.xml @@ -0,0 +1,30 @@ +--- +layout: null +--- + + + + {{ site.title | xml_escape }} + {{ site.description | xml_escape }} + {{ site.url }}{{ site.baseurl }}/ + + {{ site.time | date_to_rfc822 }} + {{ site.time | date_to_rfc822 }} + Jekyll v{{ jekyll.version }} + {% for post in site.posts limit:10 %} + + {{ post.title | xml_escape }} + {{ post.content | xml_escape }} + {{ post.date | date_to_rfc822 }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {{ post.url | prepend: site.baseurl | prepend: site.url }} + {% for tag in post.tags %} + {{ tag | xml_escape }} + {% endfor %} + {% for cat in post.categories %} + {{ cat | xml_escape }} + {% endfor %} + + {% endfor %} + + diff --git a/img/kemal.png b/img/kemal.png new file mode 100644 index 0000000000000000000000000000000000000000..926c95fcf0146779403e29787afb7504fdf2aac3 GIT binary patch literal 4985 zcmeHL`#)6q|3B`xkgOD8OQlHdR^&Dat*tFHbf%$kD_tkKHppP6a#@ww&8(6!hGdM( zx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XZO20T#^q9wrKXFc~jIQ zUMmuUb~TT%yk-0R{trOK{CtwRbG@7mWV+6!2qoKU?dD3=fE67J$RdG!sJ{UK%G=m{ rdBSB?J%FP2zw19%191TK7fmXSMJLR(%Q<^P0dV}7hg-Qz;O&0_5kyuE literal 0 HcmV?d00001 diff --git a/index.html b/index.html new file mode 100644 index 0000000..e631df8 --- /dev/null +++ b/index.html @@ -0,0 +1,85 @@ +--- +layout: home +--- + +
+

+ kemal + Kemal +

+

+ Kemal is a micro web framework written in Crystal language. +
+ It's strongly inspired from Sinatra. +

+ Start Now! +
+ +
+
+
+

Super Simple

+ + {% highlight ruby %} + require "kemal" + + # Matches GET "http://host:port/" + get "/" do + "Hello World!" + end + + # Creates a WebSocket handler. + # Matches "ws://host:port/socket" + ws "/socket" do |socket| + socket.send "Hello from Kemal!" + end + {% endhighlight %} +
+ +
+

Features

+
    +
  • Support all REST verbs
  • +
  • Websocket support
  • +
  • Request/Response context, easy parameter handling
  • +
  • Middlewares
  • +
  • Built-in JSON support
  • +
  • Built-in static file serving
  • +
  • Built-in view templating via ecr
  • +
+
+
+
+ +
+
+
+

Benchmarks

+ +

Numbers speak louder than words.

+ + + + + + + + + + + + + + + + + + +
FrameworkRequest Per SecondAvg. Response Time
Kemal (Production)64986170μs
Sinatra (Thin)227443.82ms
+ +
+

These results were achieved with wrk on a Macbook Pro Late 2013. (2Ghz i7 8GB Ram OS X Yosemite)

+ +
+
+