1
0
Fork 0
mirror of https://github.com/fmap/muflax65ngodyewp.onion synced 2024-06-01 06:39:19 +02:00

disowned warning, merged rss feed (first half)

This commit is contained in:
muflax 2012-06-22 04:36:46 +02:00
parent 7dea46d36f
commit e12884d3af
9 changed files with 81 additions and 28 deletions

29
TODO
View file

@ -1,19 +1,20 @@
* Todo [9/18] * content [1/8]
- [X] switch to creation dates
- [X] hide drafts in categories, but compile them anyway
- [X] better rss feed (automatic items based on dates, changelog)
- [X] better separation of categories
- [ ] "digesting history"
- [X] mind-killer warning
- [X] move to nfs.net (host mail on gmail)
- [ ] better handling of footnotes (parallel column?)
- [X] switch rake to nanoc commands
- [ ] universal RSS
- [ ] disclaimer about removed content - [ ] disclaimer about removed content
- [X] "merged with" - [X] universal RSS
- [ ] portal
- [ ] rss feeds
- [ ] disown bad sites
- [ ] merge more stuff (experiments etc.)
- [ ] start gospel
- [ ] start let's read for reviews
- [ ] some portal for all sites
* layout [1/5]
- [ ] better handling of footnotes (parallel column?)
- [ ] search bar prettier - [ ] search bar prettier
- [ ] imply all_sites without -s
- [ ] next_prev for first page float broken - [ ] next_prev for first page float broken
- [X] tidy html in RSS feed for compression - [X] disown site
- [ ] better merged -> moved
* technical [0/3]
- [ ] imply all_sites without -s
- [ ] fork nanoc, move site config there - [ ] fork nanoc, move site config there
- [ ] cache compilation better - [ ] cache compilation better

43
commands/rss_merge.rb Normal file
View file

@ -0,0 +1,43 @@
usage 'rss-merge'
summary 'merge RSS feeds'
description 'Merges individual RSS feeds into one combined feed.'
module Nanoc::CLI::Commands
class RSSMerge < ::Nanoc::CLI::CommandRunner
def run
require "rss"
version = "2.0"
date = Time.new 0
items = []
# read individual feeds and include them
all_sites.each do |name|
site = load_site name
puts "including #{name}..."
feed = RSS::Parser.parse(File.open("#{site.config[:output_dir]}/rss.xml"))
date = [feed.channel.date, date].max
items.concat feed.items
end
# build merged feed
merged_feed = RSS::Maker.make(version) do |rss|
rss.channel.title = "muflax"
rss.channel.link = "http://muflax.com"
rss.channel.author = "mail@muflax.com"
rss.channel.description = "read ALL the muflax!"
end
merged_feed.items.concat items.sort_by(&:date).reverse.take(10)
# write it
File.open("out/muflax/rss-merged.xml", "w") do |f|
f.write merged_feed
end
system "nanoc compress -s muflax"
end
end
end
runner Nanoc::CLI::Commands::RSSMerge

View file

@ -124,7 +124,7 @@ end
module Nanoc::CLI module Nanoc::CLI
class CommandRunner class CommandRunner
def all_sites def all_sites
Dir['content_*'].map{|d| d.gsub(/^content_/, '')}.sort YAML.load(File.open("sites.yaml"))["sites"].keys.sort
end end
# lots of commands use -s now, so simplify its use # lots of commands use -s now, so simplify its use

View file

@ -9,6 +9,7 @@ $episteme: #c4f3af;
$hover: #057dff; $hover: #057dff;
$quote: #a6a542; $quote: #a6a542;
$pre: #fff8d9; $pre: #fff8d9;
$warning: #d44836;
/* sizes */ /* sizes */
$left-col: 45em; $left-col: 45em;
@ -68,9 +69,14 @@ div#episteme {
line-height: 2em; line-height: 2em;
} }
/* mindkiller warning */ /* disowned warning */
div#mindkiller { div#disowned {
h1 {
background: $warning;
}
background: $episteme; background: $episteme;
padding-bottom: 0.1em;
} }
/* merged with another article */ /* merged with another article */

9
layouts/disowned.erb Normal file
View file

@ -0,0 +1,9 @@
<% if @item.disowned? %>
<div id="disowned">
<h1>Warning</h1>
<p>This page has been disowned according to the <a href="http://blog.muflax.com/propaganda/condemnation">Condemnation of 2012</a>. The <a href="/contact/">author</a> does not endorse or deny any of the views expressed here, even when it may appear so, and will not discuss them.</p>
<p>The page is preserved for historical and game-theoretic reasons, and because the author likely put a shit-ton of work into it.</p>
</div>
<% end %>

View file

@ -1,5 +0,0 @@
<% if @item.mindkiller? %>
<div id="mindkiller">
<p><strong>Warning</strong>: this page contains mind-killing content. Proceed with caution. The <a href="/contact/">author</a> does not endorse any of the views expressed here, even when they may look convincing. If you feel offended, consider that the author might be trolling you and whether you want to encourage them even further.</p>
</div>
<% end %>

View file

@ -1,4 +1,4 @@
<%= render 'mindkiller' %> <%= render 'disowned' %>
<%= render 'episteme' %> <%= render 'episteme' %>

View file

@ -33,9 +33,8 @@ class Nanoc::Item
!!self[:episteme] !!self[:episteme]
end end
def mindkiller? def disowned?
topics = %w{history} !!self[:disowned]
!!self[:mindkiller]
end end
def merged? def merged?

View file

@ -14,5 +14,5 @@ sites:
letsread: letsread:
title: Let\'s Read title: Let\'s Read
disqus_site: muflaxread disqus_site: muflaxread
gospel: # gospel:
title: Unchanging Gospel # title: Unchanging Gospel