From f8a7fec7799f82267bc941abfb2709802744e68d Mon Sep 17 00:00:00 2001 From: Lorin Werthen Date: Mon, 18 Jul 2016 23:34:38 +0200 Subject: [PATCH] organization --- Gemfile | 2 +- Gemfile.lock | 21 ++++++++++---- Rules | 27 ++++++++++++------ content/{ => assets/images}/favicon.png | Bin content/{ => assets/images}/favicon32.png | Bin content/{ => assets/scripts}/cammie.coffee | 0 .../scripts/eventpost.coffee} | 0 .../stylesheets/main.scss} | 0 content/cammie.erb | 2 +- content/index.erb | 6 ++-- layouts/default.erb | 4 +-- layouts/eventpost.erb | 8 ++++-- layouts/{ => partials}/_navbar.erb | 0 layouts/{ => partials}/_tile.erb | 0 14 files changed, 46 insertions(+), 24 deletions(-) rename content/{ => assets/images}/favicon.png (100%) rename content/{ => assets/images}/favicon32.png (100%) rename content/{ => assets/scripts}/cammie.coffee (100%) rename content/{index.coffee => assets/scripts/eventpost.coffee} (100%) rename content/{stylesheet.scss => assets/stylesheets/main.scss} (100%) rename layouts/{ => partials}/_navbar.erb (100%) rename layouts/{ => partials}/_tile.erb (100%) diff --git a/Gemfile b/Gemfile index 30aedb1..6a290ee 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ # A sample Gemfile source 'https://rubygems.org' -gem 'nanoc' +gem 'nanoc', git: 'https://github.com/werthen/nanoc.git', branch: 'add-resources-to-ilinks-check' gem 'kramdown' gem 'coffee-script' # Needed for relativize_urls diff --git a/Gemfile.lock b/Gemfile.lock index 0ff81d9..ce37b08 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,13 @@ +GIT + remote: https://github.com/werthen/nanoc.git + revision: bd3235d8dbae71c5bf0328ba4630070c53a5d3f4 + branch: add-resources-to-ilinks-check + specs: + nanoc (4.2.3) + cri (~> 2.3) + hamster (~> 3.0) + ref (~> 2.0) + GEM remote: https://rubygems.org/ specs: @@ -9,6 +19,7 @@ GEM execjs coffee-script-source (1.10.0) colored (1.2) + concurrent-ruby (1.0.2) cri (2.7.0) colored (~> 1.2) execjs (2.7.0) @@ -28,6 +39,8 @@ GEM guard (~> 2.8) guard-compat (~> 1.0) nanoc (~> 4.0) + hamster (3.0.0) + concurrent-ruby (~> 1.0) json (2.0.1) kramdown (1.10.0) listen (3.1.5) @@ -37,8 +50,6 @@ GEM lumberjack (1.0.10) method_source (0.8.2) mini_portile2 (2.1.0) - nanoc (4.2.0) - cri (~> 2.3) nenv (0.3.0) nokogiri (1.6.8) mini_portile2 (~> 2.1.0) @@ -55,6 +66,7 @@ GEM rb-fsevent (0.9.7) rb-inotify (0.9.7) ffi (>= 0.5.0) + ref (2.0.0) ruby_dep (1.3.1) sass (3.4.22) shellany (0.0.1) @@ -72,13 +84,10 @@ DEPENDENCIES coffee-script guard-nanoc kramdown - nanoc + nanoc! nokogiri sass w3c_validators -RUBY VERSION - ruby 2.3.1p112 - BUNDLED WITH 1.12.5 diff --git a/Rules b/Rules index b9ea57e..4b86872 100644 --- a/Rules +++ b/Rules @@ -1,24 +1,28 @@ #!/usr/bin/env ruby +# ERB compile '/**/*.erb' do filter :erb layout '/default.erb' +end +# relativize_paths +compile '/**/*.{erb,html}' do filter :relativize_paths, type: :html end +# Coffeescript compile '/**/*.coffee' do filter :coffeescript - write "#{item.identifier.without_ext}.js" end +# SCSS compile '/**/*.scss' do filter :sass, syntax: :scss - write "#{item.identifier.without_ext}.css" end -# Markdown -compile '/**/*.md' do +# Compile all posts +compile '/posts/**/*.md' do filter :kramdown layout '/eventpost.erb' @@ -30,16 +34,23 @@ compile '/**/*.md' do filter :relativize_paths, type: :html end -route '/index.erb' do +route '/index.*' do '/index.html' end +route '/assets/stylesheets/**/*' do + "#{item.identifier.without_ext}.css" +end + +route '/assets/scripts/**/*' do + "#{item.identifier.without_ext}.js" +end + +passthrough '/**/*.png' + route '/**/*.{erb,html,md}' do "#{item.identifier.without_ext}/index.html" end -compile '/**/*' do - write item.identifier.to_s -end layout '/**/*', :erb diff --git a/content/favicon.png b/content/assets/images/favicon.png similarity index 100% rename from content/favicon.png rename to content/assets/images/favicon.png diff --git a/content/favicon32.png b/content/assets/images/favicon32.png similarity index 100% rename from content/favicon32.png rename to content/assets/images/favicon32.png diff --git a/content/cammie.coffee b/content/assets/scripts/cammie.coffee similarity index 100% rename from content/cammie.coffee rename to content/assets/scripts/cammie.coffee diff --git a/content/index.coffee b/content/assets/scripts/eventpost.coffee similarity index 100% rename from content/index.coffee rename to content/assets/scripts/eventpost.coffee diff --git a/content/stylesheet.scss b/content/assets/stylesheets/main.scss similarity index 100% rename from content/stylesheet.scss rename to content/assets/stylesheets/main.scss diff --git a/content/cammie.erb b/content/cammie.erb index fb7a974..9f6af77 100644 --- a/content/cammie.erb +++ b/content/cammie.erb @@ -18,4 +18,4 @@ - + diff --git a/content/index.erb b/content/index.erb index 7d28665..8f6d386 100644 --- a/content/index.erb +++ b/content/index.erb @@ -17,15 +17,15 @@ - <%= render '/_navbar.*' %> + <%= render '/partials/_navbar.*' %>
- <%= render '/_tile.*', article: sorted_articles[0] %> + <%= render '/partials/_tile.*', article: sorted_articles[0] %>
<% sorted_articles[1..-1].each do |article| %>
- <%= render '/_tile.*', article: article %> + <%= render '/partials/_tile.*', article: article %>
<% end %>
diff --git a/layouts/default.erb b/layouts/default.erb index 4a61b7c..f41833a 100644 --- a/layouts/default.erb +++ b/layouts/default.erb @@ -10,9 +10,9 @@ - + - + diff --git a/layouts/eventpost.erb b/layouts/eventpost.erb index 9891c45..f43e7db 100644 --- a/layouts/eventpost.erb +++ b/layouts/eventpost.erb @@ -8,8 +8,10 @@
-

<%= item[:title] %>

- <%= render '/_navbar.*' %> +

+ <%= item[:title] %> +

+ <%= render '/partials/_navbar.*' %>
@@ -30,4 +32,4 @@
- + diff --git a/layouts/_navbar.erb b/layouts/partials/_navbar.erb similarity index 100% rename from layouts/_navbar.erb rename to layouts/partials/_navbar.erb diff --git a/layouts/_tile.erb b/layouts/partials/_tile.erb similarity index 100% rename from layouts/_tile.erb rename to layouts/partials/_tile.erb