diff --git a/Gemfile b/Gemfile index 65ff651..a6d0f88 100644 --- a/Gemfile +++ b/Gemfile @@ -13,6 +13,7 @@ gem 'html-proofer' gem 'scss_lint' group :jekyll_plugins do + gem 'jekyll-assets' gem 'jekyll-multiple-languages-plugin' gem 'jekyll-sitemap' end diff --git a/Gemfile.lock b/Gemfile.lock index 3af0d7d..619875a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -17,6 +17,9 @@ GEM ethon (0.11.0) ffi (>= 1.3.0) eventmachine (1.2.7) + extras (0.3.0) + forwardable-extended (~> 2.5) + fastimage (2.1.4) ffi (1.9.25) forwardable-extended (2.6.0) html-proofer (3.9.2) @@ -44,6 +47,14 @@ GEM pathutil (~> 0.9) rouge (>= 1.7, < 4) safe_yaml (~> 1.0) + jekyll-assets (2.4.0) + concurrent-ruby (~> 1.0) + extras (~> 0.2) + fastimage (~> 2.0, >= 1.8) + jekyll (~> 3.1, >= 3.0) + pathutil (>= 0.8) + rack (~> 1.6) + sprockets (~> 3.3, < 3.8) jekyll-feed (0.10.0) jekyll (~> 3.3) jekyll-multiple-languages-plugin (1.5.1) @@ -95,6 +106,9 @@ GEM scss_lint (0.57.0) rake (>= 0.9, < 13) sass (~> 3.5.5) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) thread_safe (0.3.6) typhoeus (1.3.0) ethon (>= 0.9.0) @@ -108,6 +122,7 @@ PLATFORMS DEPENDENCIES html-proofer jekyll (>= 3.7.4) + jekyll-assets jekyll-multiple-languages-plugin jekyll-sitemap minima diff --git a/_config.production.yml b/_config.production.yml index 06e32e3..b4b7d5b 100644 --- a/_config.production.yml +++ b/_config.production.yml @@ -16,6 +16,7 @@ exclude_from_localizations: ['javascript', 'images', 'css'] markdown: kramdown theme: minima plugins: + - jekyll-assets - jekyll-feed - jekyll-multiple-languages-plugin - jekyll-sitemap @@ -26,3 +27,17 @@ counters: webmaster: 'XXXXXXXXXXXXXXXX' google: analytics: 'XX-XXXXXXXXX-X' + +assets: + destination: '/assets' + source_maps: false + compression: true + gzip: true + defaults: + js: { integrity: true } + css: { integrity: true } + img: { integrity: true } + caching: + path: '.jekyll-cache/assets' + type: memory + enabled: true diff --git a/_config.staging.yml b/_config.staging.yml index 0f26813..01e612a 100644 --- a/_config.staging.yml +++ b/_config.staging.yml @@ -16,6 +16,21 @@ exclude_from_localizations: ['javascript', 'images', 'css'] markdown: kramdown theme: minima plugins: + - jekyll-assets - jekyll-feed - jekyll-multiple-languages-plugin - jekyll-sitemap + +assets: + destination: '/assets' + source_maps: false + compression: true + gzip: true + defaults: + js: { integrity: true } + css: { integrity: true } + img: { integrity: true } + caching: + path: '.jekyll-cache/assets' + type: memory + enabled: true diff --git a/_config.yml b/_config.yml index 3a00669..c47b734 100644 --- a/_config.yml +++ b/_config.yml @@ -3,7 +3,7 @@ encoding: utf-8 collections: pages: output: true - permalink: /:path + permalink: /:slug languages: - en @@ -14,6 +14,21 @@ exclude_from_localizations: ['javascript', 'images', 'css'] markdown: kramdown theme: minima plugins: + - jekyll-assets - jekyll-feed - jekyll-multiple-languages-plugin - jekyll-sitemap + +assets: + destination: '/assets' + source_maps: false + compression: true + gzip: false + defaults: + js: { integrity: false } + css: { integrity: false } + img: { integrity: false } + caching: + path: '.jekyll-cache/assets' + type: mempry + enabled: true diff --git a/_i18n/en.yml b/_i18n/en.yml index 0492aec..52b79b8 100644 --- a/_i18n/en.yml +++ b/_i18n/en.yml @@ -43,6 +43,7 @@ sidebar: - queue - deque - singly_linked_list + - doubly_linked_list - ordered_list - hash_table - binary_tree diff --git a/_includes/algorithm_complexity_header.html b/_includes/algorithm_complexity_header.html index c905aba..fd553c4 100644 --- a/_includes/algorithm_complexity_header.html +++ b/_includes/algorithm_complexity_header.html @@ -1,4 +1,4 @@ - + {% t pages.algorithms.complexity.best %} {% t pages.algorithms.complexity.average %} diff --git a/_includes/data_structure_complexity_header.html b/_includes/data_structure_complexity_header.html index fd7f993..e64ccdd 100644 --- a/_includes/data_structure_complexity_header.html +++ b/_includes/data_structure_complexity_header.html @@ -1,4 +1,4 @@ - + Average Access Average Search diff --git a/_includes/head.html b/_includes/head.html index 7d826b3..e21e447 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,4 +1,6 @@ -{% t head.title %} +{% assign key = page.url | remove_first: '/' %} +{% assign title = site.translations[site.lang].pages[key].title %} +{% t head.title %} - {{ title }} @@ -16,9 +18,11 @@ {% endif %} - + + + diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 3d9803e..0227989 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -20,12 +20,13 @@ {%- endif -%} {%- endcapture -%} {% assign location = page.url | replace: '/', '' %} + {% assign link = link | replace: '_', '-' %} {%- if location == link -%}
  • - + {{ site.translations[site.lang].pages[menu.url][submenu].title }}
  • diff --git a/_includes/sponsors/234x60.html b/_includes/sponsors/234x60.html index d85ecd9..a480cd2 100644 --- a/_includes/sponsors/234x60.html +++ b/_includes/sponsors/234x60.html @@ -1,3 +1,3 @@ diff --git a/_pages/algorithms.html b/_pages/algorithms.html index 8ac6fe6..8d10223 100644 --- a/_pages/algorithms.html +++ b/_pages/algorithms.html @@ -14,9 +14,9 @@

    {% t pages.algorithms.sorting.title %}

    -

    {% t pages.algorithms.sorting.bubble_sort.title %}

    +

    {% t pages.algorithms.sorting.bubble_sort.title %}

    {% t pages.algorithms.sorting.bubble_sort.description %}

    - +
    {% include algorithm_complexity_header.html %} @@ -86,9 +86,9 @@

    {% t pages.algorithms.sorting.bubble_sort.title %}

    -

    {% t pages.algorithms.sorting.insertion_sort.title %}

    +

    {% t pages.algorithms.sorting.insertion_sort.title %}

    {% t pages.algorithms.sorting.insertion_sort.description %}

    -
    +
    {% include algorithm_complexity_header.html %} @@ -128,9 +128,9 @@

    {% t pages.algorithms.sorting.insertion_sort.title %} -

    {% t pages.algorithms.sorting.selection_sort.title %}

    +

    {% t pages.algorithms.sorting.selection_sort.title %}

    {% t pages.algorithms.sorting.selection_sort.description %}

    -
    +
    {% include algorithm_complexity_header.html %} @@ -185,9 +185,9 @@

    {% t pages.algorithms.sorting.selection_sort.title %}
    -

    {% t pages.algorithms.sorting.shell_sort.title %}

    +

    {% t pages.algorithms.sorting.shell_sort.title %}

    {% t pages.algorithms.sorting.shell_sort.description %}

    -

    +
    {% include algorithm_complexity_header.html %} @@ -229,9 +229,9 @@

    {% t pages.algorithms.sorting.shell_sort.title %}

    {% include sponsors/728x90.html %}
    -

    {% t pages.algorithms.sorting.heap_sort.title %}

    +

    {% t pages.algorithms.sorting.heap_sort.title %}

    {% t pages.algorithms.sorting.heap_sort.description %}

    -
    +
    {% include algorithm_complexity_header.html %} @@ -287,9 +287,9 @@

    {% t pages.algorithms.sorting.heap_sort.title %}

    -

    {% t pages.algorithms.sorting.merge_sort.title %}

    +

    {% t pages.algorithms.sorting.merge_sort.title %}

    {% t pages.algorithms.sorting.merge_sort.description %}

    -
    +
    {% include algorithm_complexity_header.html %} @@ -327,9 +327,9 @@

    {% t pages.algorithms.sorting.merge_sort.title %}

    -

    {% t pages.algorithms.sorting.quick_sort.title %}

    +

    {% t pages.algorithms.sorting.quick_sort.title %}

    {% t pages.algorithms.sorting.quick_sort.description %}

    -
    +
    {% include algorithm_complexity_header.html %} @@ -382,10 +382,10 @@

    {% t pages.algorithms.searching.title %}

    - +

    {% t pages.algorithms.searching.binary_search.description %}

    -
    - +
    + @@ -437,7 +437,7 @@ +

    {% t pages.algorithms.searching.knuth_moriss_pratt_search.description %}

    {% t pages.wiki %} diff --git a/_pages/data_structures.html b/_pages/data_structures.html index 0cee186..f1be7b8 100644 --- a/_pages/data_structures.html +++ b/_pages/data_structures.html @@ -15,7 +15,7 @@

    {% t pages.data_structures.axioms.title %}

    -

    {% t pages.data_structures.axioms.fetch_store.title %}

    +

    {% t pages.data_structures.axioms.fetch_store.title %}

    {% t pages.data_structures.axioms.fetch_store.description1 %}

    {% t pages.data_structures.axioms.fetch_store.title %}

    @@ -47,7 +47,7 @@

    {% t pages.data_structures.axioms.elementary_operations.title %}

    -

    {% t pages.data_structures.axioms.call_method.title %}

    +

    {% t pages.data_structures.axioms.call_method.title %}

    {% t pages.data_structures.axioms.call_method.description1 %}

    {% t pages.data_structures.axioms.call_method.title %}

    @@ -111,7 +111,7 @@

    {% t pages.data_structures.implementations.title %}

    {% t pages.data_structures.implementations.stack.title %}

    {% t pages.data_structures.implementations.stack.description %}

    -
    {% t pages.algorithms.complexity.best %} {% t pages.algorithms.complexity.average %}
    +
    {% include data_structure_complexity_header.html %} @@ -268,7 +268,7 @@

    {% t pages.data_structures.implementations.stack.title %}

    {% t pages.data_structures.implementations.queue.title %}

    {% t pages.data_structures.implementations.queue.description %}

    -
    +
    {% include data_structure_complexity_header.html %} @@ -367,7 +367,7 @@

    {% t pages.data_structures.implementations.queue.title %}

    {% t pages.data_structures.implementations.deque.title %}

    {% t pages.data_structures.implementations.deque.description %}

    -
    +
    {% include data_structure_complexity_header.html %} @@ -472,9 +472,9 @@

    {% t pages.data_structures.implementations.deque.title %}

    -

    {% t pages.data_structures.implementations.singly_linked_list.title %}

    +

    {% t pages.data_structures.implementations.singly_linked_list.title %}

    {% t pages.data_structures.implementations.singly_linked_list.description %}

    -
    +
    {% include data_structure_complexity_header.html %} @@ -620,9 +620,9 @@

    {% t pages.data_structures.implementations.singly_li
    -

    {% t pages.data_structures.implementations.doubly_linked_list.title %}

    +

    {% t pages.data_structures.implementations.doubly_linked_list.title %}

    {% t pages.data_structures.implementations.doubly_linked_list.description %}

    -

    +
    {% include data_structure_complexity_header.html %} @@ -711,9 +711,9 @@

    {% t pages.data_structures.implementations.doubly_linked_list.title %}

    -

    {% t pages.data_structures.implementations.ordered_list.title %}

    +

    {% t pages.data_structures.implementations.ordered_list.title %}

    {% t pages.data_structures.implementations.ordered_list.description %}

    -
    +
    {% include data_structure_complexity_header.html %} @@ -830,9 +830,9 @@

    {% t pages.data_structures.implementations.ordered_list.ti
    -

    {% t pages.data_structures.implementations.hash_table.title %}

    +

    {% t pages.data_structures.implementations.hash_table.title %}

    {% t pages.data_structures.implementations.hash_table.description %}

    -

    +
    {% include data_structure_complexity_header.html %} @@ -920,9 +920,9 @@

    {% t pages.data_structures.implementations.hash_table.title {% include sponsors/728x90.html %}
    -

    {% t pages.data_structures.implementations.binary_tree.title %}

    +

    {% t pages.data_structures.implementations.binary_tree.title %}

    {% t pages.data_structures.implementations.binary_tree.description %}

    -

    +
    {% include data_structure_complexity_header.html %} @@ -1010,9 +1010,9 @@

    {% t pages.data_structures.implementations.binary_tree.titl
    -

    {% t pages.data_structures.implementations.binary_search_tree.title %}

    +

    {% t pages.data_structures.implementations.binary_search_tree.title %}

    {% t pages.data_structures.implementations.binary_search_tree.description %}

    -

    +
    {% include data_structure_complexity_header.html %} @@ -1112,9 +1112,9 @@

    {% t pages.data_structures.implementations.binary_se
    -

    {% t pages.data_structures.implementations.b_tree.title %}

    +

    {% t pages.data_structures.implementations.b_tree.title %}

    {% t pages.data_structures.implementations.b_tree.description %}

    -

    +
    {% include data_structure_complexity_header.html %} @@ -1193,9 +1193,9 @@

    {% t pages.data_structures.implementations.b_tree.title %}

    -

    {% t pages.data_structures.implementations.binary_heap.title %}

    +

    {% t pages.data_structures.implementations.binary_heap.title %}

    {% t pages.data_structures.implementations.binary_heap.description %}

    -
    +
    {% include data_structure_complexity_header.html %} diff --git a/_pages/design_patterns.html b/_pages/design_patterns.html index ad3ff0a..9a2895a 100644 --- a/_pages/design_patterns.html +++ b/_pages/design_patterns.html @@ -15,7 +15,7 @@

    {% t pages.design_patterns.creational.title %}

    -

    {% t pages.design_patterns.creational.abstract_factory.title %}

    +

    {% t pages.design_patterns.creational.abstract_factory.title %}

    {% t pages.design_patterns.creational.abstract_factory.description %}

    {% t pages.design_patterns.creational.abstract_factory.title %}

    @@ -706,7 +706,7 @@

    {% t pages.design_patterns.behavioral.title %}

    -

    {% t pages.design_patterns.behavioral.chain_of_responsobility.title %}

    +

    {% t pages.design_patterns.behavioral.chain_of_responsobility.title %}

    {% t pages.design_patterns.behavioral.chain_of_responsobility.description %}

    {% t pages.design_patterns.behavioral.chain_of_responsobility.title %}

    diff --git a/_pages/functional_programming.html b/_pages/functional_programming.html index d8b0a20..bf361ff 100644 --- a/_pages/functional_programming.html +++ b/_pages/functional_programming.html @@ -18,7 +18,7 @@

    {% t pages.functional_programming.title %}

    -

    {% t pages.functional_programming.pure_functions.title %}

    +

    {% t pages.functional_programming.pure_functions.title %}

    {% t pages.functional_programming.pure_functions.description %}

    {% t pages.functional_programming.pure_functions.title %}

    diff --git a/_pages/gotchas.html b/_pages/gotchas.html index 37e7e2a..7477b82 100644 --- a/_pages/gotchas.html +++ b/_pages/gotchas.html @@ -91,7 +91,7 @@

    {% t pages.gotchas.twue.title %}

    -

    {% t pages.gotchas.symbols_and_strings.title %}

    +

    {% t pages.gotchas.symbols_and_strings.title %}

    {% t pages.gotchas.symbols_and_strings.description %}

    {% t pages.gotchas.symbols_and_strings.title %}

    @@ -112,7 +112,7 @@

    {% t pages.gotchas.symbols_and_strings.title %}

    -

    {% t pages.gotchas.string_or_nothing.title %}

    +

    {% t pages.gotchas.string_or_nothing.title %}

    {% t pages.gotchas.string_or_nothing.title %}

    {% highlight ruby %} @@ -615,7 +615,7 @@

    {% t pages.gotchas.freeze.title %}

    {% include sponsors/728x90.html %}
    -

    {% t pages.gotchas.one_is_one.title %}

    +

    {% t pages.gotchas.one_is_one.title %}

    {% t pages.gotchas.one_is_one.description %}

    {% t pages.gotchas.one_is_one.title %}

    @@ -755,7 +755,7 @@

    {% t pages.gotchas.rescue.title %}

    -

    {% t pages.gotchas.to_str.title %}

    +

    {% t pages.gotchas.to_str.title %}

    {% t pages.gotchas.to_str.description %}

    {% t pages.gotchas.to_str.title %}

    diff --git a/_pages/index.html b/_pages/index.html index e7b08df..2296e54 100644 --- a/_pages/index.html +++ b/_pages/index.html @@ -1,6 +1,7 @@ --- layout: default priority: 1 +permalink: / ---
    diff --git a/_pages/meta_programming.html b/_pages/meta_programming.html index 2e034c6..ecffd33 100644 --- a/_pages/meta_programming.html +++ b/_pages/meta_programming.html @@ -10,7 +10,7 @@

    {% t pages.meta_programming.title %}

    -

    {% t pages.meta_programming.dynamic_dispatch.title %}

    +

    {% t pages.meta_programming.dynamic_dispatch.title %}

    {% t pages.meta_programming.dynamic_dispatch.description %}

    {% t pages.meta_programming.dynamic_dispatch.title %}

    @@ -26,7 +26,7 @@

    {% t pages.meta_programming.dynamic_dispatch.title %}<

    -

    {% t pages.meta_programming.dynamic_method.title %}

    +

    {% t pages.meta_programming.dynamic_method.title %}

    {% t pages.meta_programming.dynamic_method.description %}

    {% t pages.meta_programming.dynamic_method.title %}

    @@ -140,7 +140,7 @@

    {% t pages.meta_programming.dynamic_method.title %}

    -

    {% t pages.meta_programming.dynamic_proxies.title %}

    +

    {% t pages.meta_programming.dynamic_proxies.title %}

    {% t pages.meta_programming.dynamic_proxies.description %}

    {% t pages.meta_programming.dynamic_proxies.title %}

    diff --git a/_pages/solid_principles.html b/_pages/solid_principles.html index d7ce506..edc01ac 100644 --- a/_pages/solid_principles.html +++ b/_pages/solid_principles.html @@ -83,7 +83,7 @@

    {% t pages.solid_principles.single.title %}

    -

    {% t pages.solid_principles.open_close.title %}

    +

    {% t pages.solid_principles.open_close.title %}

    {% t pages.solid_principles.open_close.description %}

    {% t pages.solid_principles.bad %}

    diff --git a/_sass/_base.scss b/_sass/_base.scss index 9761d9f..90d9049 100644 --- a/_sass/_base.scss +++ b/_sass/_base.scss @@ -721,3 +721,14 @@ article, background-color: $c-bg; } } + +.table { + &.complexity { + font-weight: bold; + text-align: center; + } +} + +.text-align-center { + text-align: center; +} diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..708dc70 Binary files /dev/null and b/favicon.ico differ diff --git a/javascripts/vendor/classie.js b/javascripts/vendor/classie.js index 32af54c..d5d04d6 100644 --- a/javascripts/vendor/classie.js +++ b/javascripts/vendor/classie.js @@ -1,72 +1 @@ -/*! - * classie v1.0.1 - * class helper functions - * from bonzo https://github.com/ded/bonzo - * MIT license - * - * classie.has( elem, 'my-class' ) -> true/false - * classie.add( elem, 'my-new-class' ) - * classie.remove( elem, 'my-unwanted-class' ) - * classie.toggle( elem, 'my-class' ) - */ - -/* jshint browser: true, strict: true, undef: true, unused: true */ -/* global define: false, module: false */ - -(function(window) { - 'use strict'; - - function classReg(className) { - return new RegExp('(^|\\s+)' + className + '(\\s+|$)'); - } - var hasClass, addClass, removeClass; - - if ('classList' in window.document.documentElement) { - hasClass = function(elem, c) { - return elem.classList.contains(c); - }; - addClass = function(elem, c) { - elem.classList.add(c); - }; - removeClass = function(elem, c) { - elem.classList.remove(c); - }; - } - else { - hasClass = function(elem, c) { - return classReg(c).test(elem.className); - }; - addClass = function(elem, c) { - if (!hasClass(elem, c)) { - elem.className = elem.className + ' ' + c; - } - }; - removeClass = function(elem, c) { - elem.className = elem.className.replace(classReg(c), ' '); - }; - } - - function toggleClass(elem, c) { - var fn = hasClass(elem, c) ? removeClass : addClass; - fn(elem, c); - } - - var classie = { - hasClass: hasClass, - addClass: addClass, - removeClass: removeClass, - toggleClass: toggleClass, - has: hasClass, - add: addClass, - remove: removeClass, - toggle: toggleClass - }; - - if (typeof define === 'function' && define.amd) { - define(classie); - } else if (typeof exports === 'object') { - module.exports = classie; - } else { - window.classie = classie; - } -})(window); +!function(s){"use strict";function e(s){return new RegExp("(^|\\s+)"+s+"(\\s+|$)")}var n,t,a;function c(s,e){(n(s,e)?a:t)(s,e)}"classList"in s.document.documentElement?(n=function(s,e){return s.classList.contains(e)},t=function(s,e){s.classList.add(e)},a=function(s,e){s.classList.remove(e)}):(n=function(s,n){return e(n).test(s.className)},t=function(s,e){n(s,e)||(s.className=s.className+" "+e)},a=function(s,n){s.className=s.className.replace(e(n)," ")});var o={hasClass:n,addClass:t,removeClass:a,toggleClass:c,has:n,add:t,remove:a,toggle:c};"function"==typeof define&&define.amd?define(o):"object"==typeof exports?module.exports=o:s.classie=o}(window); \ No newline at end of file