diff --git a/Gemfile b/Gemfile index 56e67122..9dcb026b 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,7 @@ source "http://gems.github.com" source "http://rubygems.org" gem 'nanoc3' +gem 'builder' gem 'guard-nanoc' gem 'systemu' gem 'adsf' diff --git a/Gemfile.lock b/Gemfile.lock index 3a2b0ec2..e24ff983 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -5,6 +5,7 @@ GEM addressable (2.3.3) adsf (1.0.1) rack (>= 1.0.0) + builder (3.2.2) coderay (1.0.9) colored (1.2) cookiejar (0.3.0) @@ -106,6 +107,7 @@ PLATFORMS DEPENDENCIES adsf + builder guard-nanoc nanoc3 nokogiri diff --git a/Rules b/Rules index ebfb1f64..41d7347b 100644 --- a/Rules +++ b/Rules @@ -25,6 +25,10 @@ compile "/htaccess" do filter :erb end +compile /(rss|atom)/ do + filter :erb +end + compile '*' do item_name = if item.identifier=="/" "" @@ -66,6 +70,10 @@ route "/htaccess" do "/.htaccess" end +route '/(atom|rss)/' do + item.identifier.chop + '.xml' +end + route '/articles/*' do # Find corresponding article (for getting metadata) articleitem = article_base_item(item) diff --git a/content/atom.xml b/content/atom.xml new file mode 100644 index 00000000..a1c6490e --- /dev/null +++ b/content/atom.xml @@ -0,0 +1,12 @@ +--- +type: 'feed' +title: 'CCCS - Chaos Computer Club Stuttgart (Atom Feed)' +--- +<% +excerptproc = Proc.new do |article| + article_summary(article) +end +%><%= atom_feed :limit => 10, + :excerpt_proc => excerptproc, + :icon => "#{site.config[:base_url]}/img/atom-icon.png", + :logo => "#{site.config[:base_url]}/img/atom-logo.png" %> diff --git a/content/index.html b/content/index.html index 337076ff..94877455 100644 --- a/content/index.html +++ b/content/index.html @@ -1,6 +1,10 @@ ----- title: CCC Stuttgart - Startseite kind: empty +feed: +- + url: '/atom.xml' + title: 'CCCS - Neueste Artikel' -----
diff --git a/layouts/default.html b/layouts/default.html index 219b32d3..09198ca4 100644 --- a/layouts/default.html +++ b/layouts/default.html @@ -4,6 +4,11 @@ <%= @item[:title] %> + <% if @item[:feed] then + item[:feed].each do |f| %> + + <% end + end %> diff --git a/lib/default.rb b/lib/default.rb index ed22a3b6..aaa80c5b 100644 --- a/lib/default.rb +++ b/lib/default.rb @@ -3,4 +3,5 @@ include Nanoc3::Helpers::Rendering include Nanoc::Helpers::HTMLEscape +include Nanoc3::Helpers::Blogging diff --git a/nanoc.yaml b/nanoc.yaml index c26e059b..ccc0ca05 100644 --- a/nanoc.yaml +++ b/nanoc.yaml @@ -88,6 +88,10 @@ watcher: notify_on_compilation_failure: true +base_url: http://www.cccs.de +author_name: CCCS +author_email: webmaster@cccs.de +author_uri: http://www.cccs.de/ twitter_file: content/_data/twitter.csv deploy: diff --git a/static/img/atom-icon.png b/static/img/atom-icon.png new file mode 100644 index 00000000..cdb7eea6 Binary files /dev/null and b/static/img/atom-icon.png differ diff --git a/static/img/atom-logo.png b/static/img/atom-logo.png new file mode 100644 index 00000000..1f0857b2 Binary files /dev/null and b/static/img/atom-logo.png differ