Atom feed
This commit is contained in:
parent
220866997f
commit
bb3dd8c4ba
10 changed files with 37 additions and 0 deletions
1
Gemfile
1
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'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
8
Rules
8
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)
|
||||
|
|
|
|||
12
content/atom.xml
Normal file
12
content/atom.xml
Normal 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" %>
|
||||
|
|
@ -1,6 +1,10 @@
|
|||
-----
|
||||
title: CCC Stuttgart - Startseite
|
||||
kind: empty
|
||||
feed:
|
||||
-
|
||||
url: '/atom.xml'
|
||||
title: 'CCCS - Neueste Artikel'
|
||||
-----
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@
|
|||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<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="icon" href="/favicon.ico" />
|
||||
<link rel="stylesheet" href="/styles/main.css" />
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@
|
|||
|
||||
include Nanoc3::Helpers::Rendering
|
||||
include Nanoc::Helpers::HTMLEscape
|
||||
include Nanoc3::Helpers::Blogging
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
BIN
static/img/atom-icon.png
Normal file
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
BIN
static/img/atom-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
Loading…
Add table
Add a link
Reference in a new issue