statikaj 0.0.3.yanked → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjNmNGQxNzY1MzY5ZjVhOTU2MTg1OTc0NjM2YTlkZmFlMzJmODA0YQ==
4
+ ZDYzMGUyYjg0YjhiOGYzYzU0MDMwNGQ1OGFkNzA3N2I0OTFhNmI0Yw==
5
5
  data.tar.gz: !binary |-
6
- ZmE3MTY2ODNlYzM3YTVhN2YwOGIxODhiNjUxYmUyNTBiZTU4NTcwYg==
6
+ MDg1Y2YxYzFlMDRmNjNlNjQyMGRkMjVhNGJjOGQxY2VkYTJmZTgzOQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NTRlNTVkOTMxM2FlMDQ4NDRlODUyN2M4MGZmNTU2MGRiZWU3Y2NlNjM4OTU3
10
- ZDMyZTJhYjlkN2ViNmM2ZTFjNWEyOTIyNTA2OGI2MzQ4MjllNzg0ZTU2YTIx
11
- OWQ5MmNmNGE2ZGE4OTUzYzcxM2EwYjM1NmE2M2U5MmU3OTljZjc=
9
+ ZDQ0ZDJjNzAxMjJmZDA1MzIxYzRiOTY4ZWI0MWQ5MDZkN2FjN2UwMjM4ZDc3
10
+ Yjk3MmI2MmJiYmRkNGMwMTc1NmIxOTQxMTAxOTM2MzQ3ODUzZjQzNzQyYzQ0
11
+ MjFmYTE4MmU2N2RlMTM3ODZlZjZiNjUwYzA5MTA3N2FmMzM3MDg=
12
12
  data.tar.gz: !binary |-
13
- YWZlOTRiY2JhMDEzMDcwMTNiYzMzYzI0NjkxMzVlZDJhMjQzYTg3ZDBhMmQy
14
- OGFhNmIwNmU2ZTBiYzkxMjQ4MDUwZTdjZDk3ZWNjYTVlNGJiY2E3NTUxY2Yz
15
- ZmJkNjI5MWVlMmMyODRmNjc1NDJlZDU4ZjRiY2EwNzdiOGIwMGQ=
13
+ ODYwNTc0MzFlMmYyNWU4NWFkOThhZDEwMTNhMmZiMzMyMmNjNGFlYmI3YjM2
14
+ ZGUyYWM2YTQ5MTlmMGJlYjU1MWY5YmU0MjkzZGE0YjBjODliNzE3NmY1YWZk
15
+ NTI4NjYyY2M1M2NiYjZmMGEwMTVmZjkxYTc4MDVjYTM1NTk0ZDQ=
data/README.md CHANGED
@@ -15,6 +15,17 @@ Simple static blog-engine based on [cloudhead/toto](https://github.com/cloudhead
15
15
 
16
16
  Why you don't need generate your blog every http request. *Statikaj* **don't use database**, **don't parse ERB/Markdown** on production. Build your blog and send a static version to your server, *Statikaj* will works with any http server, you don't need ruby, java, php, etc, a small nginx or apache process will be OK.
17
17
 
18
+ ## Command line
19
+
20
+ $ statikaj
21
+ Commands:
22
+ statikaj article # Create new article
23
+ statikaj build --url=URL # Build the static blog version on public folder
24
+ statikaj help [COMMAND] # Describe available commands or one specific command
25
+ statikaj new # Create a new project
26
+
27
+
28
+
18
29
  ## Creating and Writing a article
19
30
 
20
31
  Create a article is very easy, first to create a correct file *Statikaj* provides the ```article``` command.
data/lib/statikaj/cli.rb CHANGED
@@ -17,13 +17,20 @@ module Statikaj
17
17
  end
18
18
 
19
19
  desc "build", "Build the static blog version on public folder"
20
- option :force, :type => :boolean, default: false, aliases: :f, desc: "force rebuild olds articles"
21
20
  option :url, :type => :string, required: true, desc: "base blog url"
21
+ option :force, :type => :boolean, default: false, aliases: :f, desc: "force rebuild olds articles"
22
22
  option :"no-category", :type => :boolean, default: false, desc: "without category support"
23
23
  long_desc <<-LONGDESC
24
- > $ statikaj build --url http://myblog.com
25
- > $ statikaj build --no-category --url http://myblog.com
26
- > $ statikaj build -f --url http://myblog.com
24
+ The build command will do:\n
25
+ 1. Get all articles file, and create a article html version\n
26
+ 2. Create the index.html file\n
27
+ 3. Create the feed.atom file\n
28
+ 4. Create the category file, use --no-category with you don't need category support\n\n
29
+
30
+ Examples:\n
31
+ $ statikaj build --url http://myblog.com\n
32
+ $ statikaj build --no-category --url http://myblog.com\n
33
+ $ statikaj build -f --url http://myblog.com
27
34
  LONGDESC
28
35
  def build
29
36
  source = Pathname.new "./src"
@@ -68,7 +75,7 @@ module Statikaj
68
75
  slug = key.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
69
76
 
70
77
  render = Render.new(source, page: 'category', url: slug, articles: _articles.reverse)
71
- content = render.page {}
78
+ content = render.page{|page| page.category = key }
72
79
  create_file destination.join("category/#{slug}"), content, force: true
73
80
  end
74
81
  end
@@ -1,10 +1,9 @@
1
1
  require 'erb'
2
2
  require 'builder'
3
3
  require 'statikaj/version'
4
-
5
4
  module Statikaj
6
5
  class Render
7
- attr_accessor :title, :articles, :description, :url
6
+ attr_accessor :title, :articles, :description, :url, :category
8
7
 
9
8
  def initialize(source, options)
10
9
  @source = source
@@ -1,3 +1,3 @@
1
1
  module Statikaj
2
- VERSION = "0.0.3.yanked"
2
+ VERSION = "0.0.4"
3
3
  end
data/statikaj.gemspec CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.3"
22
22
  spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "pry"
23
24
  spec.add_dependency "kramdown"
24
25
  spec.add_dependency "thor"
25
26
  spec.add_dependency "builder"
@@ -0,0 +1,17 @@
1
+ <h2>Category: <%= category %></h2>
2
+ <ul id="articles">
3
+ <% articles.select {|a| a[:date] <= Date.today}[0...10].each do |article| %>
4
+ <li><article>
5
+ <h3><a href="<%= article.path %>"><%= article.title %></a></h2>
6
+ <div class="about">
7
+ <p>em <%= article.category %></p>
8
+ <p>as <%= article.date %></p>
9
+ </div>
10
+ <div class="resume">
11
+ <%= article.body.split("~~~").first %>
12
+ </div>
13
+ <a class="read_more" href="<%= article.path %>">Continue Lendo</a>
14
+ </article></li>
15
+ <% end %>
16
+ </ul>
17
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statikaj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.yanked
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duke
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: kramdown
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -110,6 +124,7 @@ files:
110
124
  - templates/src/templates/index.builder
111
125
  - templates/src/templates/layout.rhtml
112
126
  - templates/src/templates/pages/article.rhtml
127
+ - templates/src/templates/pages/category.rhtml
113
128
  - templates/src/templates/pages/index.rhtml
114
129
  homepage: https://github.com/dukex/statikaj
115
130
  licenses:
@@ -126,9 +141,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
141
  version: '0'
127
142
  required_rubygems_version: !ruby/object:Gem::Requirement
128
143
  requirements:
129
- - - ! '>'
144
+ - - ! '>='
130
145
  - !ruby/object:Gem::Version
131
- version: 1.3.1
146
+ version: '0'
132
147
  requirements: []
133
148
  rubyforge_project:
134
149
  rubygems_version: 2.0.7