-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
185 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
|
||
<body> | ||
<section> | ||
<article> | ||
|
||
<header> | ||
<h2>Second post</h2> | ||
<time>08.06.2011</time> | ||
<h3>Tags: alpha</h3> | ||
<header> | ||
|
||
<p>Second blog entry</p> | ||
|
||
<footer> | ||
<h2><a href="/#/2011/06/08/second-blog-entry">Back</a></h2> | ||
<!-- Disqus comments engine --> | ||
<div id="disqus_thread"></div> | ||
<script type="text/javascript"> | ||
var disqus_shortname = 'ivlgithubblog'; | ||
var disqus_title = 'Second post'; | ||
var disqus_url = 'http://ivl.github.com' + '/2011/06/08/second-blog-entry.html'; | ||
var disqus_id = '/2011/06/08/second-blog-entry'; | ||
|
||
(function() { | ||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; | ||
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; | ||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | ||
})(); | ||
</script> | ||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> | ||
|
||
<p>Tag cloud <span style='font-size: 66%'><a href='/tags/beta/'>beta</a></span> | ||
<span style='font-size: 133%'><a href='/tags/alpha/'>alpha</a></span> | ||
</p> | ||
</footer> | ||
</article> | ||
|
||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
|
||
require 'webrick' | ||
require "term/ansicolor" | ||
require "jekyll" | ||
|
||
task :default => :tag_cloud | ||
|
||
desc 'Generate tags page' | ||
task :tags do | ||
puts "Generating tags..." | ||
require 'rubygems' | ||
require 'jekyll' | ||
include Jekyll::Filters | ||
|
||
options = Jekyll.configuration({}) | ||
site = Jekyll::Site.new(options) | ||
site.read_posts('') | ||
|
||
FileUtils.rm_rf "tags" | ||
|
||
site.tags.sort.each do |tag, posts| | ||
html = '' | ||
html << <<-HTML | ||
--- | ||
layout: default | ||
title: Postings tagged "#{tag}" | ||
--- | ||
<h1 id="#{tag}">Postings tagged "#{tag}"</h1> | ||
HTML | ||
|
||
html << '<ul class="posts">' | ||
posts.each do |post| | ||
post_data = post.to_liquid | ||
html << <<-HTML | ||
<li><a href="#{post.url}">#{post_data['title']}</a></li> | ||
HTML | ||
end | ||
html << '</ul>' | ||
FileUtils.mkdir_p("tags/#{tag}"); | ||
File.open("tags/#{tag}/index.html", 'w+') do |file| | ||
file.puts html | ||
end | ||
end | ||
puts 'Done.' | ||
end | ||
|
||
desc 'Generate tags pages' | ||
task :tag_cloud => :tags do | ||
puts 'Generating tag cloud...' | ||
require 'rubygems' | ||
require 'jekyll' | ||
include Jekyll::Filters | ||
|
||
options = Jekyll.configuration({}) | ||
site = Jekyll::Site.new(options) | ||
site.read_posts('') | ||
|
||
html = '' | ||
max_count = site.tags.map{|t,p| p.count}.max | ||
site.tags.sort.each do |tag, posts| | ||
s = posts.count | ||
font_size = ((20 - 10.0*(max_count-s)/max_count)*2).to_i/2.0 | ||
html << "<a href=\"/tags/#{tag.gsub(/ /,"%20")}\" title=\"Postings tagged #{tag}\" style=\"font-size: #{font_size}px; line-height:#{font_size}px\">#{tag}</a> " | ||
end | ||
File.open('_includes/tag_cloud.html', 'w+') do |file| | ||
file.puts html | ||
end | ||
puts 'Done.' | ||
end | ||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
|
||
<body> | ||
<section> | ||
<h1 id="alpha">Postings tagged "alpha"</h1> | ||
<ul class="posts"> <li><a href="/2011/06/07/first-blog-entry.html">my first post</a></li> | ||
</ul> | ||
|
||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
|
||
<body> | ||
<section> | ||
<h1 id="alpha">Postings tagged "alpha"</h1> | ||
<ul class="posts"> <li><a href="/2011/06/07/first-blog-entry.html">my first post</a></li> | ||
<li><a href="/2011/06/08/second-blog-entry.html">Second post</a></li> | ||
</ul> | ||
|
||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
|
||
<body> | ||
<section> | ||
<h1 id="beta">Postings tagged "beta"</h1> | ||
<ul class="posts"> <li><a href="/2011/06/07/first-blog-entry.html">my first post</a></li> | ||
</ul> | ||
|
||
</section> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
</head> | ||
|
||
<body> | ||
<section> | ||
<h1 id="beta">Postings tagged "beta"</h1> | ||
<ul class="posts"> <li><a href="/2011/06/07/first-blog-entry.html">my first post</a></li> | ||
</ul> | ||
|
||
</section> | ||
</body> | ||
</html> |