all repos — h3rald @ 51cba28fd6216428e788f94bd8d25043a20bb088

The sources of https://h3rald.com

Started upgrade to Nanoc3, tidying up site:tags task.
h3rald h3rald@h3rald.com
Thu, 15 Apr 2010 15:33:20 +0200
commit

51cba28fd6216428e788f94bd8d25043a20bb088

parent

ed13b4bebd5926083f2ace73bd073497186c7c33

M config.yamlconfig.yaml

@@ -2,10 +2,28 @@ ---

data_sources: - items_root: / layouts_root: / - type: filesystem_combined + type: filesystem_unified +text_extensions: +- css +- erb +- haml +- htm +- html +- js +- less +- markdown +- md +- php +- rb +- sass +- txt +- xml +- textile +- bbcode +- glyph output_dir: output base_url: "http://www.h3rald.com" author_name: "Fabio Cevasco" author_email: "h3rald@h3rald.com" -dev: false +dev: true
M content/tags/ajax.textilecontent/tags/ajax.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: ajax -:title: "Tag: ajax" :filters_pre: - erb +:title: "Tag: ajax" :feed: /tags/ajax/ :feed_title: Tag 'ajax' -----
M content/tags/books.textilecontent/tags/books.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: books -:title: "Tag: books" :filters_pre: - erb +:title: "Tag: books" :feed: /tags/books/ :feed_title: Tag 'books' -----
M content/tags/browsers.textilecontent/tags/browsers.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: browsers -:title: "Tag: browsers" :filters_pre: - erb +:title: "Tag: browsers" :feed: /tags/browsers/ :feed_title: Tag 'browsers' -----
M content/tags/cakephp.textilecontent/tags/cakephp.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: cakephp -:title: "Tag: cakephp" :filters_pre: - erb +:title: "Tag: cakephp" :feed: /tags/cakephp/ :feed_title: Tag 'cakephp' -----
M content/tags/concatenative.textilecontent/tags/concatenative.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: concatenative -:title: "Tag: concatenative" :filters_pre: - erb +:title: "Tag: concatenative" :feed: /tags/concatenative/ :feed_title: Tag 'concatenative' -----
M content/tags/databases.textilecontent/tags/databases.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: databases -:title: "Tag: databases" :filters_pre: - erb +:title: "Tag: databases" :feed: /tags/databases/ :feed_title: Tag 'databases' -----
M content/tags/firefox.textilecontent/tags/firefox.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: firefox -:title: "Tag: firefox" :filters_pre: - erb +:title: "Tag: firefox" :feed: /tags/firefox/ :feed_title: Tag 'firefox' -----
M content/tags/frameworks.textilecontent/tags/frameworks.textile

@@ -1,14 +1,14 @@

----- :type: page :permalink: frameworks -:title: "Tag: frameworks" :filters_pre: - erb +:title: "Tag: frameworks" :feed: /tags/frameworks/ :feed_title: Tag 'frameworks' ----- -<p>6 items are tagged with <em>frameworks</em>:</p> +<p>7 items are tagged with <em>frameworks</em>:</p> <ul> <% articles_tagged_with('frameworks').each do |a| %> <%= render 'dated_article', :article => a %>
A content/tags/glyph-atom.xml

@@ -0,0 +1,6 @@

+----- +:type: feed +:permalink: tags/glyph/atom +:title: H3RALD - Tag 'glyph' (Atom Feed) +----- +<%= atom_feed(:articles => articles_tagged_with('glyph'))%>
A content/tags/glyph-rss.xml

@@ -0,0 +1,6 @@

+----- +:type: feed +:permalink: tags/glyph/rss +:title: H3RALD - Tag 'glyph' (RSS Feed) +----- +<%= rss_feed(:articles => articles_tagged_with('glyph'))%>
A content/tags/glyph.textile

@@ -0,0 +1,17 @@

+----- +:type: page +:permalink: glyph +:filters_pre: +- erb +:title: "Tag: glyph" +:feed: /tags/glyph/ +:feed_title: Tag 'glyph' +----- + +<p>1 item is tagged with <em>glyph</em>:</p> +<ul> + <% articles_tagged_with('glyph').each do |a| %> + <%= render 'dated_article', :article => a %> + <% end %> +</ul> +
M content/tags/google.textilecontent/tags/google.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: google -:title: "Tag: google" :filters_pre: - erb +:title: "Tag: google" :feed: /tags/google/ :feed_title: Tag 'google' -----
M content/tags/ie.textilecontent/tags/ie.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: ie -:title: "Tag: ie" :filters_pre: - erb +:title: "Tag: ie" :feed: /tags/ie/ :feed_title: Tag 'ie' -----
M content/tags/internet.textilecontent/tags/internet.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: internet -:title: "Tag: internet" :filters_pre: - erb +:title: "Tag: internet" :feed: /tags/internet/ :feed_title: Tag 'internet' -----
M content/tags/italy.textilecontent/tags/italy.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: italy -:title: "Tag: italy" :filters_pre: - erb +:title: "Tag: italy" :feed: /tags/italy/ :feed_title: Tag 'italy' -----
M content/tags/li3.textilecontent/tags/li3.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: li3 -:title: "Tag: li3" :filters_pre: - erb +:title: "Tag: li3" :feed: /tags/li3/ :feed_title: Tag 'li3' -----
M content/tags/microsoft.textilecontent/tags/microsoft.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: microsoft -:title: "Tag: microsoft" :filters_pre: - erb +:title: "Tag: microsoft" :feed: /tags/microsoft/ :feed_title: Tag 'microsoft' -----
M content/tags/opensource.textilecontent/tags/opensource.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: opensource -:title: "Tag: opensource" :filters_pre: - erb +:title: "Tag: opensource" :feed: /tags/opensource/ :feed_title: Tag 'opensource' -----
M content/tags/opera.textilecontent/tags/opera.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: opera -:title: "Tag: opera" :filters_pre: - erb +:title: "Tag: opera" :feed: /tags/opera/ :feed_title: Tag 'opera' -----
M content/tags/personal.textilecontent/tags/personal.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: personal -:title: "Tag: personal" :filters_pre: - erb +:title: "Tag: personal" :feed: /tags/personal/ :feed_title: Tag 'personal' -----
M content/tags/personal_log.textilecontent/tags/personal_log.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: personal_log -:title: "Tag: personal_log" :filters_pre: - erb +:title: "Tag: personal_log" :feed: /tags/personal_log/ :feed_title: Tag 'personal_log' -----
M content/tags/php.textilecontent/tags/php.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: php -:title: "Tag: php" :filters_pre: - erb +:title: "Tag: php" :feed: /tags/php/ :feed_title: Tag 'php' -----
M content/tags/politics.textilecontent/tags/politics.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: politics -:title: "Tag: politics" :filters_pre: - erb +:title: "Tag: politics" :feed: /tags/politics/ :feed_title: Tag 'politics' -----
M content/tags/productivity.textilecontent/tags/productivity.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: productivity -:title: "Tag: productivity" :filters_pre: - erb +:title: "Tag: productivity" :feed: /tags/productivity/ :feed_title: Tag 'productivity' -----
M content/tags/programming.textilecontent/tags/programming.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: programming -:title: "Tag: programming" :filters_pre: - erb +:title: "Tag: programming" :feed: /tags/programming/ :feed_title: Tag 'programming' -----
M content/tags/rails.textilecontent/tags/rails.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: rails -:title: "Tag: rails" :filters_pre: - erb +:title: "Tag: rails" :feed: /tags/rails/ :feed_title: Tag 'rails' -----
M content/tags/rant.textilecontent/tags/rant.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: rant -:title: "Tag: rant" :filters_pre: - erb +:title: "Tag: rant" :feed: /tags/rant/ :feed_title: Tag 'rant' -----
M content/tags/rawline.textilecontent/tags/rawline.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: rawline -:title: "Tag: rawline" :filters_pre: - erb +:title: "Tag: rawline" :feed: /tags/rawline/ :feed_title: Tag 'rawline' -----
M content/tags/redbook.textilecontent/tags/redbook.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: redbook -:title: "Tag: redbook" :filters_pre: - erb +:title: "Tag: redbook" :feed: /tags/redbook/ :feed_title: Tag 'redbook' -----
M content/tags/review.textilecontent/tags/review.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: review -:title: "Tag: review" :filters_pre: - erb +:title: "Tag: review" :feed: /tags/review/ :feed_title: Tag 'review' -----
M content/tags/ruby.textilecontent/tags/ruby.textile

@@ -1,14 +1,14 @@

----- :type: page :permalink: ruby -:title: "Tag: ruby" :filters_pre: - erb +:title: "Tag: ruby" :feed: /tags/ruby/ :feed_title: Tag 'ruby' ----- -<p>30 items are tagged with <em>ruby</em>:</p> +<p>31 items are tagged with <em>ruby</em>:</p> <ul> <% articles_tagged_with('ruby').each do |a| %> <%= render 'dated_article', :article => a %>
M content/tags/software.textilecontent/tags/software.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: software -:title: "Tag: software" :filters_pre: - erb +:title: "Tag: software" :feed: /tags/software/ :feed_title: Tag 'software' -----
M content/tags/tools.textilecontent/tags/tools.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: tools -:title: "Tag: tools" :filters_pre: - erb +:title: "Tag: tools" :feed: /tags/tools/ :feed_title: Tag 'tools' -----
M content/tags/travelling.textilecontent/tags/travelling.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: travelling -:title: "Tag: travelling" :filters_pre: - erb +:title: "Tag: travelling" :feed: /tags/travelling/ :feed_title: Tag 'travelling' -----
M content/tags/tutorial.textilecontent/tags/tutorial.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: tutorial -:title: "Tag: tutorial" :filters_pre: - erb +:title: "Tag: tutorial" :feed: /tags/tutorial/ :feed_title: Tag 'tutorial' -----
M content/tags/vim.textilecontent/tags/vim.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: vim -:title: "Tag: vim" :filters_pre: - erb +:title: "Tag: vim" :feed: /tags/vim/ :feed_title: Tag 'vim' -----
M content/tags/web-development.textilecontent/tags/web-development.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: web-development -:title: "Tag: web-development" :filters_pre: - erb +:title: "Tag: web-development" :feed: /tags/web-development/ :feed_title: Tag 'web-development' -----
M content/tags/web20.textilecontent/tags/web20.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: web20 -:title: "Tag: web20" :filters_pre: - erb +:title: "Tag: web20" :feed: /tags/web20/ :feed_title: Tag 'web20' -----
M content/tags/webdevelopment.textilecontent/tags/webdevelopment.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: webdevelopment -:title: "Tag: webdevelopment" :filters_pre: - erb +:title: "Tag: webdevelopment" :feed: /tags/webdevelopment/ :feed_title: Tag 'webdevelopment' -----
M content/tags/website.textilecontent/tags/website.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: website -:title: "Tag: website" :filters_pre: - erb +:title: "Tag: website" :feed: /tags/website/ :feed_title: Tag 'website' -----
M content/tags/wedding.textilecontent/tags/wedding.textile

@@ -1,9 +1,9 @@

----- :type: page :permalink: wedding -:title: "Tag: wedding" :filters_pre: - erb +:title: "Tag: wedding" :feed: /tags/wedding/ :feed_title: Tag 'wedding' -----
M content/tags/writing.textilecontent/tags/writing.textile

@@ -1,14 +1,14 @@

----- :type: page :permalink: writing -:title: "Tag: writing" :filters_pre: - erb +:title: "Tag: writing" :feed: /tags/writing/ :feed_title: Tag 'writing' ----- -<p>16 items are tagged with <em>writing</em>:</p> +<p>17 items are tagged with <em>writing</em>:</p> <ul> <% articles_tagged_with('writing').each do |a| %> <%= render 'dated_article', :article => a %>
M tasks/site.raketasks/site.rake

@@ -31,8 +31,6 @@ task :tags do

site = Nanoc3::Site.new('.') site.load_data dir = Pathname(Dir.pwd)/'content/tags' - dir.rmtree if dir.exist? - dir.mkpath tags = {} # Collect tag and page data site.items.each do |p|

@@ -47,9 +45,20 @@ end

end # Write pages tags.each_pair do |k, v| - write_tag_page dir, k, v - write_tag_feed_page dir, k, 'RSS' - write_tag_feed_page dir, k, 'Atom' + unless (dir/"#{k}.textile").exist? && (dir/"#{k}-rss.xml").exist? && (dir/"#{k}-atom.xml").exist? then + puts "Creating tag pages for '#{k}'" + write_tag_page dir, k, v + write_tag_feed_page dir, k, 'RSS' + write_tag_feed_page dir, k, 'Atom' + end + end + # Remove unused tags + dir.children.each do |c| + t = c.basename.to_s.gsub /(-(rss|atom))?\..+$/, '' + unless tags[t] then + puts "Deleting unused tag page '#{c.basename}'" + c.delete + end end end