From 9cfcf90d6ad8cb6128db7f6dbf01bfc7ad28a60e Mon Sep 17 00:00:00 2001 From: Matthew Connelly Date: Wed, 8 Apr 2015 02:34:07 +0100 Subject: [PATCH] Added the ability to disable publishing an RSS feed, renamed the rss_posts directive to a clearer name, recent_posts --- blogalba | 6 +++--- config | 3 ++- layout/head.inc | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/blogalba b/blogalba index f68c262..abd2e71 100755 --- a/blogalba +++ b/blogalba @@ -147,7 +147,7 @@ sub generate_feed { link => $_->{permaurl}, description => ($blog->{config}->{rss_excerpt}? $_->{excerpt} : $_->{body}), dc => { creator => $blog->{author}, }, - ) for @posts[0 .. ($#posts > ($blog->{config}->{rss_posts}-1)? ($blog->{config}->{rss_posts}-1) : $#posts)]; + ) for @posts[0 .. ($#posts > ($blog->{config}->{recent_posts}-1)? ($blog->{config}->{recent_posts}-1) : $#posts)]; $feed->save("$basedir/public/feed-rss2.xml"); } sub do_cache { @@ -175,8 +175,8 @@ sub do_cache { push @nav, {navname => $_, navurl => $blog->{links}->{$_},} for sort { $b cmp $a } keys $blog->{links}; generate_feed; %defparams = ( - INDEX => 0, NAV => [@nav], url => $blog->{url}, recent => [@posts[0 .. ($#posts > ($blog->{config}->{rss_posts}-1)? ($blog->{config}->{rss_posts}-1) : $#posts)]], - gentime => timefmt($lastcache, '%H:%M %e/%-m/%y %Z'), genworktime => sprintf("%.2f ms", tv_interval($st)*100), host => $HOST, + INDEX => 0, NAV => [@nav], url => $blog->{url}, recent => [@posts[0 .. ($#posts > ($blog->{config}->{recent_posts}-1)? ($blog->{config}->{recent_posts}-1) : $#posts)]], + gentime => timefmt($lastcache, '%H:%M %e/%-m/%y %Z'), genworktime => sprintf("%.2f ms", tv_interval($st)*100), host => $HOST, rss_enabled => $blog->{rss_publish}, about => $blog->{about}, author => $blog->{author}, name => $blog->{name}, tagline => $blog->{tagline}, keywords => $blog->{keywords}, robots => $blog->{config}->{indexable}? '' : '', ); diff --git a/config b/config index 11f0914..6ae0228 100644 --- a/config +++ b/config @@ -9,8 +9,9 @@ posturlprepend: wrote/ config: indexable: 1 per_page: 6 + recent_posts: 8 + rss_publish: 1 rss_excerpt: 1 - rss_posts: 8 date_format: "%H:%M on %A, %d/%m/%y" links: Twitter: https://twitter.com/maffsie diff --git a/layout/head.inc b/layout/head.inc index c4969f2..5e51540 100644 --- a/layout/head.inc +++ b/layout/head.inc @@ -13,7 +13,9 @@ + (RSS 2.0)" href="/feed-rss2.xml" /> +