Collection Index always generate

This commit is contained in:
Paulus Schoutsen 2015-10-26 23:24:16 -07:00
parent 659000845a
commit aaa837c3e7
7 changed files with 38 additions and 35 deletions

1
.gitignore vendored
View File

@ -11,3 +11,4 @@ source/stylesheets/screen.css
vendor
node_modules
Gemfile.lock
source/.jekyll-metadata

16
Gemfile
View File

@ -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'

View File

@ -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}")

View File

@ -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

View File

@ -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

View File

@ -9,6 +9,7 @@ sharing: true
footer: true
is_homepage: true
body_id: components-page
regenerate: true
---
<p class='note'>
@ -16,21 +17,15 @@ Support for these components is provided by the Home Assistant community.
</p>
{% 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 %}
<div class="filter-button-group">
<a href='#all' class="btn">All</a>
<a href='#featured' class="btn">Featured</a>
{% 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 %}
<a href='#{{ category | slugify }}' class="btn">{{ category }}</a>
{% assign category_printed = category_printed | append: ',' | append: category %}
{% endunless %}
{% endif %}
{% endfor %}

View File

@ -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