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,121 @@
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>wikimatze</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
+ Root of disease
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="blog-header">
50
+
51
+ <h1>Why I use Jekyll for blogging</h1>
52
+ <div class="author">
53
+ <p>Posted by <a href="http://twitter.com/wikimatze" title="@wikimatze">@wikimatze</a> on Jun 02, 2011</p>
54
+ </div>
55
+ <div class="clearer"></div>
56
+ <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>
57
+ <h2>What jekyll is</h2>
58
+ <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"><span class="caps">README</span></span> files for my github accounts.</p>
59
+ <h2>Setting up the environment</h2>
60
+ <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>
61
+ <ul>
62
+ <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>
63
+ <li><a href="https://github.com/tobi/liquid" title="liquid gem">liquid</a> (rendering templates in a safe manner)</li>
64
+ <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>
65
+ <li><a href="http://maruku.rubyforge.org/" title="maruku gem">maruku</a> (Markdown interpreter)</li>
66
+ <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>
67
+ </ul>
68
+ <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>
69
+ <h2>The directories and styles</h2>
70
+ <p>Here is the basic layout of a typical jekyll project:</p>
71
+ <ul>
72
+ <li><strong>_includes</strong>: Small snippets which can be used in every place of the page.</li>
73
+ <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>
74
+ <li><strong>_posts</strong>: Contains all posts in your specified Markup language</li>
75
+ <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>
76
+ </ul>
77
+ <p>Other files can just put on the root directory like an <em>atom.xml</em> file (for <span class="caps"><span class="caps">RSS</span></span> feed) or <em>404.html</em> page. For example has my <code>post.html</code> the following layout:</p>
78
+ <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>
79
+ <h2>Creating a layout</h2>
80
+ <p>Here is the main template for my blog.</p>
81
+ <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"><span class="caps">CSS</span></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;amp;</code> a command to automate Sass building. This is very handy when I change the layout.</p>
82
+ <h2>Static webpages &#8211; how to include dynamic content</h2>
83
+ <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>
84
+ <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>
85
+ <h2>Deployment</h2>
86
+ <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>
87
+ <h2>Conclusion</h2>
88
+ <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>
89
+ Comments: <a href="/why-i-use-jekyll-for-blogging.html#disqus_thread">(view/add your own)</a>
90
+
91
+ <!-- count the comments of disqs thread -->
92
+ <script type="text/javascript">
93
+ var disqus_shortname = &#8216;wikimatze&#8217;;
94
+ (function () {
95
+ var s = document.createElement(&#8216;script&#8217;); s.async = true;
96
+ s.type = &#8216;text/javascript&#8217;;
97
+ s.src = &#8216;http://&#8217; + disqus_shortname + &#8216;.disqus.com/count.js&#8217;;
98
+ (document.getElementsByTagName(&#8216;<span class="caps">HEAD</span>&#8217;)<sup class="footnote" id="fnr0"><a href="#fn0">0</a></sup> || document.getElementsByTagName(&#8216;<span class="caps">BODY</span>&#8217;)<sup class="footnote" id="fnr0"><a href="#fn0">0</a></sup>).appendChild(s);
99
+ }());
100
+ </script>
101
+ <h2>Recent entries</h2>
102
+ <ul class="posts">
103
+
104
+ <li><span> 02-06-2011</span> &raquo; <a href="/why-i-use-jekyll-for-blogging.html">Why I use Jekyll for blogging</a></li>
105
+
106
+ <a id="archivelink"href="/archiv.html">&raquo; archive</a>
107
+ </ul>
108
+ </div>
109
+ <div class="clearer"></div>
110
+ <div class="footer">
111
+ Copyright &copy;2011 Matthias Günther
112
+ &bull;
113
+ <a rel="nofollow" href="http://blog.wikimatze.de/index.html#top">top</a>
114
+ &bull;
115
+ <a rel="nofollow" href="http://feeds.feedburner.com/wikimatze-blog">RSS</a>
116
+ &bull;
117
+ <a rel="nofollow" href="/colophon.html">colophon</a>
118
+ </div>
119
+ </div>
120
+ </body>
121
+ </html>