Skip to content

Commit

Permalink
fix ability to disable rss
Browse files Browse the repository at this point in the history
  • Loading branch information
olegwtf committed Jan 24, 2015
1 parent 097d6c4 commit ae3c7f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
17 changes: 12 additions & 5 deletions bootylicious
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ __DATA__
@@ layouts/wrapper.rss.ep
% die('RSS disabled') unless config 'rss_enabled';
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xml:base="<%= url_for('index')->to_abs %>"
xmlns:dc="http://purl.org/dc/elements/1.1/">
Expand All @@ -332,8 +333,10 @@ __DATA__
% stash title => $tag, description => strings('tag-description', $tag);
<div class="text">
<h1><%= strings 'tag' %> <%= $tag %>
% if (config 'rss_enabled') {
<sup>
<%= link_to_tag $tag => { format => 'rss'} => begin %><img src="/rss.png" alt="RSS" /><% end %></sup>
% }
</h1>
<br />
% while (my $article = $articles->next) {
Expand Down Expand Up @@ -512,8 +515,10 @@ __DATA__
<title><%= $title ? "$title / " : '' %><%= config 'title' %></title>
<link rel="stylesheet" href="/styles.css" type="text/css" />
<%= stylesheet '/styles.css' %>
<link rel="alternate" type="application/rss+xml" title="<%= config 'title' %>" href="<%= href_to_rss if config 'rss' %>" />
% if (comments_enabled) {
% if (config 'rss_enabled') {
<link rel="alternate" type="application/rss+xml" title="<%= config 'title' %>" href="<%= href_to_rss %>" />
% }
% if (comments_enabled && config 'rss_enabled') {
<link rel="alternate" type="application/rss+xml" title="<%= config 'title' %> Comments" href="<%= href_to_comments_rss %>" />
% }
<meta name="generator" content="<%= generator %>" />
Expand All @@ -526,7 +531,7 @@ __DATA__
<div id="header">
<h1 id="title">
<%= link_to_home %>
% if (config 'rss') {
% if (config 'rss_enabled') {
<sup><a href="<%= href_to_rss %>"><img src="/rss.png" alt="RSS" /></a></sup>
% }
</h1>
Expand Down Expand Up @@ -664,6 +669,9 @@ rkJggg==
%# Enabling/disabling comments globbaly
%# "comments_enabled" : true,
%# Enabling/disabling rss
%# "rss_enabled" : true,
%# System settings
%# "perl5lib" : "",
%# "loglevel" : "error",
Expand All @@ -676,6 +684,5 @@ rkJggg==
%# "templates_directory" : "templates",
%# Don't worry about trailing comma
"ok" : true,
"rss" : true
"ok" : true
}
1 change: 1 addition & 0 deletions lib/Bootylicious/Plugin/BootyConfig.pm
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ sub _default {
theme => '',

comments_enabled => 1,
rss_enabled => 1,

meta => [],
css => [],
Expand Down

0 comments on commit ae3c7f6

Please sign in to comment.