sweetie 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.travis.yml +2 -0
- data/Rakefile +4 -5
- data/bin/sweetie +3 -3
- data/lib/sweetie/conversion.rb +131 -0
- data/lib/sweetie.rb +4 -93
- data/spec/source/_config.yml +18 -0
- data/spec/source/site/404.html +1 -0
- data/spec/source/site/about.html +66 -0
- data/spec/source/site/archiv.html +70 -0
- data/spec/source/site/atom.xml +60 -0
- data/spec/source/site/colophon.html +73 -0
- data/spec/source/site/contact.html +67 -0
- data/spec/source/site/css/config.rb +24 -0
- data/spec/source/site/css/sass/site.sass +180 -0
- data/spec/source/site/css/stylesheets/iphone.css +17 -0
- data/spec/source/site/css/stylesheets/site.css +246 -0
- data/spec/source/site/css/stylesheets/syntax.css +60 -0
- data/spec/source/site/follow.html +79 -0
- data/spec/source/site/images/2_avatars.gif +0 -0
- data/spec/source/site/images/favicon.png +0 -0
- data/spec/source/site/images/images-global/matthias_guenther.jpg +0 -0
- data/spec/source/site/images/images-global/matthias_guenther_thumbnail_normal.jpg +0 -0
- data/spec/source/site/images/images-global/matthias_guenther_thumbnail_small.jpg +0 -0
- data/spec/source/site/images/images-global/zoom/closebox.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-caption-fill.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-caption-l.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-caption-r.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-shadow1.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-shadow2.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-shadow3.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-shadow4.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-shadow5.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-shadow6.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-shadow7.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-shadow8.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-1.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-10.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-11.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-12.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-2.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-3.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-4.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-5.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-6.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-7.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-8.png +0 -0
- data/spec/source/site/images/images-global/zoom/zoom-spin-9.png +0 -0
- data/spec/source/site/images/rails3.jpg +0 -0
- data/spec/source/site/index.html +121 -0
- data/spec/source/site/js/FancyZoom.js +761 -0
- data/spec/source/site/js/FancyZoomHTML.js +318 -0
- data/spec/source/site/robots.txt +4 -0
- data/spec/source/site/sitemap.xml +17 -0
- data/spec/source/site/test/config.rb +24 -0
- data/spec/source/site/test/sass/ie.scss +5 -0
- data/spec/source/site/test/sass/print.scss +3 -0
- data/spec/source/site/test/sass/screen.scss +6 -0
- data/spec/source/site/test/stylesheets/ie.css +5 -0
- data/spec/source/site/test/stylesheets/print.css +3 -0
- data/spec/source/site/test/stylesheets/screen.css +69 -0
- data/spec/source/site/why-i-use-jekyll-for-blogging.html +125 -0
- data/spec/sweetie_spec.rb +30 -0
- data/sweetie.gemspec +26 -0
- metadata +86 -9
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Rakefile
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
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
@@ -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
|
1
|
+
require 'sweetie/conversion'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
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’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 ©2011 Matthias Günther
|
57
|
+
•
|
58
|
+
<a rel="nofollow" href="http://blog.wikimatze.de/about.html#top">top</a>
|
59
|
+
•
|
60
|
+
<a rel="nofollow" href="http://feeds.feedburner.com/wikimatze-blog">RSS</a>
|
61
|
+
•
|
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 » <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 ©2011 Matthias Günther
|
61
|
+
•
|
62
|
+
<a rel="nofollow" href="http://blog.wikimatze.de/archiv.html#top">top</a>
|
63
|
+
•
|
64
|
+
<a rel="nofollow" href="http://feeds.feedburner.com/wikimatze-blog">RSS</a>
|
65
|
+
•
|
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"><h1>Why I use Jekyll for blogging</h1>
|
21
|
+
<div class="author">
|
22
|
+
Posted by <a href="http://twitter.com/wikimatze" title="@wikimatze">@wikimatze</a> on Jun 02, 2011
|
23
|
+
</div>
|
24
|
+
<div class="clearer"></div>
|
25
|
+
<p>I always wanted blogging for several years and tried many things different plattforms <a href=":upload_url_public" title="wordpress link">wordpress</a>, <a href="http://www.blogger.com" title="blogger link">blogger</a>, <a href="http://www.tumblr.com/" title="tumblr link">tumblr</a>. 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 <a href="http://www.vim.org/" title="vim link">vim</a>. Every system gives me the freedom to extend it in several ways but in the end it didn&#8217;t provide me the freedom to change every tiny peace I want. With <a href="http://jekyllrb.com" title="jekyll">jekyll</a> I can use my favorite text editor and it really &#8220;<strong>turned me into a text monster</strong>&#8221;. This description sounds like a holy grail, but let me explain in the following sections why it is so great.</p>
|
26
|
+
<h2>What jekyll is</h2>
|
27
|
+
<p>Jekyll is a static site generator written in <a href="http://www.ruby-lang.org/en/" title="ruby gem">ruby</a> 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 <a href="http://redcloth.org/textile" title="Textile">Textile</a> or <a href="http://daringfireball.net/projects/markdown/" title="Markdown link">Markdown</a> though the <a href="http://www.liquidmarkup.org/" title="liquid converters">liquid converters</a> to generate fully generated compiled website. Don&#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 <span class="caps">README</span> files for my github accounts.</p>
|
28
|
+
<h2>Setting up the environment</h2>
|
29
|
+
<p>You need to have a valid ruby and <a href="http://rubygems.org/" title="ruby gems">ruby gems</a> installation on your machine. A simple <code>gem install jekyll</code> will install all the following mentioned gems:</p>
|
30
|
+
<ul>
|
31
|
+
<li><a href="https://github.com/TwP/directory_watcher" title="directory_watcher gem">directory_watcher</a> (gives a list of files which change in some intervals)</li>
|
32
|
+
<li><a href="https://github.com/tobi/liquid" title="liquid gem">liquid</a> (rendering templates in a safe manner)</li>
|
33
|
+
<li><a href="https://github.com/ahoward/open4" title="open4 gem">open4</a> (creates a child process to handle <em>pid</em>, <em>stdout</em>, etc.)</li>
|
34
|
+
<li><a href="http://maruku.rubyforge.org/" title="maruku gem">maruku</a> (Markdown interpreter)</li>
|
35
|
+
<li><a href="http://rubygems.org/gems/classifier" title="classifier gem">classifier</a> (is a Bayes implementation and can be used semantic indexing like to display related post &#8211; this mechanism is used in machine learning)</li>
|
36
|
+
</ul>
|
37
|
+
<p>To get nice syntax highlighting for your code you have to install <a href="http://pygments.org/" title="pygments">pygments</a> via <code>sudo apt-get install python-pygments</code> on Ubuntu/Debian. On <a href="https://github.com/mojombo/jekyll/wiki/install" title="install link for jekyll">install page</a> you can get more information about how to setup jekyll.</p>
|
38
|
+
<h2>The directories and styles</h2>
|
39
|
+
<p>Here is the basic layout of a typical jekyll project:</p>
|
40
|
+
<ul>
|
41
|
+
<li><strong>_includes</strong>: Small snippets which can be used in every place of the page.</li>
|
42
|
+
<li><strong>_layouts</strong>: You can define layouts for post entries and the general default layout. All posts have the special <strong>Yaml Front Matter</strong></li>
|
43
|
+
<li><strong>_posts</strong>: Contains all posts in your specified Markup language</li>
|
44
|
+
<li><strong>_config.yml</strong>: 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.</li>
|
45
|
+
</ul>
|
46
|
+
<p>Other files can just put on the root directory like an <em>atom.xml</em> file (for <span class="caps">RSS</span> feed) or <em>404.html</em> page. For example has my <code>post.html</code> the following layout:</p>
|
47
|
+
<script src="https://gist.github.com/1000906.js"></script><p>The lines between <del>-</del> mark a special <a href="https://github.com/mojombo/jekyll/wiki/YAML-Front-Matter" title="Yaml">Yaml Front Matter</a> file. This block is treated as a special block in jekyll and can contain different components. The <code>{ {content} }</code> stands for the content of a post entry.</p>
|
48
|
+
<h2>Creating a layout</h2>
|
49
|
+
<p>Here is the main template for my blog.</p>
|
50
|
+
<script src="https://gist.github.com/1001155.js?file=default.html"></script><p>I used the meta-language <a href="http://sass-lang.com/" title="sass link">Sass</a> to create my <span class="caps">CSS</span>. There is one problem with Sass: You have to compile it every time you made a change. Fortunately there is the <a href="http://compass-style.org/" title="compass gem">compass gem</a> which always compiles my sass file when I change it. When I build my page I start with <code>compass watch css/ &amp;</code> a command to automate Sass building. This is very handy when I change the layout.</p>
|
51
|
+
<h2>Static webpages &#8211; how to include dynamic content</h2>
|
52
|
+
<p>Jekyll creates only static webpages but with the help of Javascript it is possible to add a <a href="http://disqus.com/" title="disqus link">Disqus</a> comment platform. You just have to create an account and then use the following snippet:</p>
|
53
|
+
<script src="https://gist.github.com/1001268.js?file=comments.html"></script><p>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.</p>
|
54
|
+
<h2>Deployment</h2>
|
55
|
+
<p>There is a <a href="https://github.com/mojombo/jekyll/wiki/Deployment" title="a">bunch</a> of deployment strategies: rsync, ftp, Rack-Jekyll (deploy on Heroku, EC2, etc.). I prefer ftp (with the <a href="https://github.com/dmathieu/glynn" title="glynn gem">glynn gem</a>) because it was easy to install and worked great with my server configuration in my <strong>_config.yml</strong>.</p>
|
56
|
+
<h2>Conclusion</h2>
|
57
|
+
<p>Just look on <a href="https://github.com/mojombo/jekyll/wiki/Sites" title="link to other pages">other pages</a> 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 <code>rake deploy</code> to upload my blog.</p></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 – it wasn’t easy but in ones you get it, it’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: …</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 ©2011 Matthias Günther
|
64
|
+
•
|
65
|
+
<a rel="nofollow" href="http://blog.wikimatze.de/colophon.html#top">top</a>
|
66
|
+
•
|
67
|
+
<a rel="nofollow" href="http://feeds.feedburner.com/wikimatze-blog">RSS</a>
|
68
|
+
•
|
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’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’t drop you a line don’t take it personally.</p>
|
53
|
+
<h2>Following my tail</h2>
|
54
|
+
<p>To be up what’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 ©2011 Matthias Günther
|
58
|
+
•
|
59
|
+
<a rel="nofollow" href="http://blog.wikimatze.de/contact.html#top">top</a>
|
60
|
+
•
|
61
|
+
<a rel="nofollow" href="http://feeds.feedburner.com/wikimatze-blog">RSS</a>
|
62
|
+
•
|
63
|
+
<a rel="nofollow" href="/colophon.html">colophon</a>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|