clay 1.3 → 1.4
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 +74 -0
- data/src/clay.rb +4 -4
- metadata +21 -34
data/README.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
## About
|
2
|
+
|
3
|
+
Clay generates static pages using layouts and text snippets. It is something like a CMS for those who know html and would like to use their own text editor. Clay was inspired by [jekyll](http://jekyllrb.com/) which is a simple tool to create a blog. The difference between clay and jekyll is that clay aims at a clear folder structure and simple templating using [mustache](http://mustache.github.com/).
|
4
|
+
|
5
|
+
There are plans for adding a blogging support in clay too.
|
6
|
+
|
7
|
+
## Getting started
|
8
|
+
|
9
|
+
* Start by installing the [gem](https://rubygems.org/gems/clay)
|
10
|
+
gem install clay
|
11
|
+
* Init your project using clay
|
12
|
+
clay init <project name>
|
13
|
+
* Create layouts/default.html in the project directory with the following content:
|
14
|
+
<html>
|
15
|
+
<title>{{title}}</title>
|
16
|
+
<body>{{{content}}}</body>
|
17
|
+
</html>
|
18
|
+
* Create pages/index.html in the project directory
|
19
|
+
---
|
20
|
+
title: Home
|
21
|
+
---
|
22
|
+
<h1>Hello from clay</h1>
|
23
|
+
* run
|
24
|
+
clay form && clay run
|
25
|
+
* Preview Your site on http://localhost:9292 or publish it via FTP.
|
26
|
+
When publishing, You should take only the files in the build folder
|
27
|
+
|
28
|
+
## Howto
|
29
|
+
|
30
|
+
In your project directory You will find following subdirectories
|
31
|
+
|
32
|
+
* layouts
|
33
|
+
* pages
|
34
|
+
* public
|
35
|
+
|
36
|
+
The _layouts_ directory is for the global layouts of your pages.
|
37
|
+
There must be a layout called default.html
|
38
|
+
|
39
|
+
In the _pages_ directory You create each page You want to have.
|
40
|
+
The pages are created in html or markdown.
|
41
|
+
The filename of an html page must be <pagename>.html
|
42
|
+
Markdown pages however can be either <pagename>.md or <pagename>.markdown
|
43
|
+
|
44
|
+
*NOTE* Your pages may have any names You want. However given your domain
|
45
|
+
name is foo.com, and You want that the main page shows up at http://foo.com
|
46
|
+
You will have to create page named index in the pages directory
|
47
|
+
|
48
|
+
----------------------------------------
|
49
|
+
|
50
|
+
## Licence
|
51
|
+
|
52
|
+
[Clay](https://github.com/kerestey/clay) by [Pavlo Kerestey](http://kerestey.net) is licensed under a [MIT Licence](http://creativecommons.org/licenses/MIT/). Permissions beyond the scope of this license may be available at <a xmlns:cc="http://creativecommons.org/ns#" href="http://kerestey.net" rel="cc:morePermissions">http://kerestey.net</a>.
|
53
|
+
|
54
|
+
## Full text of the licence
|
55
|
+
|
56
|
+
Copyright (C) 2011 by Pavlo Kerestey
|
57
|
+
|
58
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
59
|
+
of this software and associated documentation files (the "Software"), to deal
|
60
|
+
in the Software without restriction, including without limitation the rights
|
61
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
62
|
+
copies of the Software, and to permit persons to whom the Software is
|
63
|
+
furnished to do so, subject to the following conditions:
|
64
|
+
|
65
|
+
The above copyright notice and this permission notice shall be included in
|
66
|
+
all copies or substantial portions of the Software.
|
67
|
+
|
68
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
69
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
70
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
71
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
72
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
73
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
74
|
+
THE SOFTWARE.
|
data/src/clay.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'bundler/setup'
|
3
3
|
require 'mustache'
|
4
|
-
require '
|
4
|
+
require 'bluecloth'
|
5
5
|
require 'fileutils'
|
6
6
|
require 'yaml'
|
7
7
|
|
8
8
|
module Clay
|
9
|
-
VERSION = "1.
|
9
|
+
VERSION = "1.4"
|
10
10
|
|
11
11
|
def self.init project_name
|
12
12
|
puts "Creating the folder structure... "
|
@@ -175,7 +175,7 @@ private
|
|
175
175
|
|
176
176
|
def parsed_content content, data
|
177
177
|
case @page_type
|
178
|
-
when "markdown" then return Mustache.render(
|
178
|
+
when "markdown" then return Mustache.render(BlueCloth.new(content).to_html.strip, data)
|
179
179
|
when "html" then return Mustache.render(content, data)
|
180
180
|
end
|
181
181
|
end
|
@@ -209,6 +209,6 @@ class Text
|
|
209
209
|
private
|
210
210
|
|
211
211
|
def parse content
|
212
|
-
|
212
|
+
BlueCloth.new(content).to_html.strip
|
213
213
|
end
|
214
214
|
end
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: "1.
|
8
|
+
- 4
|
9
|
+
version: "1.4"
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Pavlo Kerestey
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-03 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -23,27 +23,28 @@ dependencies:
|
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
none: false
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
28
|
+
hash: 3
|
29
29
|
segments:
|
30
30
|
- 0
|
31
|
-
|
32
|
-
version: "0.11"
|
31
|
+
version: "0"
|
33
32
|
type: :runtime
|
34
33
|
version_requirements: *id001
|
35
34
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
35
|
+
name: bluecloth
|
37
36
|
prerelease: false
|
38
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
38
|
none: false
|
40
39
|
requirements:
|
41
40
|
- - ">="
|
42
41
|
- !ruby/object:Gem::Version
|
43
|
-
hash:
|
42
|
+
hash: 29
|
44
43
|
segments:
|
44
|
+
- 2
|
45
45
|
- 0
|
46
|
-
|
46
|
+
- 9
|
47
|
+
version: 2.0.9
|
47
48
|
type: :runtime
|
48
49
|
version_requirements: *id002
|
49
50
|
- !ruby/object:Gem::Dependency
|
@@ -60,25 +61,10 @@ dependencies:
|
|
60
61
|
version: "0"
|
61
62
|
type: :runtime
|
62
63
|
version_requirements: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: bundler
|
65
|
-
prerelease: false
|
66
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
67
|
-
none: false
|
68
|
-
requirements:
|
69
|
-
- - ~>
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
hash: 15
|
72
|
-
segments:
|
73
|
-
- 1
|
74
|
-
- 0
|
75
|
-
version: "1.0"
|
76
|
-
type: :development
|
77
|
-
version_requirements: *id004
|
78
64
|
- !ruby/object:Gem::Dependency
|
79
65
|
name: rspec
|
80
66
|
prerelease: false
|
81
|
-
requirement: &
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
82
68
|
none: false
|
83
69
|
requirements:
|
84
70
|
- - ">="
|
@@ -88,11 +74,11 @@ dependencies:
|
|
88
74
|
- 0
|
89
75
|
version: "0"
|
90
76
|
type: :development
|
91
|
-
version_requirements: *
|
77
|
+
version_requirements: *id004
|
92
78
|
- !ruby/object:Gem::Dependency
|
93
79
|
name: rake
|
94
80
|
prerelease: false
|
95
|
-
requirement: &
|
81
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
96
82
|
none: false
|
97
83
|
requirements:
|
98
84
|
- - ">="
|
@@ -102,19 +88,20 @@ dependencies:
|
|
102
88
|
- 0
|
103
89
|
version: "0"
|
104
90
|
type: :development
|
105
|
-
version_requirements: *
|
106
|
-
description: A
|
91
|
+
version_requirements: *id005
|
92
|
+
description: A lightweight CMS to form a static website with layouts, files and text snippets.
|
107
93
|
email:
|
108
94
|
- pavlo@kerestey.net
|
109
95
|
executables:
|
110
96
|
- clay
|
111
97
|
extensions: []
|
112
98
|
|
113
|
-
extra_rdoc_files:
|
114
|
-
|
99
|
+
extra_rdoc_files:
|
100
|
+
- README.md
|
115
101
|
files:
|
116
102
|
- src/clay.rb
|
117
103
|
- src/rack/clay.rb
|
104
|
+
- README.md
|
118
105
|
- bin/clay
|
119
106
|
has_rdoc: true
|
120
107
|
homepage: http://kerestey.net/clay
|
@@ -151,6 +138,6 @@ rubyforge_project: clay
|
|
151
138
|
rubygems_version: 1.3.7
|
152
139
|
signing_key:
|
153
140
|
specification_version: 3
|
154
|
-
summary: A
|
141
|
+
summary: A very lightweight CMS to automatically form a static website.
|
155
142
|
test_files: []
|
156
143
|
|