From aaa837c3e7c756f5a3b889e160dd0a58f6151fae Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Mon, 26 Oct 2015 23:24:16 -0700 Subject: [PATCH] Collection Index always generate --- .gitignore | 1 + Gemfile | 16 ++++++++++----- Rakefile | 6 +++--- _config.yml | 2 +- plugins/octopress_filters.rb | 36 +++++++++++++++++----------------- source/components/index.html | 11 +++-------- source/cookbook/index.markdown | 1 + 7 files changed, 38 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 8a63f6d4a8f..c5387b95f69 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ source/stylesheets/screen.css vendor node_modules Gemfile.lock +source/.jekyll-metadata diff --git a/Gemfile b/Gemfile index c9910e1cc53..2a59abc7c9d 100644 --- a/Gemfile +++ b/Gemfile @@ -2,10 +2,10 @@ source "https://rubygems.org" group :development do gem 'rake', '~> 10.0' - gem 'jekyll', '~> 2.0' - gem 'octopress-hooks', '~> 2.2' - gem 'octopress-date-format', '~> 2.0' - gem 'jekyll-sitemap' + gem 'jekyll', '~> 3.0' + gem 'pygments.rb', '~> 0.6.3' + # gem 'octopress-hooks', '~> 2.2' + # gem 'octopress-date-format', '~> 2.0' gem 'rdiscount', '~> 2.0' gem 'RedCloth', '~> 4.2.9' gem 'haml', '~> 4.0' @@ -14,9 +14,15 @@ group :development do gem 'rubypants', '~> 0.2.0' gem 'rb-fsevent', '~> 0.9' gem 'stringex', '~> 1.4.0' - gem 'jekyll-time-to-read' gem 'execjs' gem 'therubyracer', :platforms => :ruby end +group :jekyll_plugins do + gem 'jekyll-sitemap' + gem 'jekyll-paginate' + gem 'octopress', '~> 3.0' + gem 'jekyll-time-to-read' +end + gem 'sinatra', '~> 1.4.2' diff --git a/Rakefile b/Rakefile index 947b2a4bf15..9c4ee48c118 100644 --- a/Rakefile +++ b/Rakefile @@ -65,7 +65,7 @@ task :watch do raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir) puts "Starting to watch source with Jekyll and Compass." system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css") - jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build --watch") + jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build --watch --incremental") compassPid = Process.spawn("compass watch") trap("INT") { @@ -81,7 +81,7 @@ task :preview do raise "### You haven't set anything up yet. First run `rake install` to set up an Octopress theme." unless File.directory?(source_dir) puts "Starting to watch source with Jekyll and Compass. Starting Rack on port #{server_port}" system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css") - jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build --watch") + jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build --watch --incremental") compassPid = Process.spawn("compass watch") rackupPid = Process.spawn("rackup --port #{server_port}") @@ -252,7 +252,7 @@ desc "deploy public directory to github pages" multitask :push do puts "## Deploying branch to Github Pages " puts "## Pulling any updates from Github Pages " - cd "#{deploy_dir}" do + cd "#{deploy_dir}" do Bundler.with_clean_env { system "git pull" } end (Dir["#{deploy_dir}/*"]).each { |f| rm_rf(f) } diff --git a/_config.yml b/_config.yml index 119a41a4ed1..c69bbfffacb 100644 --- a/_config.yml +++ b/_config.yml @@ -31,7 +31,7 @@ root: / permalink: /blog/:year/:month/:day/:title/ source: source destination: public/ -plugins: plugins +plugins_dir: plugins code_dir: downloads/code category_dir: blog/categories markdown: rdiscount diff --git a/plugins/octopress_filters.rb b/plugins/octopress_filters.rb index 9c7fa6c5877..cfc0b4a1424 100644 --- a/plugins/octopress_filters.rb +++ b/plugins/octopress_filters.rb @@ -1,8 +1,8 @@ #custom filters for Octopress require './plugins/backtick_code_block' -require 'octopress-hooks' +# require 'octopress-hooks' require 'jekyll-sitemap' -require 'octopress-date-format' +# require 'octopress-date-format' require './plugins/raw' require 'rubypants' @@ -23,25 +23,25 @@ module OctopressFilters page.output = RubyPants.new(page.output).to_html end - class PageFilters < Octopress::Hooks::Page - def pre_render(page) - OctopressFilters::pre_filter(page) - end + # class PageFilters < Octopress::Hooks::Page + # def pre_render(page) + # OctopressFilters::pre_filter(page) + # end - def post_render(page) - OctopressFilters::post_filter(page) - end - end + # def post_render(page) + # OctopressFilters::post_filter(page) + # end + # end - class PostFilters < Octopress::Hooks::Post - def pre_render(post) - OctopressFilters::pre_filter(post) - end + # class PostFilters < Octopress::Hooks::Post + # def pre_render(post) + # OctopressFilters::pre_filter(post) + # end - def post_render(post) - OctopressFilters::post_filter(post) - end - end + # def post_render(post) + # OctopressFilters::post_filter(post) + # end + # end end diff --git a/source/components/index.html b/source/components/index.html index a0f4b9d1c4d..14f582cd103 100644 --- a/source/components/index.html +++ b/source/components/index.html @@ -9,6 +9,7 @@ sharing: true footer: true is_homepage: true body_id: components-page +regenerate: true ---

@@ -16,21 +17,15 @@ Support for these components is provided by the Home Assistant community.

{% assign components = site.components | sort: 'title' %} -{% assign categories = components | sort: 'ha_category' | map: 'ha_category' %} +{% assign categories = components | sort: 'ha_category' | map: 'ha_category' | uniq %}
All Featured - {% comment %} Jekyll 2.5.2 does not support the uniq filter :/ {% endcomment %} - {% assign category_printed = '' %} - {% for category in categories %} {% if category and category != 'Other' %} - {% unless category_printed contains category %} - {{ category }} - {% assign category_printed = category_printed | append: ',' | append: category %} - {% endunless %} + {{ category }} {% endif %} {% endfor %} diff --git a/source/cookbook/index.markdown b/source/cookbook/index.markdown index bf1bcee1d10..f4d2fef99eb 100644 --- a/source/cookbook/index.markdown +++ b/source/cookbook/index.markdown @@ -7,6 +7,7 @@ sidebar: false comments: false sharing: true footer: true +regenerate: true --- This is a community currated list of `configuration.yaml` examples. New recipes can be added via