Atom feed

This commit is contained in:
Stefan Schlott 2013-08-24 15:42:27 +02:00
parent 220866997f
commit bb3dd8c4ba
10 changed files with 37 additions and 0 deletions

View file

@ -2,6 +2,7 @@ source "http://gems.github.com"
source "http://rubygems.org" source "http://rubygems.org"
gem 'nanoc3' gem 'nanoc3'
gem 'builder'
gem 'guard-nanoc' gem 'guard-nanoc'
gem 'systemu' gem 'systemu'
gem 'adsf' gem 'adsf'

View file

@ -5,6 +5,7 @@ GEM
addressable (2.3.3) addressable (2.3.3)
adsf (1.0.1) adsf (1.0.1)
rack (>= 1.0.0) rack (>= 1.0.0)
builder (3.2.2)
coderay (1.0.9) coderay (1.0.9)
colored (1.2) colored (1.2)
cookiejar (0.3.0) cookiejar (0.3.0)
@ -106,6 +107,7 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
adsf adsf
builder
guard-nanoc guard-nanoc
nanoc3 nanoc3
nokogiri nokogiri

8
Rules
View file

@ -25,6 +25,10 @@ compile "/htaccess" do
filter :erb filter :erb
end end
compile /(rss|atom)/ do
filter :erb
end
compile '*' do compile '*' do
item_name = if item.identifier=="/" item_name = if item.identifier=="/"
"" ""
@ -66,6 +70,10 @@ route "/htaccess" do
"/.htaccess" "/.htaccess"
end end
route '/(atom|rss)/' do
item.identifier.chop + '.xml'
end
route '/articles/*' do route '/articles/*' do
# Find corresponding article (for getting metadata) # Find corresponding article (for getting metadata)
articleitem = article_base_item(item) articleitem = article_base_item(item)

12
content/atom.xml Normal file
View file

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

View file

@ -1,6 +1,10 @@
----- -----
title: CCC Stuttgart - Startseite title: CCC Stuttgart - Startseite
kind: empty kind: empty
feed:
-
url: '/atom.xml'
title: 'CCCS - Neueste Artikel'
----- -----
<div class="row"> <div class="row">
<div class="span12"> <div class="span12">

View file

@ -4,6 +4,11 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= @item[:title] %></title> <title><%= @item[:title] %></title>
<% if @item[:feed] then
item[:feed].each do |f| %>
<link rel="alternate" type="application/atom+xml" title="<%= f[:title]%>" href="<%= f[:url]%>" />
<% end
end %>
<link rel="shortcut icon" href="/favicon.ico" /> <link rel="shortcut icon" href="/favicon.ico" />
<link rel="icon" href="/favicon.ico" /> <link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="/styles/main.css" /> <link rel="stylesheet" href="/styles/main.css" />

View file

@ -3,4 +3,5 @@
include Nanoc3::Helpers::Rendering include Nanoc3::Helpers::Rendering
include Nanoc::Helpers::HTMLEscape include Nanoc::Helpers::HTMLEscape
include Nanoc3::Helpers::Blogging

View file

@ -88,6 +88,10 @@ watcher:
notify_on_compilation_failure: true 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 twitter_file: content/_data/twitter.csv
deploy: deploy:

BIN
static/img/atom-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
static/img/atom-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB