diff --git a/.gitignore b/.gitignore index f0d4416c..aba4609c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ Thumbs.db vendor _cache .jekyll-metadata +.sass-cache/ diff --git a/Makefile b/Makefile index 5dc1e982..ef855a36 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ default: clean build ## `make preview`: start the built-in Jekyll preview preview: clean - $S bundle exec jekyll serve + $S bundle exec jekyll serve --incremental ## `make test`: don't build, but do run all tests test: pre-build-tests post-build-tests diff --git a/_config.yml b/_config.yml index 3a7ec4ee..2fe7b627 100644 --- a/_config.yml +++ b/_config.yml @@ -599,3 +599,7 @@ defaults: type: posts values: lang: en + +## Options as of version 3.4.20 are: nested (default), compact, compressed, or expanded +sass: + style: compressed diff --git a/_includes/layout/base/html-head.html b/_includes/layout/base/html-head.html index 9bb53676..7ed7c7bd 100644 --- a/_includes/layout/base/html-head.html +++ b/_includes/layout/base/html-head.html @@ -9,11 +9,11 @@ http://opensource.org/licenses/MIT. {% capture title %}{% translate title %}{% endcapture %}{% if title != '' %}{{ title }}{% else %}{{ page.title }}{% endif %} {% capture metadescription %}{% translate metadescription %}{% endcapture %}{% if metadescription != '' %}{% endif %} -{% lesscss main.less %} - - -{% if page.lang == 'ar' or page.lang == 'fa' %}{% lesscss rtl.less %}{% endif %} -{% if page.lang == 'bg' or page.lang == 'el' or page.lang == 'ko' or page.lang == 'hi' or page.lang == 'pl' or page.lang == 'sl' or page.lang == 'ro' or page.lang == 'ru' or page.lang == 'tr' or page.lang == 'uk' or page.lang == 'zh_CN' or page.lang == 'zh_TW' %}{% lesscss sans.less %}{% endif %} + + + +{% if page.lang == 'ar' or page.lang == 'fa' %}{% endif %} +{% if page.lang == 'bg' or page.lang == 'el' or page.lang == 'ko' or page.lang == 'hi' or page.lang == 'pl' or page.lang == 'sl' or page.lang == 'ro' or page.lang == 'ru' or page.lang == 'tr' or page.lang == 'uk' or page.lang == 'zh_CN' or page.lang == 'zh_TW' %}{% endif %} {% if page.id != 'download' %}{% endif %} diff --git a/_less/main.less b/_less/main.less deleted file mode 100644 index 841ac251..00000000 --- a/_less/main.less +++ /dev/null @@ -1,7 +0,0 @@ -/* -This file is licensed under the MIT License (MIT) available on -http://opensource.org/licenses/MIT. -*/ - -@import "normalize.less"; -@import "screen.less"; diff --git a/_plugins/contributors.rb b/_plugins/contributors.rb index e19e9d87..8a8f8872 100644 --- a/_plugins/contributors.rb +++ b/_plugins/contributors.rb @@ -78,17 +78,19 @@ module Jekyll def generate(site) # Set site.contributors global variables for liquid/jekyll - class << site - attr_accessor :corecontributors - attr_accessor :sitecontributors - alias contrib_site_payload site_payload - def site_payload - h = contrib_site_payload - payload = h["site"] - payload["corecontributors"] = self.corecontributors - payload["sitecontributors"] = self.sitecontributors - h["site"] = payload - h + if ! site.respond_to?('corecontributors') + class << site + attr_accessor :corecontributors + attr_accessor :sitecontributors + alias contrib_site_payload site_payload + def site_payload + h = contrib_site_payload + payload = h["site"] + payload["corecontributors"] = self.corecontributors + payload["sitecontributors"] = self.sitecontributors + h["site"] = payload + h + end end end diff --git a/_plugins/events.rb b/_plugins/events.rb index 8ef8ed3b..77427094 100644 --- a/_plugins/events.rb +++ b/_plugins/events.rb @@ -42,15 +42,17 @@ module Jekyll def generate(site) # Set site.meetups and site.conferences global variables for liquid/jekyll - class << site - attr_accessor :conferences - alias event_site_payload site_payload - def site_payload - h = event_site_payload - payload = h["site"] - payload["conferences"] = self.conferences - h["site"] = payload - h + if ! site.respond_to?('conferences') + class << site + attr_accessor :meetups, :conferences + alias event_site_payload site_payload + def site_payload + h = event_site_payload + payload = h["site"] + payload["conferences"] = self.conferences + h["site"] = payload + h + end end end diff --git a/_plugins/less.rb b/_plugins/less.rb deleted file mode 100644 index 89785806..00000000 --- a/_plugins/less.rb +++ /dev/null @@ -1,71 +0,0 @@ -# This file is licensed under the MIT License (MIT) available on -# http://opensource.org/licenses/MIT. - -require 'digest/md5' - -module Jekyll - - class LessCSSFile < StaticFile - def write(dest) - # do nothing - end - end - - class LessCSS < Liquid::Tag - def initialize(tag_name, file, tokens) - super - @file = file.strip - end - - def render(context) - site = context.registers[:site] - config = context.registers[:site].config - if !config.has_key?('lessdone') - config['lessdone'] = {} - end - less_dir = File.join(site.source, '_less') - if File.symlink?(less_dir) - return "LessCSS directory '#{less_dir}' cannot be a symlink" - end - #Process file only if it hasn't been processed yet - if !config['lessdone'].has_key?(@file) - Dir.chdir(less_dir) do - choices = Dir['**/*'].reject { |x| File.symlink?(x) } - if choices.include?(@file) - #Generate file content with less, those that end with .css - if /\.css$/.match(@file) - f = file = File.new(@file, "r") - else - source = File.read(@file) - f = IO.popen("lessc -x -", "w+") - f.write(source) - f.close_write() - end - #Keep MD5 hash of the file as the file name - css = f.readlines().join() - digest = Digest::MD5.hexdigest(css) - css_file = digest + ".css" - css_path = File.join(site.dest, css_file) - #Write final file - if !File.directory?(site.dest) - Dir.mkdir(site.dest) - end - File.open(css_path, "w") do |f| - f.write(css) - end - site.static_files << LessCSSFile.new(site, site.source, '', css_file) - #Save the filename so the file isn't processed again - config['lessdone'][@file] = css_file - else - return "LessCSS file '#{@file}' not found in '#{less_dir}'" - end - end - end - #Print CSS link in HTML layout - '' - end - end - -end - -Liquid::Template.register_tag('lesscss', Jekyll::LessCSS) diff --git a/_less/normalize.less b/_sass/normalize.scss similarity index 100% rename from _less/normalize.less rename to _sass/normalize.scss diff --git a/_less/screen.less b/_sass/screen.scss similarity index 100% rename from _less/screen.less rename to _sass/screen.scss diff --git a/_less/ie.css b/css/ie.css similarity index 100% rename from _less/ie.css rename to css/ie.css diff --git a/_less/ie8.less b/css/ie8.less similarity index 100% rename from _less/ie8.less rename to css/ie8.less diff --git a/css/main.scss b/css/main.scss new file mode 100644 index 00000000..aa762a7d --- /dev/null +++ b/css/main.scss @@ -0,0 +1,9 @@ +--- +# This file is licensed under the MIT License (MIT) available on +# http://opensource.org/licenses/MIT. +--- +// Import partials from `sass_dir` (defaults to `_sass`) +@import + "normalize", + "screen" +; diff --git a/_less/rtl.less b/css/rtl.scss similarity index 98% rename from _less/rtl.less rename to css/rtl.scss index 1dd38ea1..52e28efd 100644 --- a/_less/rtl.less +++ b/css/rtl.scss @@ -1,8 +1,7 @@ -/* -This file is licensed under the MIT License (MIT) available on -http://opensource.org/licenses/MIT. -*/ - +--- +# This file is licensed under the MIT License (MIT) available on +# http://opensource.org/licenses/MIT. +--- /*Language specific styles that override default*/ /*Styles for HTML tags*/ diff --git a/_less/sans.less b/css/sans.css similarity index 100% rename from _less/sans.less rename to css/sans.css