organization

This commit is contained in:
Lorin Werthen 2016-07-18 23:34:38 +02:00
parent 094b7bd365
commit f8a7fec779
14 changed files with 46 additions and 24 deletions

View file

@ -2,7 +2,7 @@
# A sample Gemfile # A sample Gemfile
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'nanoc' gem 'nanoc', git: 'https://github.com/werthen/nanoc.git', branch: 'add-resources-to-ilinks-check'
gem 'kramdown' gem 'kramdown'
gem 'coffee-script' gem 'coffee-script'
# Needed for relativize_urls # Needed for relativize_urls

View file

@ -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 GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
@ -9,6 +19,7 @@ GEM
execjs execjs
coffee-script-source (1.10.0) coffee-script-source (1.10.0)
colored (1.2) colored (1.2)
concurrent-ruby (1.0.2)
cri (2.7.0) cri (2.7.0)
colored (~> 1.2) colored (~> 1.2)
execjs (2.7.0) execjs (2.7.0)
@ -28,6 +39,8 @@ GEM
guard (~> 2.8) guard (~> 2.8)
guard-compat (~> 1.0) guard-compat (~> 1.0)
nanoc (~> 4.0) nanoc (~> 4.0)
hamster (3.0.0)
concurrent-ruby (~> 1.0)
json (2.0.1) json (2.0.1)
kramdown (1.10.0) kramdown (1.10.0)
listen (3.1.5) listen (3.1.5)
@ -37,8 +50,6 @@ GEM
lumberjack (1.0.10) lumberjack (1.0.10)
method_source (0.8.2) method_source (0.8.2)
mini_portile2 (2.1.0) mini_portile2 (2.1.0)
nanoc (4.2.0)
cri (~> 2.3)
nenv (0.3.0) nenv (0.3.0)
nokogiri (1.6.8) nokogiri (1.6.8)
mini_portile2 (~> 2.1.0) mini_portile2 (~> 2.1.0)
@ -55,6 +66,7 @@ GEM
rb-fsevent (0.9.7) rb-fsevent (0.9.7)
rb-inotify (0.9.7) rb-inotify (0.9.7)
ffi (>= 0.5.0) ffi (>= 0.5.0)
ref (2.0.0)
ruby_dep (1.3.1) ruby_dep (1.3.1)
sass (3.4.22) sass (3.4.22)
shellany (0.0.1) shellany (0.0.1)
@ -72,13 +84,10 @@ DEPENDENCIES
coffee-script coffee-script
guard-nanoc guard-nanoc
kramdown kramdown
nanoc nanoc!
nokogiri nokogiri
sass sass
w3c_validators w3c_validators
RUBY VERSION
ruby 2.3.1p112
BUNDLED WITH BUNDLED WITH
1.12.5 1.12.5

27
Rules
View file

@ -1,24 +1,28 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# ERB
compile '/**/*.erb' do compile '/**/*.erb' do
filter :erb filter :erb
layout '/default.erb' layout '/default.erb'
end
# relativize_paths
compile '/**/*.{erb,html}' do
filter :relativize_paths, type: :html filter :relativize_paths, type: :html
end end
# Coffeescript
compile '/**/*.coffee' do compile '/**/*.coffee' do
filter :coffeescript filter :coffeescript
write "#{item.identifier.without_ext}.js"
end end
# SCSS
compile '/**/*.scss' do compile '/**/*.scss' do
filter :sass, syntax: :scss filter :sass, syntax: :scss
write "#{item.identifier.without_ext}.css"
end end
# Markdown # Compile all posts
compile '/**/*.md' do compile '/posts/**/*.md' do
filter :kramdown filter :kramdown
layout '/eventpost.erb' layout '/eventpost.erb'
@ -30,16 +34,23 @@ compile '/**/*.md' do
filter :relativize_paths, type: :html filter :relativize_paths, type: :html
end end
route '/index.erb' do route '/index.*' do
'/index.html' '/index.html'
end 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 route '/**/*.{erb,html,md}' do
"#{item.identifier.without_ext}/index.html" "#{item.identifier.without_ext}/index.html"
end end
compile '/**/*' do
write item.identifier.to_s
end
layout '/**/*', :erb layout '/**/*', :erb

View file

Before

Width:  |  Height:  |  Size: 530 B

After

Width:  |  Height:  |  Size: 530 B

View file

Before

Width:  |  Height:  |  Size: 759 B

After

Width:  |  Height:  |  Size: 759 B

View file

@ -18,4 +18,4 @@
</div> </div>
</div> </div>
<script src="/cammie.js"></script> <script src="/assets/scripts/cammie.js"></script>

View file

@ -17,15 +17,15 @@
</div> </div>
</div> </div>
<%= render '/_navbar.*' %> <%= render '/partials/_navbar.*' %>
</header> </header>
<main> <main>
<div id="all-events"> <div id="all-events">
<%= render '/_tile.*', article: sorted_articles[0] %> <%= render '/partials/_tile.*', article: sorted_articles[0] %>
<div class="pure-g"> <div class="pure-g">
<% sorted_articles[1..-1].each do |article| %> <% sorted_articles[1..-1].each do |article| %>
<div class="pure-u-1-3"> <div class="pure-u-1-3">
<%= render '/_tile.*', article: article %> <%= render '/partials/_tile.*', article: article %>
</div> </div>
<% end %> <% end %>
</div> </div>

View file

@ -10,9 +10,9 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/pure-min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/grids-responsive-min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/grids-responsive-min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" href="/stylesheet.css"> <link rel="stylesheet" href="/assets/stylesheets/main.css">
<link rel="icon" href="favicon32.png" type="image/x-icon" /> <link rel="icon" href="/assets/images/favicon32.png" type="image/x-icon" />
<script src="https://code.jquery.com/jquery-3.0.0.min.js" charset="utf-8"></script> <script src="https://code.jquery.com/jquery-3.0.0.min.js" charset="utf-8"></script>

View file

@ -8,8 +8,10 @@
<div id="event-content"> <div id="event-content">
<div id="sticky-anchor"></div> <div id="sticky-anchor"></div>
<div id="sticky"> <div id="sticky">
<h1 id="event-title"><%= item[:title] %></h1> <h1 id="event-title">
<%= render '/_navbar.*' %> <%= item[:title] %>
</h1>
<%= render '/partials/_navbar.*' %>
</div> </div>
<div class="pure-g"> <div class="pure-g">
<!-- Wrapper needed to add some padding to the grid class --> <!-- Wrapper needed to add some padding to the grid class -->
@ -30,4 +32,4 @@
</div> </div>
</div> </div>
<script src="/index.js"></script> <script src="/assets/scripts/eventpost.js"></script>