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
@@ -0,0 +1,318 @@
1
+ // FancyZoomHTML.js - v1.0
2
+ // Used to draw necessary HTML elements for FancyZoom
3
+ //
4
+ // Copyright (c) 2008 Cabel Sasser / Panic Inc
5
+ // All rights reserved.
6
+
7
+ function insertZoomHTML() {
8
+
9
+ // All of this junk creates the three <div>'s used to hold the closebox, image, and zoom shadow.
10
+
11
+ var inBody = document.getElementsByTagName("body").item(0);
12
+
13
+ // WAIT SPINNER
14
+
15
+ var inSpinbox = document.createElement("div");
16
+ inSpinbox.setAttribute('id', 'ZoomSpin');
17
+ inSpinbox.style.position = 'absolute';
18
+ inSpinbox.style.left = '10px';
19
+ inSpinbox.style.top = '10px';
20
+ inSpinbox.style.visibility = 'hidden';
21
+ inSpinbox.style.zIndex = '525';
22
+ inBody.insertBefore(inSpinbox, inBody.firstChild);
23
+
24
+ var inSpinImage = document.createElement("img");
25
+ inSpinImage.setAttribute('id', 'SpinImage');
26
+ inSpinImage.setAttribute('src', zoomImagesURI+'zoom-spin-1.png');
27
+ inSpinbox.appendChild(inSpinImage);
28
+
29
+ // ZOOM IMAGE
30
+ //
31
+ // <div id="ZoomBox">
32
+ // <a href="javascript:zoomOut();"><img src="/images/spacer.gif" id="ZoomImage" border="0"></a> <!-- THE IMAGE -->
33
+ // <div id="ZoomClose">
34
+ // <a href="javascript:zoomOut();"><img src="/images/closebox.png" width="30" height="30" border="0"></a>
35
+ // </div>
36
+ // </div>
37
+
38
+ var inZoombox = document.createElement("div");
39
+ inZoombox.setAttribute('id', 'ZoomBox');
40
+
41
+ inZoombox.style.position = 'absolute';
42
+ inZoombox.style.left = '10px';
43
+ inZoombox.style.top = '10px';
44
+ inZoombox.style.visibility = 'hidden';
45
+ inZoombox.style.zIndex = '499';
46
+
47
+ inBody.insertBefore(inZoombox, inSpinbox.nextSibling);
48
+
49
+ var inImage1 = document.createElement("img");
50
+ inImage1.onclick = function (event) { zoomOut(this, event); return false; };
51
+ inImage1.setAttribute('src',zoomImagesURI+'spacer.gif');
52
+ inImage1.setAttribute('id','ZoomImage');
53
+ inImage1.setAttribute('border', '0');
54
+ // inImage1.setAttribute('onMouseOver', 'zoomMouseOver();')
55
+ // inImage1.setAttribute('onMouseOut', 'zoomMouseOut();')
56
+
57
+ // This must be set first, so we can later test it using webkitBoxShadow.
58
+ inImage1.setAttribute('style', '-webkit-box-shadow: '+shadowSettings+'0.0)');
59
+ inImage1.style.display = 'block';
60
+ inImage1.style.width = '10px';
61
+ inImage1.style.height = '10px';
62
+ inImage1.style.cursor = 'pointer'; // -webkit-zoom-out?
63
+ inZoombox.appendChild(inImage1);
64
+
65
+ var inClosebox = document.createElement("div");
66
+ inClosebox.setAttribute('id', 'ZoomClose');
67
+ inClosebox.style.position = 'absolute';
68
+
69
+ // In MSIE, we need to put the close box inside the image.
70
+ // It's 2008 and I'm having to do a browser detect? Sigh.
71
+ if (browserIsIE) {
72
+ inClosebox.style.left = '-1px';
73
+ inClosebox.style.top = '0px';
74
+ } else {
75
+ inClosebox.style.left = '-15px';
76
+ inClosebox.style.top = '-15px';
77
+ }
78
+
79
+ inClosebox.style.visibility = 'hidden';
80
+ inZoombox.appendChild(inClosebox);
81
+
82
+ var inImage2 = document.createElement("img");
83
+ inImage2.onclick = function (event) { zoomOut(this, event); return false; };
84
+ inImage2.setAttribute('src',zoomImagesURI+'closebox.png');
85
+ inImage2.setAttribute('width','30');
86
+ inImage2.setAttribute('height','30');
87
+ inImage2.setAttribute('border','0');
88
+ inImage2.style.cursor = 'pointer';
89
+ inClosebox.appendChild(inImage2);
90
+
91
+ // SHADOW
92
+ // Only draw the table-based shadow if the programatic webkitBoxShadow fails!
93
+ // Also, don't draw it if we're IE -- it wouldn't look quite right anyway.
94
+
95
+ if (! document.getElementById('ZoomImage').style.webkitBoxShadow && ! browserIsIE) {
96
+
97
+ // SHADOW BASE
98
+
99
+ var inFixedBox = document.createElement("div");
100
+ inFixedBox.setAttribute('id', 'ShadowBox');
101
+ inFixedBox.style.position = 'absolute';
102
+ inFixedBox.style.left = '50px';
103
+ inFixedBox.style.top = '50px';
104
+ inFixedBox.style.width = '100px';
105
+ inFixedBox.style.height = '100px';
106
+ inFixedBox.style.visibility = 'hidden';
107
+ inFixedBox.style.zIndex = '498';
108
+ inBody.insertBefore(inFixedBox, inZoombox.nextSibling);
109
+
110
+ // SHADOW
111
+ // Now, the shadow table. Skip if not compatible, or irrevelant with -box-shadow.
112
+
113
+ // <div id="ShadowBox"><table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0"> X
114
+ // <tr height="25">
115
+ // <td width="27"><img src="/images/zoom-shadow1.png" width="27" height="25"></td>
116
+ // <td background="/images/zoom-shadow2.png">&nbsp;</td>
117
+ // <td width="27"><img src="/images/zoom-shadow3.png" width="27" height="25"></td>
118
+ // </tr>
119
+
120
+ var inShadowTable = document.createElement("table");
121
+ inShadowTable.setAttribute('border', '0');
122
+ inShadowTable.setAttribute('width', '100%');
123
+ inShadowTable.setAttribute('height', '100%');
124
+ inShadowTable.setAttribute('cellpadding', '0');
125
+ inShadowTable.setAttribute('cellspacing', '0');
126
+ inFixedBox.appendChild(inShadowTable);
127
+
128
+ var inShadowTbody = document.createElement("tbody"); // Needed for IE (for HTML4).
129
+ inShadowTable.appendChild(inShadowTbody);
130
+
131
+ var inRow1 = document.createElement("tr");
132
+ inRow1.style.height = '25px';
133
+ inShadowTbody.appendChild(inRow1);
134
+
135
+ var inCol1 = document.createElement("td");
136
+ inCol1.style.width = '27px';
137
+ inRow1.appendChild(inCol1);
138
+ var inShadowImg1 = document.createElement("img");
139
+ inShadowImg1.setAttribute('src', zoomImagesURI+'zoom-shadow1.png');
140
+ inShadowImg1.setAttribute('width', '27');
141
+ inShadowImg1.setAttribute('height', '25');
142
+ inShadowImg1.style.display = 'block';
143
+ inCol1.appendChild(inShadowImg1);
144
+
145
+ var inCol2 = document.createElement("td");
146
+ inCol2.setAttribute('background', zoomImagesURI+'zoom-shadow2.png');
147
+ inRow1.appendChild(inCol2);
148
+ // inCol2.innerHTML = '<img src=';
149
+ var inSpacer1 = document.createElement("img");
150
+ inSpacer1.setAttribute('src',zoomImagesURI+'spacer.gif');
151
+ inSpacer1.setAttribute('height', '1');
152
+ inSpacer1.setAttribute('width', '1');
153
+ inSpacer1.style.display = 'block';
154
+ inCol2.appendChild(inSpacer1);
155
+
156
+ var inCol3 = document.createElement("td");
157
+ inCol3.style.width = '27px';
158
+ inRow1.appendChild(inCol3);
159
+ var inShadowImg3 = document.createElement("img");
160
+ inShadowImg3.setAttribute('src', zoomImagesURI+'zoom-shadow3.png');
161
+ inShadowImg3.setAttribute('width', '27');
162
+ inShadowImg3.setAttribute('height', '25');
163
+ inShadowImg3.style.display = 'block';
164
+ inCol3.appendChild(inShadowImg3);
165
+
166
+ // <tr>
167
+ // <td background="/images/zoom-shadow4.png">&nbsp;</td>
168
+ // <td bgcolor="#ffffff">&nbsp;</td>
169
+ // <td background="/images/zoom-shadow5.png">&nbsp;</td>
170
+ // </tr>
171
+
172
+ inRow2 = document.createElement("tr");
173
+ inShadowTbody.appendChild(inRow2);
174
+
175
+ var inCol4 = document.createElement("td");
176
+ inCol4.setAttribute('background', zoomImagesURI+'zoom-shadow4.png');
177
+ inRow2.appendChild(inCol4);
178
+ // inCol4.innerHTML = '&nbsp;';
179
+ var inSpacer2 = document.createElement("img");
180
+ inSpacer2.setAttribute('src',zoomImagesURI+'spacer.gif');
181
+ inSpacer2.setAttribute('height', '1');
182
+ inSpacer2.setAttribute('width', '1');
183
+ inSpacer2.style.display = 'block';
184
+ inCol4.appendChild(inSpacer2);
185
+
186
+ var inCol5 = document.createElement("td");
187
+ inCol5.setAttribute('bgcolor', '#ffffff');
188
+ inRow2.appendChild(inCol5);
189
+ // inCol5.innerHTML = '&nbsp;';
190
+ var inSpacer3 = document.createElement("img");
191
+ inSpacer3.setAttribute('src',zoomImagesURI+'spacer.gif');
192
+ inSpacer3.setAttribute('height', '1');
193
+ inSpacer3.setAttribute('width', '1');
194
+ inSpacer3.style.display = 'block';
195
+ inCol5.appendChild(inSpacer3);
196
+
197
+ var inCol6 = document.createElement("td");
198
+ inCol6.setAttribute('background', zoomImagesURI+'zoom-shadow5.png');
199
+ inRow2.appendChild(inCol6);
200
+ // inCol6.innerHTML = '&nbsp;';
201
+ var inSpacer4 = document.createElement("img");
202
+ inSpacer4.setAttribute('src',zoomImagesURI+'spacer.gif');
203
+ inSpacer4.setAttribute('height', '1');
204
+ inSpacer4.setAttribute('width', '1');
205
+ inSpacer4.style.display = 'block';
206
+ inCol6.appendChild(inSpacer4);
207
+
208
+ // <tr height="26">
209
+ // <td width="27"><img src="/images/zoom-shadow6.png" width="27" height="26"</td>
210
+ // <td background="/images/zoom-shadow7.png">&nbsp;</td>
211
+ // <td width="27"><img src="/images/zoom-shadow8.png" width="27" height="26"></td>
212
+ // </tr>
213
+ // </table>
214
+
215
+ var inRow3 = document.createElement("tr");
216
+ inRow3.style.height = '26px';
217
+ inShadowTbody.appendChild(inRow3);
218
+
219
+ var inCol7 = document.createElement("td");
220
+ inCol7.style.width = '27px';
221
+ inRow3.appendChild(inCol7);
222
+ var inShadowImg7 = document.createElement("img");
223
+ inShadowImg7.setAttribute('src', zoomImagesURI+'zoom-shadow6.png');
224
+ inShadowImg7.setAttribute('width', '27');
225
+ inShadowImg7.setAttribute('height', '26');
226
+ inShadowImg7.style.display = 'block';
227
+ inCol7.appendChild(inShadowImg7);
228
+
229
+ var inCol8 = document.createElement("td");
230
+ inCol8.setAttribute('background', zoomImagesURI+'zoom-shadow7.png');
231
+ inRow3.appendChild(inCol8);
232
+ // inCol8.innerHTML = '&nbsp;';
233
+ var inSpacer5 = document.createElement("img");
234
+ inSpacer5.setAttribute('src',zoomImagesURI+'spacer.gif');
235
+ inSpacer5.setAttribute('height', '1');
236
+ inSpacer5.setAttribute('width', '1');
237
+ inSpacer5.style.display = 'block';
238
+ inCol8.appendChild(inSpacer5);
239
+
240
+ var inCol9 = document.createElement("td");
241
+ inCol9.style.width = '27px';
242
+ inRow3.appendChild(inCol9);
243
+ var inShadowImg9 = document.createElement("img");
244
+ inShadowImg9.setAttribute('src', zoomImagesURI+'zoom-shadow8.png');
245
+ inShadowImg9.setAttribute('width', '27');
246
+ inShadowImg9.setAttribute('height', '26');
247
+ inShadowImg9.style.display = 'block';
248
+ inCol9.appendChild(inShadowImg9);
249
+ }
250
+
251
+ if (includeCaption) {
252
+
253
+ // CAPTION
254
+ //
255
+ // <div id="ZoomCapDiv" style="margin-left: 13px; margin-right: 13px;">
256
+ // <table border="1" cellpadding="0" cellspacing="0">
257
+ // <tr height="26">
258
+ // <td><img src="zoom-caption-l.png" width="13" height="26"></td>
259
+ // <td rowspan="3" background="zoom-caption-fill.png"><div id="ZoomCaption"></div></td>
260
+ // <td><img src="zoom-caption-r.png" width="13" height="26"></td>
261
+ // </tr>
262
+ // </table>
263
+ // </div>
264
+
265
+ var inCapDiv = document.createElement("div");
266
+ inCapDiv.setAttribute('id', 'ZoomCapDiv');
267
+ inCapDiv.style.position = 'absolute';
268
+ inCapDiv.style.visibility = 'hidden';
269
+ inCapDiv.style.marginLeft = 'auto';
270
+ inCapDiv.style.marginRight = 'auto';
271
+ inCapDiv.style.zIndex = '501';
272
+
273
+ inBody.insertBefore(inCapDiv, inZoombox.nextSibling);
274
+
275
+ var inCapTable = document.createElement("table");
276
+ inCapTable.setAttribute('border', '0');
277
+ inCapTable.setAttribute('cellPadding', '0'); // Wow. These honestly need to
278
+ inCapTable.setAttribute('cellSpacing', '0'); // be intercapped to work in IE. WTF?
279
+ inCapDiv.appendChild(inCapTable);
280
+
281
+ var inTbody = document.createElement("tbody"); // Needed for IE (for HTML4).
282
+ inCapTable.appendChild(inTbody);
283
+
284
+ var inCapRow1 = document.createElement("tr");
285
+ inTbody.appendChild(inCapRow1);
286
+
287
+ var inCapCol1 = document.createElement("td");
288
+ inCapCol1.setAttribute('align', 'right');
289
+ inCapRow1.appendChild(inCapCol1);
290
+ var inCapImg1 = document.createElement("img");
291
+ inCapImg1.setAttribute('src', zoomImagesURI+'zoom-caption-l.png');
292
+ inCapImg1.setAttribute('width', '13');
293
+ inCapImg1.setAttribute('height', '26');
294
+ inCapImg1.style.display = 'block';
295
+ inCapCol1.appendChild(inCapImg1);
296
+
297
+ var inCapCol2 = document.createElement("td");
298
+ inCapCol2.setAttribute('background', zoomImagesURI+'zoom-caption-fill.png');
299
+ inCapCol2.setAttribute('id', 'ZoomCaption');
300
+ inCapCol2.setAttribute('valign', 'middle');
301
+ inCapCol2.style.fontSize = '14px';
302
+ inCapCol2.style.fontFamily = 'Helvetica';
303
+ inCapCol2.style.fontWeight = 'bold';
304
+ inCapCol2.style.color = '#ffffff';
305
+ inCapCol2.style.textShadow = '0px 2px 4px #000000';
306
+ inCapCol2.style.whiteSpace = 'nowrap';
307
+ inCapRow1.appendChild(inCapCol2);
308
+
309
+ var inCapCol3 = document.createElement("td");
310
+ inCapRow1.appendChild(inCapCol3);
311
+ var inCapImg2 = document.createElement("img");
312
+ inCapImg2.setAttribute('src', zoomImagesURI+'zoom-caption-r.png');
313
+ inCapImg2.setAttribute('width', '13');
314
+ inCapImg2.setAttribute('height', '26');
315
+ inCapImg2.style.display = 'block';
316
+ inCapCol3.appendChild(inCapImg2);
317
+ }
318
+ }
@@ -0,0 +1,4 @@
1
+ User-agent: *
2
+ Disallow:
3
+ Sitemap: http://blog.wikimatze.de/sitemap.xml
4
+
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
+ <url>
4
+ <loc>http://0.0.0:4000/</loc>
5
+ <lastmod>2011-06-24T11:53:28+02:00</lastmod>
6
+ <changefreq>daily</changefreq>
7
+ <priority>1.0</priority>
8
+ </url>
9
+
10
+ <url>
11
+ <loc>http://0.0.0:4000/why-i-use-jekyll-for-blogging.html</loc>
12
+ <lastmod>2011-06-24T11:53:28+02:00</lastmod>
13
+ <changefreq>weekly</changefreq>
14
+ <priority>0.8</priority>
15
+ </url>
16
+
17
+ </urlset>
@@ -0,0 +1,24 @@
1
+ # Require any additional compass plugins here.
2
+
3
+ # Set this to the root of your project when deployed:
4
+ http_path = "/"
5
+ css_dir = "stylesheets"
6
+ sass_dir = "sass"
7
+ images_dir = "images"
8
+ javascripts_dir = "javascripts"
9
+
10
+ # You can select your preferred output style here (can be overridden via the command line):
11
+ # output_style = :expanded or :nested or :compact or :compressed
12
+
13
+ # To enable relative paths to assets via compass helper functions. Uncomment:
14
+ # relative_assets = true
15
+
16
+ # To disable debugging comments that display the original location of your selectors. Uncomment:
17
+ # line_comments = false
18
+
19
+
20
+ # If you prefer the indented syntax, you might want to regenerate this
21
+ # project again passing --syntax sass, or you can uncomment this:
22
+ # preferred_syntax = :sass
23
+ # and then run:
24
+ # sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
@@ -0,0 +1,5 @@
1
+ /* Welcome to Compass. Use this file to write IE specific override styles.
2
+ * Import this file using the following HTML or equivalent:
3
+ * <!--[if IE]>
4
+ * <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
5
+ * <![endif]--> */
@@ -0,0 +1,3 @@
1
+ /* Welcome to Compass. Use this file to define print styles.
2
+ * Import this file using the following HTML or equivalent:
3
+ * <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" /> */
@@ -0,0 +1,6 @@
1
+ /* Welcome to Compass.
2
+ * In this file you should write your main styles. (or centralize your imports)
3
+ * Import this file using the following HTML or equivalent:
4
+ * <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
5
+
6
+ @import "compass/reset";
@@ -0,0 +1,5 @@
1
+ /* Welcome to Compass. Use this file to write IE specific override styles.
2
+ * Import this file using the following HTML or equivalent:
3
+ * <!--[if IE]>
4
+ * <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
5
+ * <![endif]--> */
@@ -0,0 +1,3 @@
1
+ /* Welcome to Compass. Use this file to define print styles.
2
+ * Import this file using the following HTML or equivalent:
3
+ * <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" /> */
@@ -0,0 +1,69 @@
1
+ /* Welcome to Compass.
2
+ * In this file you should write your main styles. (or centralize your imports)
3
+ * Import this file using the following HTML or equivalent:
4
+ * <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" /> */
5
+ /* line 17, ../../../../.rvm/gems/ruby-1.9.2-p180/gems/compass-0.11.3/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
6
+ html, body, div, span, applet, object, iframe,
7
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
8
+ a, abbr, acronym, address, big, cite, code,
9
+ del, dfn, em, img, ins, kbd, q, s, samp,
10
+ small, strike, strong, sub, sup, tt, var,
11
+ b, u, i, center,
12
+ dl, dt, dd, ol, ul, li,
13
+ fieldset, form, label, legend,
14
+ table, caption, tbody, tfoot, thead, tr, th, td,
15
+ article, aside, canvas, details, embed,
16
+ figure, figcaption, footer, header, hgroup,
17
+ menu, nav, output, ruby, section, summary,
18
+ time, mark, audio, video {
19
+ margin: 0;
20
+ padding: 0;
21
+ border: 0;
22
+ font-size: 100%;
23
+ font: inherit;
24
+ vertical-align: baseline;
25
+ }
26
+
27
+ /* line 20, ../../../../.rvm/gems/ruby-1.9.2-p180/gems/compass-0.11.3/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
28
+ body {
29
+ line-height: 1;
30
+ }
31
+
32
+ /* line 22, ../../../../.rvm/gems/ruby-1.9.2-p180/gems/compass-0.11.3/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
33
+ ol, ul {
34
+ list-style: none;
35
+ }
36
+
37
+ /* line 24, ../../../../.rvm/gems/ruby-1.9.2-p180/gems/compass-0.11.3/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
38
+ table {
39
+ border-collapse: collapse;
40
+ border-spacing: 0;
41
+ }
42
+
43
+ /* line 26, ../../../../.rvm/gems/ruby-1.9.2-p180/gems/compass-0.11.3/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
44
+ caption, th, td {
45
+ text-align: left;
46
+ font-weight: normal;
47
+ vertical-align: middle;
48
+ }
49
+
50
+ /* line 28, ../../../../.rvm/gems/ruby-1.9.2-p180/gems/compass-0.11.3/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
51
+ q, blockquote {
52
+ quotes: none;
53
+ }
54
+ /* line 101, ../../../../.rvm/gems/ruby-1.9.2-p180/gems/compass-0.11.3/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
55
+ q:before, q:after, blockquote:before, blockquote:after {
56
+ content: "";
57
+ content: none;
58
+ }
59
+
60
+ /* line 30, ../../../../.rvm/gems/ruby-1.9.2-p180/gems/compass-0.11.3/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
61
+ a img {
62
+ border: none;
63
+ }
64
+
65
+ /* line 115, ../../../../.rvm/gems/ruby-1.9.2-p180/gems/compass-0.11.3/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
66
+ article, aside, details, figcaption, figure,
67
+ footer, header, hgroup, menu, nav, section {
68
+ display: block;
69
+ }
@@ -0,0 +1,125 @@
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>Why I use Jekyll for blogging</title>
7
+ <meta name="author" content="Matthias Günther" />
8
+ <meta name="description" content="" />
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
+
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
+ <div id="post">
50
+ <h1>Why I use Jekyll for blogging</h1>
51
+ <div class="author">
52
+ Posted by <a href="http://twitter.com/wikimatze" title="@wikimatze">@wikimatze</a> on Jun 02, 2011
53
+ </div>
54
+ <div class="clearer"></div>
55
+ <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>
56
+ <h2>What jekyll is</h2>
57
+ <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>
58
+ <h2>Setting up the environment</h2>
59
+ <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>
60
+ <ul>
61
+ <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>
62
+ <li><a href="https://github.com/tobi/liquid" title="liquid gem">liquid</a> (rendering templates in a safe manner)</li>
63
+ <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>
64
+ <li><a href="http://maruku.rubyforge.org/" title="maruku gem">maruku</a> (Markdown interpreter)</li>
65
+ <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>
66
+ </ul>
67
+ <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>
68
+ <h2>The directories and styles</h2>
69
+ <p>Here is the basic layout of a typical jekyll project:</p>
70
+ <ul>
71
+ <li><strong>_includes</strong>: Small snippets which can be used in every place of the page.</li>
72
+ <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>
73
+ <li><strong>_posts</strong>: Contains all posts in your specified Markup language</li>
74
+ <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>
75
+ </ul>
76
+ <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>
77
+ <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>
78
+ <h2>Creating a layout</h2>
79
+ <p>Here is the main template for my blog.</p>
80
+ <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>
81
+ <h2>Static webpages &#8211; how to include dynamic content</h2>
82
+ <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>
83
+ <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>
84
+ <h2>Deployment</h2>
85
+ <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>
86
+ <h2>Conclusion</h2>
87
+ <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>
88
+ <span class="tweet"><a href="http://twitter.com/?status=Reading 'Why I use Jekyll for blogging' from http://0.0.0:4000/why-i-use-jekyll-for-blogging.html by @wikimatze" title="Tweet Why I use Jekyll for blogging">Tweet this post</a></span>
89
+
90
+
91
+ <div class="clearer"></div>
92
+ <div id="disqus_thread"></div>
93
+ <script type="text/javascript">
94
+ /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
95
+ var disqus_shortname = 'wikimatze'; // required: replace example with your forum shortname
96
+
97
+ // The following are highly recommended additional parameters. Remove the slashes in front to use.
98
+ // var disqus_identifier = 'unique_dynamic_id_1234';
99
+ // var disqus_url = 'http://example.com/permalink-to-page.html';
100
+
101
+ /* * * DON'T EDIT BELOW THIS LINE * * */
102
+ (function() {
103
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
104
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
105
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
106
+ })();
107
+ </script>
108
+ <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
109
+ <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
110
+
111
+ </div>
112
+
113
+ <div class="clearer"></div>
114
+ <div class="footer">
115
+ Copyright &copy;2011 Matthias Günther
116
+ &bull;
117
+ <a rel="nofollow" href="http://blog.wikimatze.de/why-i-use-jekyll-for-blogging.html#top">top</a>
118
+ &bull;
119
+ <a rel="nofollow" href="http://feeds.feedburner.com/wikimatze-blog">RSS</a>
120
+ &bull;
121
+ <a rel="nofollow" href="/colophon.html">colophon</a>
122
+ </div>
123
+ </div>
124
+ </body>
125
+ </html>
@@ -0,0 +1,30 @@
1
+ require 'sweetie/conversion'
2
+
3
+ describe Sweetie::Conversion do
4
+ before :each do
5
+ current_dir = File.dirname(__FILE__)
6
+ @about_page = File.join(current_dir, 'source', 'site', 'about.html')
7
+ @site_dir = File.join(current_dir, 'source', 'site')
8
+ @stati = Sweetie::Conversion
9
+ end
10
+
11
+ it "should count links of about.html page" do
12
+ @stati.count_link_of_one_page(@about_page).should == 11
13
+ end
14
+
15
+ it "should count images of about.html page" do
16
+ @stati.count_images_of_one_page(@about_page).should == 1
17
+ end
18
+
19
+ it "should count all html pages" do
20
+ @stati.count_all_html_pages(@site_dir).should == 8
21
+ end
22
+
23
+ it "should count all links of all pages" do
24
+ @stati.count_all_links(@site_dir).should == 54
25
+ end
26
+
27
+ it "should count all images" do
28
+ @stati.count_all_images(@site_dir).should == 1
29
+ end
30
+ end