static 0.0.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/History.txt +5 -0
- data/Manifest.txt +32 -0
- data/README.txt +254 -0
- data/Rakefile +15 -0
- data/bin/cli.rbml +245 -0
- data/bin/static +82 -0
- data/lib/collection.rb +112 -0
- data/lib/extentions/class.rb +43 -0
- data/lib/extentions/string.rb +10 -0
- data/lib/filebase.rb +84 -0
- data/lib/generator.rb +20 -0
- data/lib/page.rb +124 -0
- data/lib/site.rb +144 -0
- data/lib/static.rb +96 -0
- data/lib/xhtml.rb +98 -0
- data/templates/disco/attributes +3 -0
- data/templates/disco/display +4 -0
- data/templates/disco/link_list +6 -0
- data/templates/disco/publish +1 -0
- data/templates/layouts/default/contents.erbml +8 -0
- data/templates/layouts/default/main_navigation.erbml +10 -0
- data/templates/layouts/default/page_head.erbml +7 -0
- data/templates/layouts/default/structure/default.rbml +21 -0
- data/templates/layouts/default/structure/footer.rbml +6 -0
- data/templates/layouts/default/stylesheets/default.css +106 -0
- data/templates/layouts/default/submenu.erbml +13 -0
- data/templates/page.copy +3 -0
- data/templates/site.info +5 -0
- data/templates/site.map +15 -0
- data/templates/submenu.copy +0 -0
- metadata +87 -0
data/lib/xhtml.rb
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
|
2
|
+
module Inclusion
|
3
|
+
def find_file_name page, what
|
4
|
+
tmp = nil
|
5
|
+
case what
|
6
|
+
when Hash
|
7
|
+
what.each { |desc, item| tmp = "#{page.file_name}_#{desc}_#{item}" }
|
8
|
+
else
|
9
|
+
tmp = what==:contents ? page.file_name : what.to_s
|
10
|
+
end
|
11
|
+
tmp+'.rbml'
|
12
|
+
end
|
13
|
+
def get from, what
|
14
|
+
case from
|
15
|
+
when :base
|
16
|
+
run_file Generator.act_on.home+"layout/structure/#{what}.rbml"
|
17
|
+
when :page
|
18
|
+
run_file Generator.act_on.home+"blueprint/#{Generator.page_location}#{find_file_name(Generator.act_on, what)}"
|
19
|
+
else
|
20
|
+
$active_site.pages.each { |page| run_file page.home+'blueprint/'+page.page_location+find_file_name(page, what) if page.name.as_file == from.to_s }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def display how_many, collection, entry_bank=nil
|
25
|
+
col = load_collection(collection.to_s)
|
26
|
+
how_many = col.entries.size if how_many == :all
|
27
|
+
entry_bank ||= col.entries.dup
|
28
|
+
Generator.load col
|
29
|
+
how_many.times {
|
30
|
+
break if entry_bank.empty?
|
31
|
+
Generator.contents = entry_bank.shift
|
32
|
+
run_file Generator.act_on.blueprint
|
33
|
+
}
|
34
|
+
Generator.unload
|
35
|
+
end
|
36
|
+
|
37
|
+
def include_partial
|
38
|
+
i Generator.include_text
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
module Rbml
|
43
|
+
module Language
|
44
|
+
module Doc
|
45
|
+
module Xhtml
|
46
|
+
def put_title
|
47
|
+
title(Generator.contents['title'])
|
48
|
+
end
|
49
|
+
def put_stylesheets
|
50
|
+
styles = []
|
51
|
+
Generator.stylesheets.each{|style| styles << style}
|
52
|
+
stylesheets Generator.level+'stylesheets/', styles
|
53
|
+
end
|
54
|
+
def breadcrumbs
|
55
|
+
links = []
|
56
|
+
Generator.breadcrumbs.each {|b| links << (Generator.act_on.name.as_file==b.to_s ? Generator.act_on.name : link_to(b)) }
|
57
|
+
i links.join(" >> ")
|
58
|
+
links.join(" >> ")
|
59
|
+
end
|
60
|
+
def main_link_for what
|
61
|
+
link_to what
|
62
|
+
end
|
63
|
+
def link_to what, text=nil, options={}
|
64
|
+
where = options[:page] ? options[:page]+'.html' : ''
|
65
|
+
say=''
|
66
|
+
$active_site.pages.each { |page|
|
67
|
+
if page.name.as_file == what.to_s
|
68
|
+
text ||= page.name
|
69
|
+
say << "<a href='#{Generator.level}#{page.in_site_link}#{where}'>#{text}</a>"
|
70
|
+
end
|
71
|
+
}
|
72
|
+
i say
|
73
|
+
say
|
74
|
+
end
|
75
|
+
def put what
|
76
|
+
stuff = Generator.contents[what.to_s] || ''
|
77
|
+
t parse_context(stuff)
|
78
|
+
end
|
79
|
+
def plain_put what
|
80
|
+
stuff = Generator.contents[what.to_s] || ''
|
81
|
+
i parse_context(stuff)
|
82
|
+
end
|
83
|
+
|
84
|
+
def parse_context(what)
|
85
|
+
what = what.to_s
|
86
|
+
exp = /\<\[.+?\]\>/
|
87
|
+
while(what =~ exp) do
|
88
|
+
what.sub!(exp) { |match|
|
89
|
+
eval(match.sub(/^\<\[/,'').sub(/\]\>$/, ''))
|
90
|
+
}
|
91
|
+
end
|
92
|
+
what
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
display 1, :<%=name%>, Generator.entry_bank
|
@@ -0,0 +1,21 @@
|
|
1
|
+
xhtml :doctype => {:type=>:xhtml, :version=>"1.0", :strict=>false} do
|
2
|
+
head do
|
3
|
+
put_title
|
4
|
+
put_stylesheets
|
5
|
+
charset 'utf-8'
|
6
|
+
end
|
7
|
+
|
8
|
+
body(:id => 'visible_page') do
|
9
|
+
div(:id => 'container') do
|
10
|
+
div(:id => 'header'){
|
11
|
+
get :base, :page_head
|
12
|
+
}
|
13
|
+
div(:id => 'content'){
|
14
|
+
get :page, :contents
|
15
|
+
}
|
16
|
+
div(:id => 'footer'){
|
17
|
+
get :base, :footer
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,106 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #000;
|
3
|
+
}
|
4
|
+
|
5
|
+
#container {
|
6
|
+
width: 800px;
|
7
|
+
margin-bottom: 10px;
|
8
|
+
margin-left: auto;
|
9
|
+
margin-right: auto;
|
10
|
+
background-color: #fff;
|
11
|
+
}
|
12
|
+
|
13
|
+
#header {
|
14
|
+
background-color:#333;
|
15
|
+
color: #eee;
|
16
|
+
}
|
17
|
+
#header h1 {
|
18
|
+
font: 38px 'verdana', sans-serif;
|
19
|
+
margin:0px;
|
20
|
+
margin-left:20px;
|
21
|
+
padding:0px;
|
22
|
+
padding-top:10px;
|
23
|
+
}
|
24
|
+
|
25
|
+
#header ul {
|
26
|
+
margin:auto;
|
27
|
+
margin:0px;
|
28
|
+
padding:0px;
|
29
|
+
text-align:right;
|
30
|
+
margin-right:20px;
|
31
|
+
}
|
32
|
+
|
33
|
+
#header ul li {
|
34
|
+
margin-top:35px;
|
35
|
+
margin-right:20px;
|
36
|
+
}
|
37
|
+
|
38
|
+
#main_navigation li{
|
39
|
+
display:inline;
|
40
|
+
}
|
41
|
+
|
42
|
+
a {
|
43
|
+
color:#e60066;
|
44
|
+
}
|
45
|
+
|
46
|
+
a:hover {
|
47
|
+
background-color:#333;
|
48
|
+
color:#fff;
|
49
|
+
}
|
50
|
+
.main_link a {
|
51
|
+
color:#333;
|
52
|
+
background-color:#fff;
|
53
|
+
padding:5px;
|
54
|
+
margin-bottom:5px;
|
55
|
+
}
|
56
|
+
|
57
|
+
.main_link a:hover {
|
58
|
+
color:#e60066;
|
59
|
+
background-color:#333;
|
60
|
+
border: solid 1px #fff;
|
61
|
+
}
|
62
|
+
|
63
|
+
#content {
|
64
|
+
padding:10px;
|
65
|
+
border-top: solid 3px #000;
|
66
|
+
border-bottom: solid 3px #000;
|
67
|
+
background-color: #ffffff;}
|
68
|
+
|
69
|
+
#content h3 {
|
70
|
+
font: 22px 'verdana', sans-serif;
|
71
|
+
margin: 0px;
|
72
|
+
padding: 0px;
|
73
|
+
border-bottom: solid 1px #333;
|
74
|
+
width:570px;
|
75
|
+
}
|
76
|
+
|
77
|
+
#content p {
|
78
|
+
text-align:justify;
|
79
|
+
}
|
80
|
+
|
81
|
+
#submenu {
|
82
|
+
float: right;
|
83
|
+
width: 200px;
|
84
|
+
margin: 0px;
|
85
|
+
padding: 0px;
|
86
|
+
border: solid 1px #333;
|
87
|
+
margin-left:10px;
|
88
|
+
}
|
89
|
+
|
90
|
+
li {
|
91
|
+
list-style:none
|
92
|
+
}
|
93
|
+
|
94
|
+
#footer ul{
|
95
|
+
text-align:center;
|
96
|
+
}
|
97
|
+
|
98
|
+
#footer {
|
99
|
+
margin:auto;
|
100
|
+
color:#fff;
|
101
|
+
font: 10px 'verdana', sans-serif;
|
102
|
+
padding-bottom:5px;
|
103
|
+
background-color: #333;
|
104
|
+
margin-top:0px;
|
105
|
+
padding-top:5px;
|
106
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
<% say='' %>
|
4
|
+
ul(:id => "<%=name%>"){
|
5
|
+
li(:class => "sidebar_title"){
|
6
|
+
i "<%=name%>"
|
7
|
+
}
|
8
|
+
<% subs.each do |link_value| %>
|
9
|
+
li(:class => "sidebar_link"){<%(link_value.kind_of?(Hash) ? link_value.each {|k,v| say=k} : (say=link_value))%>
|
10
|
+
link_to :<%=say.as_file%>
|
11
|
+
} <% end %>
|
12
|
+
}
|
13
|
+
|
data/templates/page.copy
ADDED
data/templates/site.info
ADDED
data/templates/site.map
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.0
|
3
|
+
specification_version: 1
|
4
|
+
name: static
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.0.1
|
7
|
+
date: 2007-06-15 00:00:00 -04:00
|
8
|
+
summary: The author was too lazy to write a summary
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email: ryand-ruby@zenspider.com
|
12
|
+
homepage: http://www.zenspider.com/ZSS/Products/static/
|
13
|
+
rubyforge_project: static
|
14
|
+
description: The author was too lazy to write a description
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Ryan Davis
|
31
|
+
files:
|
32
|
+
- History.txt
|
33
|
+
- Manifest.txt
|
34
|
+
- README.txt
|
35
|
+
- Rakefile
|
36
|
+
- bin/static
|
37
|
+
- bin/cli.rbml
|
38
|
+
- lib/static.rb
|
39
|
+
- lib/collection.rb
|
40
|
+
- lib/filebase.rb
|
41
|
+
- lib/page.rb
|
42
|
+
- lib/site.rb
|
43
|
+
- lib/xhtml.rb
|
44
|
+
- lib/generator.rb
|
45
|
+
- lib/extentions/class.rb
|
46
|
+
- lib/extentions/string.rb
|
47
|
+
- templates/page.copy
|
48
|
+
- templates/site.map
|
49
|
+
- templates/site.info
|
50
|
+
- templates/submenu.copy
|
51
|
+
- templates/disco/attributes
|
52
|
+
- templates/disco/display
|
53
|
+
- templates/disco/publish
|
54
|
+
- templates/disco/link_list
|
55
|
+
- templates/layouts/default/contents.erbml
|
56
|
+
- templates/layouts/default/main_navigation.erbml
|
57
|
+
- templates/layouts/default/page_head.erbml
|
58
|
+
- templates/layouts/default/submenu.erbml
|
59
|
+
- templates/layouts/default/structure/default.rbml
|
60
|
+
- templates/layouts/default/structure/footer.rbml
|
61
|
+
- templates/layouts/default/stylesheets/default.css
|
62
|
+
test_files: []
|
63
|
+
|
64
|
+
rdoc_options:
|
65
|
+
- --main
|
66
|
+
- README.txt
|
67
|
+
extra_rdoc_files:
|
68
|
+
- History.txt
|
69
|
+
- Manifest.txt
|
70
|
+
- README.txt
|
71
|
+
executables:
|
72
|
+
- static
|
73
|
+
- cli.rbml
|
74
|
+
extensions: []
|
75
|
+
|
76
|
+
requirements: []
|
77
|
+
|
78
|
+
dependencies:
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: hoe
|
81
|
+
version_requirement:
|
82
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 1.2.1
|
87
|
+
version:
|