karakuri 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +10 -10
- data/Rakefile +2 -2
- metadata +3 -3
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Karakuri
|
|
2
2
|
|
|
3
3
|
Having a closer look at ruby based blogging platforms like [serious](http://github.com/colszowka/serious) and [toto](http://cloudhead.io/toto), I missed some functionality.
|
|
4
4
|
|
|
5
|
-
This a a collection of tools usable in both platforms.
|
|
5
|
+
This a a collection of tools usable in both platforms. The project was formerly known as blog_helper, but Karakuri is a fra more suitable name & will be used from now on.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ This a a collection of tools usable in both platforms.
|
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
|
-
It's a piece of cake: just use the `gem` tool to get going with the
|
|
16
|
+
It's a piece of cake: just use the `gem` tool to get going with the _Karakuri_: `sudo gem install karakuri`
|
|
17
17
|
|
|
18
18
|
If you want to use features that rely on accessing the http requests like the _tag_ feature, you'll need to use the [_toto_prerelease_](http://github.com/5v3n/toto).
|
|
19
19
|
|
|
@@ -21,7 +21,7 @@ Please follow the instrucions there to do so.
|
|
|
21
21
|
|
|
22
22
|
## Usage
|
|
23
23
|
|
|
24
|
-
Piece of cake, again: all you have to do is use `<% require '
|
|
24
|
+
Piece of cake, again: all you have to do is use `<% require 'karakuri'%>` in your .rhtml or .erb file and call the corresponding methods.
|
|
25
25
|
|
|
26
26
|
### SEO friendly titles
|
|
27
27
|
For example, to use seo friendly titles, your layout.rhtml should be looking like this:
|
|
@@ -31,7 +31,7 @@ For example, to use seo friendly titles, your layout.rhtml should be looking lik
|
|
|
31
31
|
<html>
|
|
32
32
|
<head>
|
|
33
33
|
<% require 'blog_helper'
|
|
34
|
-
page_title =
|
|
34
|
+
page_title = Karakuri::seo_friendly_title(@path, title, 'yourSitesTitle.com')
|
|
35
35
|
%>
|
|
36
36
|
<title><%= page_title %></title>
|
|
37
37
|
<link rel="alternate" type="application/atom+xml" title="<%= page_title %> - feed" href="/index.xml" />
|
|
@@ -62,7 +62,7 @@ Next, you need a place to show the tag links, for example the index.rhtml:
|
|
|
62
62
|
<h1><a href="<%= article.path %>"><%= article.title %></a></h1>
|
|
63
63
|
<span class="descr"><%= article.date %></span><% 10.times { %> <%}%>
|
|
64
64
|
<span class="tags">
|
|
65
|
-
<%=
|
|
65
|
+
<%= Karakuri::tag_link_list(article[:tags]) %>
|
|
66
66
|
</span><% 10.times { %> <%}%>
|
|
67
67
|
.
|
|
68
68
|
.
|
|
@@ -77,12 +77,12 @@ Create a page called `tagged.rhtml` in your `templates/pages` directory that loo
|
|
|
77
77
|
|
|
78
78
|
<%
|
|
79
79
|
require 'blog_helper'
|
|
80
|
-
desired_tag =
|
|
80
|
+
desired_tag = Karakuri::desired_tag(env["QUERY_STRING"])
|
|
81
81
|
%>
|
|
82
82
|
<h1>Posts filed under '<%= desired_tag %>': </h1>
|
|
83
83
|
<ul>
|
|
84
84
|
|
|
85
|
-
<%
|
|
85
|
+
<% Karakuri::desired_articles(@articles, desired_tag).each do |article| %>
|
|
86
86
|
<li>
|
|
87
87
|
<span class="descr"><a href="<%= article.path %>" alt="<%= article.title %>"><%= article.title %></a><br/></span>
|
|
88
88
|
</li>
|
|
@@ -97,14 +97,14 @@ Now, you did most likely implement a tag listing on your toto blog. Congrats!
|
|
|
97
97
|
|
|
98
98
|
To use a bit.ly shortened URL, just call the followin function inside a .rhtml file:
|
|
99
99
|
|
|
100
|
-
<%=
|
|
100
|
+
<%= Karakuri::short_url_bitly(<url>, <bit.ly login name>, <bit.ly api key>) %>
|
|
101
101
|
|
|
102
102
|
|
|
103
103
|
### disqus comment counter
|
|
104
104
|
|
|
105
105
|
Basically just adds the necessary java script to enable the disqus comment counter. For best performance, place it near the end of the page:
|
|
106
106
|
|
|
107
|
-
<%=
|
|
107
|
+
<%= Karakuri::disqus_comment_count_js(@config[:disqus]) %>
|
|
108
108
|
</body>
|
|
109
109
|
|
|
110
110
|
</html>
|
data/Rakefile
CHANGED
|
@@ -12,7 +12,7 @@ require 'rake/testtask'
|
|
|
12
12
|
|
|
13
13
|
spec = Gem::Specification.new do |s|
|
|
14
14
|
s.name = 'karakuri'
|
|
15
|
-
s.version = '0.1.
|
|
15
|
+
s.version = '0.1.1'
|
|
16
16
|
s.has_rdoc = true
|
|
17
17
|
s.extra_rdoc_files = ['README.md', 'LICENSE']
|
|
18
18
|
s.summary = 'Some handy helpers for toto and the likes...'
|
|
@@ -35,7 +35,7 @@ end
|
|
|
35
35
|
Rake::RDocTask.new do |rdoc|
|
|
36
36
|
files =['README.md', 'LICENSE', 'lib/**/*.rb']
|
|
37
37
|
rdoc.rdoc_files.add(files)
|
|
38
|
-
rdoc.main = "README" # page to start on
|
|
38
|
+
rdoc.main = "README.md" # page to start on
|
|
39
39
|
rdoc.title = "Karakuri Docs"
|
|
40
40
|
rdoc.rdoc_dir = 'doc/rdoc' # rdoc output folder
|
|
41
41
|
rdoc.options << '--line-numbers'
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: karakuri
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 25
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 1
|
|
9
|
-
-
|
|
10
|
-
version: 0.1.
|
|
9
|
+
- 1
|
|
10
|
+
version: 0.1.1
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Sven Kraeuter
|