sweetie 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/.gitignore +6 -0
  2. data/.travis.yml +2 -0
  3. data/Rakefile +4 -5
  4. data/bin/sweetie +3 -3
  5. data/lib/sweetie/conversion.rb +131 -0
  6. data/lib/sweetie.rb +4 -93
  7. data/spec/source/_config.yml +18 -0
  8. data/spec/source/site/404.html +1 -0
  9. data/spec/source/site/about.html +66 -0
  10. data/spec/source/site/archiv.html +70 -0
  11. data/spec/source/site/atom.xml +60 -0
  12. data/spec/source/site/colophon.html +73 -0
  13. data/spec/source/site/contact.html +67 -0
  14. data/spec/source/site/css/config.rb +24 -0
  15. data/spec/source/site/css/sass/site.sass +180 -0
  16. data/spec/source/site/css/stylesheets/iphone.css +17 -0
  17. data/spec/source/site/css/stylesheets/site.css +246 -0
  18. data/spec/source/site/css/stylesheets/syntax.css +60 -0
  19. data/spec/source/site/follow.html +79 -0
  20. data/spec/source/site/images/2_avatars.gif +0 -0
  21. data/spec/source/site/images/favicon.png +0 -0
  22. data/spec/source/site/images/images-global/matthias_guenther.jpg +0 -0
  23. data/spec/source/site/images/images-global/matthias_guenther_thumbnail_normal.jpg +0 -0
  24. data/spec/source/site/images/images-global/matthias_guenther_thumbnail_small.jpg +0 -0
  25. data/spec/source/site/images/images-global/zoom/closebox.png +0 -0
  26. data/spec/source/site/images/images-global/zoom/zoom-caption-fill.png +0 -0
  27. data/spec/source/site/images/images-global/zoom/zoom-caption-l.png +0 -0
  28. data/spec/source/site/images/images-global/zoom/zoom-caption-r.png +0 -0
  29. data/spec/source/site/images/images-global/zoom/zoom-shadow1.png +0 -0
  30. data/spec/source/site/images/images-global/zoom/zoom-shadow2.png +0 -0
  31. data/spec/source/site/images/images-global/zoom/zoom-shadow3.png +0 -0
  32. data/spec/source/site/images/images-global/zoom/zoom-shadow4.png +0 -0
  33. data/spec/source/site/images/images-global/zoom/zoom-shadow5.png +0 -0
  34. data/spec/source/site/images/images-global/zoom/zoom-shadow6.png +0 -0
  35. data/spec/source/site/images/images-global/zoom/zoom-shadow7.png +0 -0
  36. data/spec/source/site/images/images-global/zoom/zoom-shadow8.png +0 -0
  37. data/spec/source/site/images/images-global/zoom/zoom-spin-1.png +0 -0
  38. data/spec/source/site/images/images-global/zoom/zoom-spin-10.png +0 -0
  39. data/spec/source/site/images/images-global/zoom/zoom-spin-11.png +0 -0
  40. data/spec/source/site/images/images-global/zoom/zoom-spin-12.png +0 -0
  41. data/spec/source/site/images/images-global/zoom/zoom-spin-2.png +0 -0
  42. data/spec/source/site/images/images-global/zoom/zoom-spin-3.png +0 -0
  43. data/spec/source/site/images/images-global/zoom/zoom-spin-4.png +0 -0
  44. data/spec/source/site/images/images-global/zoom/zoom-spin-5.png +0 -0
  45. data/spec/source/site/images/images-global/zoom/zoom-spin-6.png +0 -0
  46. data/spec/source/site/images/images-global/zoom/zoom-spin-7.png +0 -0
  47. data/spec/source/site/images/images-global/zoom/zoom-spin-8.png +0 -0
  48. data/spec/source/site/images/images-global/zoom/zoom-spin-9.png +0 -0
  49. data/spec/source/site/images/rails3.jpg +0 -0
  50. data/spec/source/site/index.html +121 -0
  51. data/spec/source/site/js/FancyZoom.js +761 -0
  52. data/spec/source/site/js/FancyZoomHTML.js +318 -0
  53. data/spec/source/site/robots.txt +4 -0
  54. data/spec/source/site/sitemap.xml +17 -0
  55. data/spec/source/site/test/config.rb +24 -0
  56. data/spec/source/site/test/sass/ie.scss +5 -0
  57. data/spec/source/site/test/sass/print.scss +3 -0
  58. data/spec/source/site/test/sass/screen.scss +6 -0
  59. data/spec/source/site/test/stylesheets/ie.css +5 -0
  60. data/spec/source/site/test/stylesheets/print.css +3 -0
  61. data/spec/source/site/test/stylesheets/screen.css +69 -0
  62. data/spec/source/site/why-i-use-jekyll-for-blogging.html +125 -0
  63. data/spec/sweetie_spec.rb +30 -0
  64. data/sweetie.gemspec +26 -0
  65. metadata +86 -9
data/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ .DS_Store
2
+ *~
3
+ *.gem
4
+ *.sass-cache
5
+ .yardoc/*
6
+ sweetie
data/.travis.yml ADDED
@@ -0,0 +1,2 @@
1
+ rvm:
2
+ - 1.9.1
data/Rakefile CHANGED
@@ -1,8 +1,7 @@
1
- require 'rspec/core'
2
- require 'rspec/core/rake_task'
3
-
4
- RSpec::Core::RakeTask.new(:spec) do |spec|
5
- spec.pattern = FileList['spec/**/*_spec.rb']
1
+ task :spec do
2
+ Dir.glob("spec/**/*_spec.rb") do |file|
3
+ system ("rspec #{file}")
4
+ end
6
5
  end
7
6
 
8
7
  task :default => :spec
data/bin/sweetie CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'sweetie'
3
+ $LOAD_PATH.unshift File.dirname(__FILE__) + '/lib'
4
4
 
5
+ require 'sweetie/conversion'
5
6
 
6
- Sweetie.change_config
7
-
7
+ Sweetie::Conversion.change_config
@@ -0,0 +1,131 @@
1
+ module Sweetie
2
+ require 'nokogiri'
3
+
4
+ class Conversion
5
+
6
+ @@config = "_config.yml"
7
+ @@dir = "_site"
8
+
9
+ # Opens the config file and search after the specified parameters.
10
+ # It saves the gathered information about the build-date, the links,
11
+ # the images, and the number of html-pages in the jekyll project.
12
+ def self.change_config
13
+ if !File.exist? @@config or !Dir.exist? @@dir
14
+ raise "Can't find the _config.yml or the _site directory! Please create it!"
15
+ end
16
+
17
+ file = File.open(@@config)
18
+ text = ""
19
+ while line = file.gets
20
+ if line.match(/build:/)
21
+ text << "build: #{build_time}\n"
22
+ elsif line.match(/htmlpages:/)
23
+ text << "htmlpages: #{count_all_html_pages(@@dir)}\n"
24
+ elsif line.match(/images:/)
25
+ text << "images: #{count_all_images(@@dir)}\n"
26
+ elsif line.match(/links:/)
27
+ text << "links: #{count_all_links(@@dir)}\n"
28
+ else
29
+ text << line
30
+ end
31
+ end
32
+ file.close
33
+ File.open(@@config, 'w') do |file|
34
+ file.puts text
35
+ file.close
36
+ end
37
+ end
38
+
39
+ # Counts the link of on html page
40
+ # @param [page] the path of a html page
41
+ # @return the number of unique links
42
+ def self.count_link_of_one_page(page)
43
+ links = []
44
+ links = harvest('//a', page, links)
45
+ output_count(links)
46
+ end
47
+
48
+ # Count the images of one html page
49
+ # @param (see #self.count_link_of_one_page)
50
+ # @return the number of unique images
51
+ def self.count_images_of_one_page(page)
52
+ images = []
53
+ images = harvest('//img', page, images)
54
+ output_count(images)
55
+ end
56
+
57
+ # Counts all html pages
58
+ # @param [Dir] the path of the directory
59
+ # @return [Fixnum] the number of unique html pages
60
+ def self.count_all_html_pages(dir)
61
+ pages = []
62
+ traverse('//html', pages, dir)
63
+ output_count(pages)
64
+ end
65
+
66
+ # Counts all the links of all html pages
67
+ # @param (see #self.count_all_html_pages)
68
+ # @return (see #self.count_all_html_pages)
69
+ def self.count_all_links(dir)
70
+ links = []
71
+ traverse('//a', links, dir)
72
+ output_count(links)
73
+ end
74
+
75
+ # Counts all the images of all html pages
76
+ # @param (see #self.count_all_html_pages)
77
+ # @return (see #self.count_all_html_pages)
78
+ def self.count_all_images(dir)
79
+ images = []
80
+ traverse('//img', images, dir)
81
+ output_count(images)
82
+ end
83
+
84
+ # Create the actual build time
85
+ # @return [String] in the date format mm-dd-yyyy
86
+ def self.build_time
87
+ time = Time.now
88
+ "#{time.month}-#{time.day}-#{time.year}"
89
+ end
90
+
91
+ # Traverse the jekyll directory and get the information about a specific
92
+ # @param [Pattern] is a string for nokogiri after which the html pages should be parsed
93
+ # @param [Ar] is an empty Array which is used by the harvest method
94
+ # @param [Dir] the directory in which the html files are stored
95
+ def self.traverse(pattern, ar, dir)
96
+ Dir.glob(dir+"/**/*") do |file|
97
+ next if file == '.' or file == '..' or file.include?("html~")
98
+ if file.match(/(.*).html/)
99
+ harvest(pattern, file, ar)
100
+ end
101
+ end
102
+ end
103
+
104
+ # Traverse each html page and gather information about the specified html element
105
+ # @param [Pattern] important for nokogiri
106
+ # @param [Html] the path for the html file
107
+ # @param [Ar] and array which stores all the findings produces by nokogiri
108
+ def self.harvest(pattern, html, ar)
109
+ file = File.open(html)
110
+ doc = Nokogiri::HTML(file)
111
+ doc.xpath(pattern).each do |node|
112
+ if pattern == "//a"
113
+ ar << node.text
114
+ elsif pattern == "//img" and ar.include?(node.to_s)
115
+ elsif pattern == "//img"
116
+ ar << node.to_s
117
+ elsif pattern == "//html"
118
+ ar << node
119
+ else
120
+ end
121
+ end
122
+ ar
123
+ end
124
+
125
+ # Count the elements
126
+ # @param [Ar] is an array with all the found html parts
127
+ def self.output_count(ar)
128
+ ar.uniq.count # remove duplicates with uniq
129
+ end
130
+ end
131
+ end
data/lib/sweetie.rb CHANGED
@@ -1,96 +1,7 @@
1
- require "nokogiri"
1
+ require 'sweetie/conversion'
2
2
 
3
- class Sweetie
4
-
5
- @@config = "../_config.yml"
6
- @@dir = "_site"
7
-
8
- def self.change_config
9
- file = File.open(@@config)
10
- text = ""
11
- while line = file.gets
12
- if line.match(/build:/)
13
- text << "build: #{build_time}\n"
14
- elsif line.match(/htmlpages:/)
15
- text << "htmlpages: #{count_html_pages(@@dir)}\n"
16
- elsif line.match(/images:/)
17
- text << "images: #{count_all_images(@@dir)}\n"
18
- elsif line.match(/links:/)
19
- text << "links: #{count_all_links(@@dir)}\n"
20
- else
21
- text << line
22
- end
23
- end
24
- file.close
25
- File.open(@@config, 'w') do |file|
26
- file.puts text
27
- file.close
28
- end
29
- end
30
-
31
- def self.count_link_of_one_page(page)
32
- links = []
33
- links = harvest('//a', page, links, 'a')
34
- output_count(links)
35
- end
36
-
37
- def self.count_images_of_one_page(page)
38
- images = []
39
- images = harvest('//img', page, images, 'img')
40
- output_count(images)
41
- end
42
-
43
- def self.count_html_pages(dir)
44
- pages = []
45
- traverse('//html', pages, 'html', dir)
46
- output_count(pages)
47
- end
48
-
49
- def self.count_all_links(dir)
50
- links = []
51
- traverse('//a', links, 'a', dir)
52
- output_count(links)
53
- end
54
-
55
- def self.count_all_images(dir)
56
- images = []
57
- traverse('//img', images, 'img', dir)
58
- output_count(images)
59
- end
60
-
61
- def self.build_time
62
- time = Time.now
63
- "#{time.month}-#{time.day}-#{time.year}"
64
- end
65
-
66
- def self.traverse(pattern, ar, type, dir)
67
- Dir.glob(dir+"/**/*") do |file|
68
- next if file == '.' or file == '..' or file.include?("html~")
69
- if file.match(/(.*).html/)
70
- harvest(pattern, file, ar, type)
71
- end
72
- end
73
- end
74
-
75
- def self.harvest(pattern, html, ar, type)
76
- file = File.open(html)
77
- doc = Nokogiri::HTML(file)
78
- doc.xpath(pattern).each do |node|
79
- if type == "a"
80
- ar << node.text
81
- elsif type == "img" and ar.include?(node.to_s)
82
- elsif type == "img"
83
- ar << node.to_s
84
- elsif type == "html"
85
- ar << node
86
- else
87
- end
88
- end
89
- ar
90
- end
91
-
92
- def self.output_count(file)
93
- file.uniq.count
94
- end
3
+ module Sweetie
4
+ VERSION = '0.1.0'
5
+ DATE = '2011-07-17'
95
6
  end
96
7
 
@@ -0,0 +1,18 @@
1
+ markdown: marku
2
+ pygments: true
3
+ url: http://0.0.0:4000
4
+ ftp_host: itmbs.com
5
+ ftp_dir: /public_html/blog.wikimatze.de/
6
+ ineturl: http://blog.wikimatze.de
7
+ permalink: /:title.html
8
+ author: @wikimatze
9
+ email: matthias.guenther@wikimatze.de
10
+ fullname: Günther
11
+ title: wikimatze
12
+ build: 7-17-2011
13
+ page: 8
14
+ images: 1
15
+ links: 54
16
+ meta_robots: noodp, nodyr
17
+ pdfdir: pdf
18
+ exclude: ["Rakefile", "README", "pdf", "config", "to_do.txt"]
@@ -0,0 +1 @@
1
+ I'm sorry, the page you are looking for could not be found. Please check the address and try again.
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
3
+
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+ <title>A bit about myself</title>
7
+ <meta name="author" content="Matthias Günther" />
8
+ <meta name="description" content="Blog of Matthias Guenther - software developer, writer, hiker, jogger and mobile apps lover" />
9
+ <meta name="keywords" content="software developer, writer, hiker, jogger and mobile apps lover" />
10
+ <meta name="robots" content="noodp, nodyr" />
11
+ <link href="http://feeds.feedburner.com/wikimatze-blog" rel="alternate" title="Blog of Matthias Günther" type="application/atom+xml" />
12
+
13
+ <link rel="stylesheet" href="/css/stylesheets/syntax.css" type="text/css" />
14
+ <link rel="stylesheet" href="/css/stylesheets/site.css" type="text/css" media="screen, projection" />
15
+ <link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" />
16
+ <script src="/js/FancyZoom.js" type="text/javascript"></script>
17
+ <script src="/js/FancyZoomHTML.js" type="text/javascript"></script>
18
+
19
+ <!-- iphone settings and css -->
20
+ <meta name="viewport" content="user-scalable=no, width=device-width" />
21
+ <link rel="stylesheet" type="text/css" href="/css/iphone.css" media="only screen and (max-width: 470px)" />
22
+ <script type="text/javascript" src="<txp:site_url />textpattern/jquery.js"></script>
23
+ <script type="text/javascript">
24
+ /* <![CDATA[ */
25
+ $(document).ready(function() {
26
+ $('.external').attr('target', '_blank');
27
+ });
28
+ /* ]]> */
29
+ </script>
30
+ </head>
31
+ <body onLoad="setupZoom();">
32
+ <div class="site">
33
+ <a name="top"></a>
34
+ <div class="title">
35
+ <span id="sitetitle">
36
+ <a href="/index.html">wikimatze</a>
37
+ </span>
38
+ <span id="tagseperator">|</span>
39
+ <span id="tagline">
40
+ Funny sides of life
41
+ </span>
42
+ </div>
43
+ <div class="nav">
44
+ <a id="navlink" href="/archiv.html">blog-archive</a>
45
+ <a id="navlink" href="/about.html">about</a>
46
+ <a id="navlink" href="/contact.html">contact</a>
47
+ <a id="navlink" href="/follow.html">follow</a>
48
+ </div>
49
+ <h1>A bit about myself</h1>
50
+ <p><a href="/images/images-global/matthias_guenther.jpg" title="Matthias Guenther" class="blog"><img src="/images/images-global/matthias_guenther_thumbnail_small.jpg" alt="matthias_guenther.jpg" style="float:right; padding-left:10px;"/></a></p>
51
+ <p>Hi! My name is Matthias Guenther and I run this blog. I love learning and can&#8217;t leave my fingertips from new stuff. The weird the stuff is so better for my motivation to solve the problem.</p>
52
+ <p>In this blog I write everything related to my programming experience and the daily struggle to get a better workflow.</p>
53
+ <p>You can <a href="http://0.0.0:4000/contact.html" title="contact me">contact me</a> or if you want to know about my weird hobbies (painting small figures, taking pictures) visit <a href="http://www.wikimatze.de/Main/About" class="external">my homepage</a>.</p>
54
+ <div class="clearer"></div>
55
+ <div class="footer">
56
+ Copyright &copy;2011 Matthias Günther
57
+ &bull;
58
+ <a rel="nofollow" href="http://blog.wikimatze.de/about.html#top">top</a>
59
+ &bull;
60
+ <a rel="nofollow" href="http://feeds.feedburner.com/wikimatze-blog">RSS</a>
61
+ &bull;
62
+ <a rel="nofollow" href="/colophon.html">colophon</a>
63
+ </div>
64
+ </div>
65
+ </body>
66
+ </html>
@@ -0,0 +1,70 @@
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
3
+
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+ <title>archive</title>
7
+ <meta name="author" content="Matthias Günther" />
8
+ <meta name="description" content="The archive of my blog posts" />
9
+ <meta name="keywords" content="software developer, writer, hiker, jogger and mobile apps lover" />
10
+ <meta name="robots" content="noodp, nodyr" />
11
+ <link href="http://feeds.feedburner.com/wikimatze-blog" rel="alternate" title="Blog of Matthias Günther" type="application/atom+xml" />
12
+
13
+ <link rel="stylesheet" href="/css/stylesheets/syntax.css" type="text/css" />
14
+ <link rel="stylesheet" href="/css/stylesheets/site.css" type="text/css" media="screen, projection" />
15
+ <link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" />
16
+ <script src="/js/FancyZoom.js" type="text/javascript"></script>
17
+ <script src="/js/FancyZoomHTML.js" type="text/javascript"></script>
18
+
19
+ <!-- iphone settings and css -->
20
+ <meta name="viewport" content="user-scalable=no, width=device-width" />
21
+ <link rel="stylesheet" type="text/css" href="/css/iphone.css" media="only screen and (max-width: 470px)" />
22
+ <script type="text/javascript" src="<txp:site_url />textpattern/jquery.js"></script>
23
+ <script type="text/javascript">
24
+ /* <![CDATA[ */
25
+ $(document).ready(function() {
26
+ $('.external').attr('target', '_blank');
27
+ });
28
+ /* ]]> */
29
+ </script>
30
+ </head>
31
+ <body onLoad="setupZoom();">
32
+ <div class="site">
33
+ <a name="top"></a>
34
+ <div class="title">
35
+ <span id="sitetitle">
36
+ <a href="/index.html">wikimatze</a>
37
+ </span>
38
+ <span id="tagseperator">|</span>
39
+ <span id="tagline">
40
+ Everything needs a place
41
+ </span>
42
+ </div>
43
+ <div class="nav">
44
+ <a id="navlink" href="/archiv.html">blog-archive</a>
45
+ <a id="navlink" href="/about.html">about</a>
46
+ <a id="navlink" href="/contact.html">contact</a>
47
+ <a id="navlink" href="/follow.html">follow</a>
48
+ </div>
49
+ <h1>archive</h1>
50
+ <ul class="archiv">
51
+
52
+
53
+ <h3>2011</h3>
54
+
55
+ <li>Jun/02 &raquo; <a href="/why-i-use-jekyll-for-blogging.html">Why I use Jekyll for blogging</a></li>
56
+
57
+ </ul>
58
+ <div class="clearer"></div>
59
+ <div class="footer">
60
+ Copyright &copy;2011 Matthias Günther
61
+ &bull;
62
+ <a rel="nofollow" href="http://blog.wikimatze.de/archiv.html#top">top</a>
63
+ &bull;
64
+ <a rel="nofollow" href="http://feeds.feedburner.com/wikimatze-blog">RSS</a>
65
+ &bull;
66
+ <a rel="nofollow" href="/colophon.html">colophon</a>
67
+ </div>
68
+ </div>
69
+ </body>
70
+ </html>
@@ -0,0 +1,60 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <feed xmlns="http://www.w3.org/2005/Atom">
3
+ <title>wikimatze</title>
4
+ <link href="http://0.0.0:4000/atom.xml" rel="self"/>
5
+ <link href="http://0.0.0:4000"/>
6
+ <updated>2011-06-24T11:53:28+02:00</updated>
7
+ <id>http://0.0.0:4000</id>
8
+ <author>
9
+ <name>Matthias Günther</name>
10
+ <email>matthias.guenther@wikimatze.de</email>
11
+ </author>
12
+ <rights> Copyright (c) 2011 Matthias Günther </rights>
13
+
14
+
15
+ <entry>
16
+ <title></title>
17
+ <link href="http://0.0.0:4000/why-i-use-jekyll-for-blogging.html"/>
18
+ <updated>2011-06-02T00:00:00+02:00</updated>
19
+ <id>http://0.0.0:4000/why-i-use-jekyll-for-blogging</id>
20
+ <content type="html">&lt;h1&gt;Why I use Jekyll for blogging&lt;/h1&gt;
21
+ &lt;div class=&quot;author&quot;&gt;
22
+ Posted by &lt;a href=&quot;http://twitter.com/wikimatze&quot; title=&quot;@wikimatze&quot;&gt;@wikimatze&lt;/a&gt; on Jun 02, 2011
23
+ &lt;/div&gt;
24
+ &lt;div class=&quot;clearer&quot;&gt;&lt;/div&gt;
25
+ &lt;p&gt;I always wanted blogging for several years and tried many things different plattforms &lt;a href=&quot;:upload_url_public&quot; title=&quot;wordpress link&quot;&gt;wordpress&lt;/a&gt;, &lt;a href=&quot;http://www.blogger.com&quot; title=&quot;blogger link&quot;&gt;blogger&lt;/a&gt;, &lt;a href=&quot;http://www.tumblr.com/&quot; title=&quot;tumblr link&quot;&gt;tumblr&lt;/a&gt;. The main problem which kept me away from writing was just the fact, that every time I want to write I just had to do it in a new environment in a certain gui and not in my favorite editor &lt;a href=&quot;http://www.vim.org/&quot; title=&quot;vim link&quot;&gt;vim&lt;/a&gt;. Every system gives me the freedom to extend it in several ways but in the end it didn&amp;#8217;t provide me the freedom to change every tiny peace I want. With &lt;a href=&quot;http://jekyllrb.com&quot; title=&quot;jekyll&quot;&gt;jekyll&lt;/a&gt; I can use my favorite text editor and it really &amp;#8220;&lt;strong&gt;turned me into a text monster&lt;/strong&gt;&amp;#8221;. This description sounds like a holy grail, but let me explain in the following sections why it is so great.&lt;/p&gt;
26
+ &lt;h2&gt;What jekyll is&lt;/h2&gt;
27
+ &lt;p&gt;Jekyll is a static site generator written in &lt;a href=&quot;http://www.ruby-lang.org/en/&quot; title=&quot;ruby gem&quot;&gt;ruby&lt;/a&gt; to generate html pages. The page is presented through several templates and then fires the whole site were articles are written text markup language like &lt;a href=&quot;http://redcloth.org/textile&quot; title=&quot;Textile&quot;&gt;Textile&lt;/a&gt; or &lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot; title=&quot;Markdown link&quot;&gt;Markdown&lt;/a&gt; though the &lt;a href=&quot;http://www.liquidmarkup.org/&quot; title=&quot;liquid converters&quot;&gt;liquid converters&lt;/a&gt; to generate fully generated compiled website. Don&amp;#8217;t think that it will be so easy for you to do it. First of all you have to learn either Textile or Markdown. I chose textile for writing my posts because I use Markdown to create the &lt;span class=&quot;caps&quot;&gt;README&lt;/span&gt; files for my github accounts.&lt;/p&gt;
28
+ &lt;h2&gt;Setting up the environment&lt;/h2&gt;
29
+ &lt;p&gt;You need to have a valid ruby and &lt;a href=&quot;http://rubygems.org/&quot; title=&quot;ruby gems&quot;&gt;ruby gems&lt;/a&gt; installation on your machine. A simple &lt;code&gt;gem install jekyll&lt;/code&gt; will install all the following mentioned gems:&lt;/p&gt;
30
+ &lt;ul&gt;
31
+ &lt;li&gt;&lt;a href=&quot;https://github.com/TwP/directory_watcher&quot; title=&quot;directory_watcher gem&quot;&gt;directory_watcher&lt;/a&gt; (gives a list of files which change in some intervals)&lt;/li&gt;
32
+ &lt;li&gt;&lt;a href=&quot;https://github.com/tobi/liquid&quot; title=&quot;liquid gem&quot;&gt;liquid&lt;/a&gt; (rendering templates in a safe manner)&lt;/li&gt;
33
+ &lt;li&gt;&lt;a href=&quot;https://github.com/ahoward/open4&quot; title=&quot;open4 gem&quot;&gt;open4&lt;/a&gt; (creates a child process to handle &lt;em&gt;pid&lt;/em&gt;, &lt;em&gt;stdout&lt;/em&gt;, etc.)&lt;/li&gt;
34
+ &lt;li&gt;&lt;a href=&quot;http://maruku.rubyforge.org/&quot; title=&quot;maruku gem&quot;&gt;maruku&lt;/a&gt; (Markdown interpreter)&lt;/li&gt;
35
+ &lt;li&gt;&lt;a href=&quot;http://rubygems.org/gems/classifier&quot; title=&quot;classifier gem&quot;&gt;classifier&lt;/a&gt; (is a Bayes implementation and can be used semantic indexing like to display related post &amp;#8211; this mechanism is used in machine learning)&lt;/li&gt;
36
+ &lt;/ul&gt;
37
+ &lt;p&gt;To get nice syntax highlighting for your code you have to install &lt;a href=&quot;http://pygments.org/&quot; title=&quot;pygments&quot;&gt;pygments&lt;/a&gt; via &lt;code&gt;sudo apt-get install python-pygments&lt;/code&gt; on Ubuntu/Debian. On &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki/install&quot; title=&quot;install link for jekyll&quot;&gt;install page&lt;/a&gt; you can get more information about how to setup jekyll.&lt;/p&gt;
38
+ &lt;h2&gt;The directories and styles&lt;/h2&gt;
39
+ &lt;p&gt;Here is the basic layout of a typical jekyll project:&lt;/p&gt;
40
+ &lt;ul&gt;
41
+ &lt;li&gt;&lt;strong&gt;_includes&lt;/strong&gt;: Small snippets which can be used in every place of the page.&lt;/li&gt;
42
+ &lt;li&gt;&lt;strong&gt;_layouts&lt;/strong&gt;: You can define layouts for post entries and the general default layout. All posts have the special &lt;strong&gt;Yaml Front Matter&lt;/strong&gt;&lt;/li&gt;
43
+ &lt;li&gt;&lt;strong&gt;_posts&lt;/strong&gt;: Contains all posts in your specified Markup language&lt;/li&gt;
44
+ &lt;li&gt;&lt;strong&gt;_config.yml&lt;/strong&gt;: Is a file to store configuration data like the styling of the urls, the ftp account. It is also possible to define own variables which can be used as global things on other pages.&lt;/li&gt;
45
+ &lt;/ul&gt;
46
+ &lt;p&gt;Other files can just put on the root directory like an &lt;em&gt;atom.xml&lt;/em&gt; file (for &lt;span class=&quot;caps&quot;&gt;RSS&lt;/span&gt; feed) or &lt;em&gt;404.html&lt;/em&gt; page. For example has my &lt;code&gt;post.html&lt;/code&gt; the following layout:&lt;/p&gt;
47
+ &lt;script src=&quot;https://gist.github.com/1000906.js&quot;&gt;&lt;/script&gt;&lt;p&gt;The lines between &lt;del&gt;-&lt;/del&gt; mark a special &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki/YAML-Front-Matter&quot; title=&quot;Yaml&quot;&gt;Yaml Front Matter&lt;/a&gt; file. This block is treated as a special block in jekyll and can contain different components. The &lt;code&gt;{ {content} }&lt;/code&gt; stands for the content of a post entry.&lt;/p&gt;
48
+ &lt;h2&gt;Creating a layout&lt;/h2&gt;
49
+ &lt;p&gt;Here is the main template for my blog.&lt;/p&gt;
50
+ &lt;script src=&quot;https://gist.github.com/1001155.js?file=default.html&quot;&gt;&lt;/script&gt;&lt;p&gt;I used the meta-language &lt;a href=&quot;http://sass-lang.com/&quot; title=&quot;sass link&quot;&gt;Sass&lt;/a&gt; to create my &lt;span class=&quot;caps&quot;&gt;CSS&lt;/span&gt;. There is one problem with Sass: You have to compile it every time you made a change. Fortunately there is the &lt;a href=&quot;http://compass-style.org/&quot; title=&quot;compass gem&quot;&gt;compass gem&lt;/a&gt; which always compiles my sass file when I change it. When I build my page I start with &lt;code&gt;compass watch css/ &amp;amp;&lt;/code&gt; a command to automate Sass building. This is very handy when I change the layout.&lt;/p&gt;
51
+ &lt;h2&gt;Static webpages &amp;#8211; how to include dynamic content&lt;/h2&gt;
52
+ &lt;p&gt;Jekyll creates only static webpages but with the help of Javascript it is possible to add a &lt;a href=&quot;http://disqus.com/&quot; title=&quot;disqus link&quot;&gt;Disqus&lt;/a&gt; comment platform. You just have to create an account and then use the following snippet:&lt;/p&gt;
53
+ &lt;script src=&quot;https://gist.github.com/1001268.js?file=comments.html&quot;&gt;&lt;/script&gt;&lt;p&gt;It is best to put this piece of code in a extra file under your _includes directory and then add it in your template for posts. Now the comment function is available in all your posts.&lt;/p&gt;
54
+ &lt;h2&gt;Deployment&lt;/h2&gt;
55
+ &lt;p&gt;There is a &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki/Deployment&quot; title=&quot;a&quot;&gt;bunch&lt;/a&gt; of deployment strategies: rsync, ftp, Rack-Jekyll (deploy on Heroku, EC2, etc.). I prefer ftp (with the &lt;a href=&quot;https://github.com/dmathieu/glynn&quot; title=&quot;glynn gem&quot;&gt;glynn gem&lt;/a&gt;) because it was easy to install and worked great with my server configuration in my &lt;strong&gt;_config.yml&lt;/strong&gt;.&lt;/p&gt;
56
+ &lt;h2&gt;Conclusion&lt;/h2&gt;
57
+ &lt;p&gt;Just look on &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki/Sites&quot; title=&quot;link to other pages&quot;&gt;other pages&lt;/a&gt; what is possible with Jekyll. You can learn many new things by looking at other jekyll blogs and copy what you need. I love it write a little bit and after I finished an article just perform &lt;code&gt;rake deploy&lt;/code&gt; to upload my blog.&lt;/p&gt;</content>
58
+ </entry>
59
+
60
+ </feed>
@@ -0,0 +1,73 @@
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
3
+
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+ <title>Colophon</title>
7
+ <meta name="author" content="Matthias Günther" />
8
+ <meta name="description" content="Final words" />
9
+ <meta name="keywords" content="software developer, writer, hiker, jogger and mobile apps lover" />
10
+ <meta name="robots" content="noodp, nodyr" />
11
+ <link href="http://feeds.feedburner.com/wikimatze-blog" rel="alternate" title="Blog of Matthias Günther" type="application/atom+xml" />
12
+
13
+ <link rel="stylesheet" href="/css/stylesheets/syntax.css" type="text/css" />
14
+ <link rel="stylesheet" href="/css/stylesheets/site.css" type="text/css" media="screen, projection" />
15
+ <link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" />
16
+ <script src="/js/FancyZoom.js" type="text/javascript"></script>
17
+ <script src="/js/FancyZoomHTML.js" type="text/javascript"></script>
18
+
19
+ <!-- iphone settings and css -->
20
+ <meta name="viewport" content="user-scalable=no, width=device-width" />
21
+ <link rel="stylesheet" type="text/css" href="/css/iphone.css" media="only screen and (max-width: 470px)" />
22
+ <script type="text/javascript" src="<txp:site_url />textpattern/jquery.js"></script>
23
+ <script type="text/javascript">
24
+ /* <![CDATA[ */
25
+ $(document).ready(function() {
26
+ $('.external').attr('target', '_blank');
27
+ });
28
+ /* ]]> */
29
+ </script>
30
+ </head>
31
+ <body onLoad="setupZoom();">
32
+ <div class="site">
33
+ <a name="top"></a>
34
+ <div class="title">
35
+ <span id="sitetitle">
36
+ <a href="/index.html">wikimatze</a>
37
+ </span>
38
+ <span id="tagseperator">|</span>
39
+ <span id="tagline">
40
+ Better website for the world
41
+ </span>
42
+ </div>
43
+ <div class="nav">
44
+ <a id="navlink" href="/archiv.html">blog-archive</a>
45
+ <a id="navlink" href="/about.html">about</a>
46
+ <a id="navlink" href="/contact.html">contact</a>
47
+ <a id="navlink" href="/follow.html">follow</a>
48
+ </div>
49
+ <h1>Colophon</h1>
50
+ <p>This website is written with a combination of <a href="http://www.vim.org/" title="vim">Vim</a>, <a href="http://sass-lang.com/" title="sass">Sass</a> and <a href="http://redcloth.org/textile" title="textile markup language">textile</a>. <a href="http://jekyllrb.com/" title="jekyll">Jekyll</a> was the piece of software to clue everything together.</p>
51
+ <p>I crafted the website in such a way that you can view it easily on your iPhone &#8211; it wasn&#8217;t easy but in ones you get it, it&#8217;s easy like learing cycling. Hope that this website is accessible through many browser.</p>
52
+ <h2>How the side was build</h2>
53
+ <h2>Current status</h2>
54
+ <ul>
55
+ <li>Last build: &#8230;</li>
56
+ <li>it consists of xx pages</li>
57
+ <li>Has xxx links</li>
58
+ <li>and links</li>
59
+ </ul>
60
+ <p>This website was build in Germany and changes are welcomed every time.</p>
61
+ <div class="clearer"></div>
62
+ <div class="footer">
63
+ Copyright &copy;2011 Matthias Günther
64
+ &bull;
65
+ <a rel="nofollow" href="http://blog.wikimatze.de/colophon.html#top">top</a>
66
+ &bull;
67
+ <a rel="nofollow" href="http://feeds.feedburner.com/wikimatze-blog">RSS</a>
68
+ &bull;
69
+ <a rel="nofollow" href="/colophon.html">colophon</a>
70
+ </div>
71
+ </div>
72
+ </body>
73
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
3
+
4
+ <head>
5
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6
+ <title>Contact Information</title>
7
+ <meta name="author" content="Matthias Günther" />
8
+ <meta name="description" content="Basic information and how to contact me" />
9
+ <meta name="keywords" content="software developer, writer, hiker, jogger and mobile apps lover" />
10
+ <meta name="robots" content="noodp, nodyr" />
11
+ <link href="http://feeds.feedburner.com/wikimatze-blog" rel="alternate" title="Blog of Matthias Günther" type="application/atom+xml" />
12
+
13
+ <link rel="stylesheet" href="/css/stylesheets/syntax.css" type="text/css" />
14
+ <link rel="stylesheet" href="/css/stylesheets/site.css" type="text/css" media="screen, projection" />
15
+ <link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" />
16
+ <script src="/js/FancyZoom.js" type="text/javascript"></script>
17
+ <script src="/js/FancyZoomHTML.js" type="text/javascript"></script>
18
+
19
+ <!-- iphone settings and css -->
20
+ <meta name="viewport" content="user-scalable=no, width=device-width" />
21
+ <link rel="stylesheet" type="text/css" href="/css/iphone.css" media="only screen and (max-width: 470px)" />
22
+ <script type="text/javascript" src="<txp:site_url />textpattern/jquery.js"></script>
23
+ <script type="text/javascript">
24
+ /* <![CDATA[ */
25
+ $(document).ready(function() {
26
+ $('.external').attr('target', '_blank');
27
+ });
28
+ /* ]]> */
29
+ </script>
30
+ </head>
31
+ <body onLoad="setupZoom();">
32
+ <div class="site">
33
+ <a name="top"></a>
34
+ <div class="title">
35
+ <span id="sitetitle">
36
+ <a href="/index.html">wikimatze</a>
37
+ </span>
38
+ <span id="tagseperator">|</span>
39
+ <span id="tagline">
40
+ How to stay in contact
41
+ </span>
42
+ </div>
43
+ <div class="nav">
44
+ <a id="navlink" href="/archiv.html">blog-archive</a>
45
+ <a id="navlink" href="/about.html">about</a>
46
+ <a id="navlink" href="/contact.html">contact</a>
47
+ <a id="navlink" href="/follow.html">follow</a>
48
+ </div>
49
+ <h1>Contact Information</h1>
50
+ <p>Email is nowadays the primarily medium for easy communication. So if you have something to say about the things you find on this page or you have some business needs for me, don&#8217;t hesitate to write me. My email address is:</p>
51
+ <p><a href="mailto:matthias.guenther@wikimatze.de" title="matthias.guenther @ wikimatze.de">matthias.guenther@wikimatze.de</a></p>
52
+ <p>Please not that it may take a little time until I answer your mail and if I don&#8217;t drop you a line don&#8217;t take it personally.</p>
53
+ <h2>Following my tail</h2>
54
+ <p>To be up what&#8217;s going on with, you can <a href="http://0.0.0:4000/follow.html" title="follow me">follow me</a> on the social networks. Recently I mostly twitter about the stuff that concerns me actually.</p>
55
+ <div class="clearer"></div>
56
+ <div class="footer">
57
+ Copyright &copy;2011 Matthias Günther
58
+ &bull;
59
+ <a rel="nofollow" href="http://blog.wikimatze.de/contact.html#top">top</a>
60
+ &bull;
61
+ <a rel="nofollow" href="http://feeds.feedburner.com/wikimatze-blog">RSS</a>
62
+ &bull;
63
+ <a rel="nofollow" href="/colophon.html">colophon</a>
64
+ </div>
65
+ </div>
66
+ </body>
67
+ </html>