diff --git a/Rules b/Rules index 2b3040d..2aa50f8 100644 --- a/Rules +++ b/Rules @@ -4,11 +4,25 @@ compile '/' do layout 'listing' end +compile '/articles/', :rep => :json do + filter :erb +end +compile '/articles/' do + layout 'articles' +end + compile '*' do filter :rdiscount layout 'default' end +route '/articles/', :rep => :json do + item.identifier + 'index.json' +end +route '/articles/' do + item.identifier + 'index.html' +end + route '*' do item.identifier + 'index.html' end diff --git a/content/articles.json b/content/articles.json new file mode 100644 index 0000000..ce6e07f --- /dev/null +++ b/content/articles.json @@ -0,0 +1,7 @@ +<% + articles = [] + sorted_articles.each do |article| + articles << { :title => article[:title] } + end +%> +<%= articles.to_json %> \ No newline at end of file diff --git a/content/articles.yaml b/content/articles.yaml new file mode 100644 index 0000000..36c1c5f --- /dev/null +++ b/content/articles.yaml @@ -0,0 +1,2 @@ +--- +title: Articles diff --git a/layouts/articles.html b/layouts/articles.html new file mode 100644 index 0000000..7b99c55 --- /dev/null +++ b/layouts/articles.html @@ -0,0 +1,49 @@ + + + + + <%= @item[:title] %> + + + + + + + + <%= render 'header' %> +
+

<%= @item[:title] %>

+ + + +
+ <%= render 'footer' %> + + diff --git a/layouts/articles.yaml b/layouts/articles.yaml new file mode 100644 index 0000000..20670d5 --- /dev/null +++ b/layouts/articles.yaml @@ -0,0 +1,2 @@ +--- {} + diff --git a/lib/default.rb b/lib/default.rb index df666ab..0d5ae7d 100644 --- a/lib/default.rb +++ b/lib/default.rb @@ -1,4 +1,7 @@ # All files in the 'lib' directory will be loaded # before nanoc starts compiling. + +require 'json' + include Nanoc3::Helpers::Rendering include Nanoc3::Helpers::Blogging \ No newline at end of file