runeblog 0.2.40 → 0.2.45
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +4 -7
- data/empty_view/themes/standard/blog/post_entry.lt3 +11 -10
- data/empty_view/themes/standard/etc/blog.css.lt3 +6 -1
- data/empty_view/themes/standard/navbar/faq.lt3 +1 -0
- data/empty_view/themes/standard/navbar/navbar.lt3 +1 -0
- data/empty_view/themes/standard/post/generate.lt3 +9 -4
- data/empty_view/themes/standard/widgets/ad/ad.lt3 +8 -1
- data/empty_view/themes/standard/widgets/ad/ad1.png +0 -0
- data/empty_view/themes/standard/widgets/ad/ad2.png +0 -0
- data/empty_view/themes/standard/widgets/ad/ad3.png +0 -0
- data/empty_view/themes/standard/widgets/ad/ad4.png +0 -0
- data/empty_view/themes/standard/widgets/bydates/bydates.rb +7 -3
- data/empty_view/themes/standard/widgets/links/links.rb +28 -3
- data/empty_view/themes/standard/widgets/news/news.rb +7 -3
- data/empty_view/themes/standard/widgets/pages/pages.rb +10 -3
- data/empty_view/themes/standard/widgets/pinned/pinned.rb +7 -3
- data/empty_view/themes/standard/widgets/search/search.rb +7 -3
- data/empty_view/themes/standard/widgets/sitemap/sitemap.rb +7 -3
- data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb +7 -3
- data/lib/default.rb +1 -4
- data/lib/global.rb +8 -7
- data/lib/helpers-blog.rb +15 -15
- data/lib/liveblog.rb +47 -18
- data/lib/logging.rb +17 -8
- data/lib/post.rb +6 -6
- data/lib/publish.rb +4 -4
- data/lib/repl.rb +1 -0
- data/lib/runeblog.rb +77 -47
- data/lib/runeblog_version.rb +1 -1
- data/lib/view.rb +2 -8
- data/lib/xlate.rb +2 -2
- data/test/austin.rb +157 -0
- metadata +8 -5
- data/empty_view/remote/widgets/links/list.data +0 -3
- data/empty_view/remote/widgets/news/list.data +0 -4
- data/empty_view/remote/widgets/pages/list.data +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8bb9a39d611dfe53e5ef484072a68b6c28791563469f591c0ed0b1f2af8d19b
|
4
|
+
data.tar.gz: 3280e0cec145361c3422de113d54f1c54fa617993c96010a06604f8a81f9b2d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfa3e81153739ccbb5cbea452a33ba523141025df409cd2a33e55d03dd51b4c800a5e49e5fa102063dd71793187df5bed62e847e00bfa75b35dcbc35ed5c3ddf
|
7
|
+
data.tar.gz: 3b93280f1ac1a370d7ab7ff4f4c1fd28a4cba94af74ebdfb0fc59f21ea1081079786a39f8de9f75216205a256193e774bc379841e675e49600ca7748ed0e655b
|
data/bin/blog
CHANGED
@@ -16,10 +16,9 @@ def get_started
|
|
16
16
|
puts
|
17
17
|
puts fx(<<-TEXT, :bold)
|
18
18
|
Blog repo successfully created.
|
19
|
-
|
20
|
-
Create
|
21
|
-
|
22
|
-
via the config command.
|
19
|
+
For help, type h or help.
|
20
|
+
Create views with: new view
|
21
|
+
Create a post (within current view): new post
|
23
22
|
TEXT
|
24
23
|
end
|
25
24
|
|
@@ -55,9 +54,7 @@ if ! RuneBlog.exist?
|
|
55
54
|
print fx("\n No blog repo found. Create new one? (y/n): ", :bold)
|
56
55
|
response = gets.chomp
|
57
56
|
if response.downcase == "y"
|
58
|
-
|
59
|
-
view_name = gets.chomp
|
60
|
-
RuneBlog.create_new_blog_repo(view_name)
|
57
|
+
RuneBlog.create_new_blog_repo
|
61
58
|
get_started
|
62
59
|
else
|
63
60
|
exit
|
@@ -4,18 +4,19 @@
|
|
4
4
|
. --------------------------------------------------
|
5
5
|
|
6
6
|
<div class="post">
|
7
|
-
<table width=100
|
7
|
+
<table width=100% cellpadding=7>
|
8
8
|
<tr>
|
9
|
-
<td width=
|
10
|
-
<span class="post-date mt-1 mb-1">
|
11
|
-
<b>#{date}</b>
|
12
|
-
</span>
|
9
|
+
<td width=14% valign=top align=right style="margin-top: -1px;">
|
10
|
+
<!-- <span class="post-date mt-1 mb-1" style="margin-top: 3px; text-align: right"> -->
|
11
|
+
<font size=-1><b>#{date}</b></font>
|
12
|
+
<!-- </span> -->
|
13
13
|
</td>
|
14
|
-
<td>
|
15
|
-
|
16
|
-
<
|
17
|
-
<
|
18
|
-
<a style="text-decoration: none" href="#{url}"><small>Keep reading...</small></a
|
14
|
+
<td>
|
15
|
+
<!-- <span class="post-title-box"> -->
|
16
|
+
<span class="post-title-text"><a href="#{url}" style="margin-top: -5px">#{title}</a></span>
|
17
|
+
<b>#{teaser_text}</b>
|
18
|
+
<a style="text-decoration: none" href="#{url}"><small>Keep reading...</small></a>
|
19
|
+
<!-- </span> -->
|
19
20
|
</td>
|
20
21
|
</tr>
|
21
22
|
</table>
|
@@ -24,7 +24,6 @@
|
|
24
24
|
\.post-title-text a {
|
25
25
|
color: $post.text.color;
|
26
26
|
font-size: $post.text.size;
|
27
|
-
# float: right;
|
28
27
|
display: block;
|
29
28
|
text-decoration: none;
|
30
29
|
}
|
@@ -41,3 +40,9 @@
|
|
41
40
|
text-align: top;
|
42
41
|
}
|
43
42
|
|
43
|
+
. not used?
|
44
|
+
\.thumbnail img {
|
45
|
+
max-height: 100%;
|
46
|
+
max-width: 100%;
|
47
|
+
}
|
48
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
.include ../widgets/pages/faq.lt3
|
@@ -5,10 +5,8 @@
|
|
5
5
|
. --------------------------------------------------
|
6
6
|
|
7
7
|
.mixin liveblog
|
8
|
-
|
9
8
|
<html>
|
10
|
-
<!--
|
11
|
-
<!-- It was generated from $File on $$date. -->
|
9
|
+
<!-- Generated from $File on $$date; editing not recommended. -->
|
12
10
|
|
13
11
|
.seek global.lt3
|
14
12
|
.include vars.lt3
|
@@ -18,13 +16,20 @@ og:title $title
|
|
18
16
|
description $teaser
|
19
17
|
.end
|
20
18
|
|
19
|
+
<body>
|
20
|
+
|
21
21
|
<section class="post">
|
22
22
|
<div class="entry-content">
|
23
|
+
<table border=0 width=100%><tr>
|
24
|
+
<td align=left valign=bottom><h2 class="post-title">$title</h2></td>
|
25
|
+
<td align=right valign=top><font size=-5><br></font>$longdate</td>
|
26
|
+
</tr></table><hr>
|
23
27
|
$.copy guts.html
|
24
28
|
</div>
|
25
29
|
</section>
|
26
30
|
|
27
31
|
<br>
|
28
|
-
<
|
32
|
+
<hr>
|
33
|
+
.post_trailer
|
29
34
|
</body>
|
30
35
|
</html>
|
@@ -1,15 +1,22 @@
|
|
1
1
|
. In real life, ads won't work this way...
|
2
2
|
|
3
|
+
.include vars.lt3
|
4
|
+
|
3
5
|
.set classname="btn btn-light float-right"
|
4
6
|
.set card.title="Advertisement"
|
5
7
|
.set card.text="Build your amazing website with blabla.com."
|
6
|
-
.set extra="bg-dark text-white"
|
8
|
+
. set extra="bg-dark text-white"
|
9
|
+
|
10
|
+
<!-- "$ad.image" -->
|
7
11
|
|
8
12
|
<div class="card $extra mb-3">
|
9
13
|
<div class="card-body">
|
14
|
+
<!--
|
10
15
|
<h5 class="card-title">$card.title</h5>
|
11
16
|
<p class="card-text">$card.text</p>
|
12
17
|
<a href="javascript: void(0)" onclick="javascript:open_main('widgets/ad/ad.html')" class="$classname">Visit page</a>
|
18
|
+
-->
|
19
|
+
<img style="max-height: 100%; max-width: 100%" src="$ad.image"></img>
|
13
20
|
</div>
|
14
21
|
</div>
|
15
22
|
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,14 +1,39 @@
|
|
1
1
|
# Custom code for 'links' widget
|
2
2
|
|
3
|
+
require 'liveblog'
|
4
|
+
|
3
5
|
class ::RuneBlog::Widget
|
4
6
|
class Links
|
5
|
-
|
7
|
+
Type = "links"
|
8
|
+
|
9
|
+
def initialize(repo)
|
10
|
+
@blog = repo
|
11
|
+
end
|
12
|
+
|
13
|
+
def build
|
14
|
+
input = "list.data"
|
15
|
+
lines = File.readlines(input)
|
16
|
+
data = lines.map! {|x| x.chomp.split(/, */, 3) }
|
17
|
+
css = "* { font-family: verdana }"
|
18
|
+
card_title = "External Links" # FIXME
|
19
|
+
File.open("#{Type}-main.html", "w") do |f|
|
20
|
+
_html_body(f, css) do
|
21
|
+
f.puts "<h1>#{card_title}</h1><br><hr>"
|
22
|
+
url_ref = nil
|
23
|
+
data.each do |url, frameable, title|
|
24
|
+
url_ref = (frameable == "yes") ? "href = '#{url}'" : _blank(url)
|
25
|
+
css = "color: #8888FF; text-decoration: none; font-size: 21px" # ; font-family: verdana"
|
26
|
+
f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
# remember -card also
|
6
31
|
end
|
7
32
|
|
8
|
-
def
|
33
|
+
def edit_menu
|
9
34
|
end
|
10
35
|
|
11
|
-
def
|
36
|
+
def refresh
|
12
37
|
end
|
13
38
|
end
|
14
39
|
end
|
@@ -4,18 +4,25 @@
|
|
4
4
|
|
5
5
|
class ::RuneBlog::Widget
|
6
6
|
class Pages
|
7
|
-
def
|
7
|
+
def initialize(repo)
|
8
|
+
@blog = repo
|
9
|
+
end
|
10
|
+
|
11
|
+
def build
|
12
|
+
# build child pages
|
8
13
|
children = Dir["*.lt3"] - ["pages.lt3"]
|
9
14
|
children.each do |child|
|
10
15
|
dest = child.sub(/.lt3$/, ".html")
|
11
16
|
xlate src: child, dst: dest # , debug: true
|
12
17
|
end
|
18
|
+
# build mainfile
|
19
|
+
# build cardfile
|
13
20
|
end
|
14
21
|
|
15
|
-
def
|
22
|
+
def edit_menu
|
16
23
|
end
|
17
24
|
|
18
|
-
def
|
25
|
+
def refresh
|
19
26
|
end
|
20
27
|
end
|
21
28
|
end
|
data/lib/default.rb
CHANGED
@@ -5,7 +5,7 @@ class RuneBlog::Default
|
|
5
5
|
def RuneBlog.post_template(num: 0, title: "No title", date: nil, view: "test_view",
|
6
6
|
teaser: "No teaser", body: "No body", tags: ["untagged"],
|
7
7
|
views: [], back: "javascript:history.go(-1)", home: "no url")
|
8
|
-
log!(enter: __method__, args: [num, title, date, view, teaser, body, tags, views, back, home])
|
8
|
+
log!(enter: __method__, args: [num, title, date, view, teaser, body, tags, views, back, home], level: 3)
|
9
9
|
viewlist = (views + [view.to_s]).join(" ")
|
10
10
|
taglist = ".tags " + tags.join(" ")
|
11
11
|
<<-TEXT
|
@@ -28,6 +28,3 @@ TEXT
|
|
28
28
|
end
|
29
29
|
|
30
30
|
end
|
31
|
-
|
32
|
-
|
33
|
-
|
data/lib/global.rb
CHANGED
@@ -20,7 +20,7 @@ end
|
|
20
20
|
# Refactor, move stuff elsewhere?
|
21
21
|
|
22
22
|
def make_exception(sym, str)
|
23
|
-
log!(enter: __method__, args: [sym, str])
|
23
|
+
log!(enter: __method__, args: [sym, str], level: 3)
|
24
24
|
return if Object.constants.include?(sym)
|
25
25
|
Object.const_set(sym, StandardError.dup)
|
26
26
|
define_method(sym) do |*args|
|
@@ -30,8 +30,9 @@ def make_exception(sym, str)
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
def system!(str)
|
34
|
-
log!(enter: __method__, args: [str])
|
33
|
+
def system!(str, show: false)
|
34
|
+
log!(enter: __method__, args: [str], level: 2)
|
35
|
+
STDERR.puts str if show
|
35
36
|
rc = system(str)
|
36
37
|
if rc
|
37
38
|
return rc
|
@@ -44,12 +45,12 @@ end
|
|
44
45
|
end
|
45
46
|
|
46
47
|
def prefix(num)
|
47
|
-
log!(enter: __method__, args: [num])
|
48
|
+
log!(enter: __method__, args: [num], level: 3)
|
48
49
|
"#{'%04d' % num.to_i}"
|
49
50
|
end
|
50
51
|
|
51
52
|
def check_meta(meta, where = "")
|
52
|
-
log!(enter: __method__, args: [meta, where])
|
53
|
+
log!(enter: __method__, args: [meta, where], level: 3)
|
53
54
|
str = "--- #{where}\n"
|
54
55
|
str << "\ncheck_meta: \n" + caller.join("\n") + "\n meta = #{meta.inspect}\n"
|
55
56
|
str << " title missing!\n" unless meta.title
|
@@ -62,14 +63,14 @@ def check_meta(meta, where = "")
|
|
62
63
|
end
|
63
64
|
|
64
65
|
def verify(hash)
|
65
|
-
log!(enter: __method__, args: [hash])
|
66
|
+
log!(enter: __method__, args: [hash], level: 3)
|
66
67
|
hash.each_pair do |expr, msg|
|
67
68
|
puts "<< #{msg}" unless expr
|
68
69
|
end
|
69
70
|
end
|
70
71
|
|
71
72
|
def assure(hash) # really the same as verify for now...
|
72
|
-
log!(enter: __method__, args: [hash])
|
73
|
+
log!(enter: __method__, args: [hash], level: 3)
|
73
74
|
hash.each_pair do |expr, msg|
|
74
75
|
puts "<< #{msg}" unless expr
|
75
76
|
end
|
data/lib/helpers-blog.rb
CHANGED
@@ -6,14 +6,14 @@ require 'xlate'
|
|
6
6
|
module RuneBlog::Helpers
|
7
7
|
|
8
8
|
def copy(src, dst)
|
9
|
-
log!(enter: __method__, args: [src, dst])
|
9
|
+
log!(enter: __method__, args: [src, dst], level: 2)
|
10
10
|
cmd = "cp #{src} #{dst} 2>/dev/null"
|
11
11
|
rc = system!(cmd)
|
12
12
|
puts " Failed: #{cmd} - from #{caller[0]}" unless rc
|
13
13
|
end
|
14
14
|
|
15
15
|
def copy!(src, dst)
|
16
|
-
log!(enter: __method__, args: [src, dst])
|
16
|
+
log!(enter: __method__, args: [src, dst], level: 2)
|
17
17
|
cmd = "cp -r #{src} #{dst} 2>/dev/null"
|
18
18
|
rc = system!(cmd)
|
19
19
|
puts " Failed: #{cmd} - from #{caller[0]}" unless rc
|
@@ -36,7 +36,7 @@ module RuneBlog::Helpers
|
|
36
36
|
# end
|
37
37
|
|
38
38
|
def read_config(file, *syms)
|
39
|
-
log!(enter: __method__, args: [file, *syms])
|
39
|
+
log!(enter: __method__, args: [file, *syms], level: 3)
|
40
40
|
lines = File.readlines(file).map(&:chomp)
|
41
41
|
obj = ::OpenStruct.new
|
42
42
|
lines.each do |line|
|
@@ -61,7 +61,7 @@ module RuneBlog::Helpers
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def try_read_config(file, hash)
|
64
|
-
log!(enter: __method__, args: [file, hash])
|
64
|
+
log!(enter: __method__, args: [file, hash], level: 3)
|
65
65
|
return hash.values unless File.exist?(file)
|
66
66
|
vals = read_config(file, *hash.keys)
|
67
67
|
vals
|
@@ -80,7 +80,7 @@ module RuneBlog::Helpers
|
|
80
80
|
# end
|
81
81
|
|
82
82
|
def write_config(obj, file)
|
83
|
-
log!(enter: __method__, args: [obj, file])
|
83
|
+
log!(enter: __method__, args: [obj, file], level: 2)
|
84
84
|
hash = obj.to_h
|
85
85
|
File.open(file, "w") do |out|
|
86
86
|
hash.each_pair {|key, val| out.puts "#{key}: #{val}" }
|
@@ -88,13 +88,13 @@ module RuneBlog::Helpers
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def get_views # read from filesystem
|
91
|
-
log!(enter: __method__)
|
91
|
+
log!(enter: __method__, level: 3)
|
92
92
|
dirs = subdirs("#@root/views/").sort
|
93
93
|
dirs.map {|name| RuneBlog::View.new(name) }
|
94
94
|
end
|
95
95
|
|
96
96
|
def new_dotfile(root: ".blogs", current_view: "test_view", editor: "vi")
|
97
|
-
log!(enter: __method__, args: [root, current_view, editor])
|
97
|
+
log!(enter: __method__, args: [root, current_view, editor], level: 3)
|
98
98
|
root = Dir.pwd/root
|
99
99
|
x = OpenStruct.new
|
100
100
|
x.root, x.current_view, x.editor = root, current_view, editor
|
@@ -102,21 +102,21 @@ module RuneBlog::Helpers
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def new_sequence
|
105
|
-
log!(enter: __method__)
|
105
|
+
log!(enter: __method__, level: 3)
|
106
106
|
dump(0, "sequence")
|
107
107
|
version_info = "#{RuneBlog::VERSION}\nBlog created: #{Time.now.to_s}"
|
108
108
|
dump(version_info, "VERSION")
|
109
109
|
end
|
110
110
|
|
111
111
|
def subdirs(dir)
|
112
|
-
log!(enter: __method__, args: [dir])
|
112
|
+
log!(enter: __method__, args: [dir], level: 3)
|
113
113
|
dirs = Dir.entries(dir) - %w[. ..]
|
114
114
|
dirs.reject! {|x| ! File.directory?("#@root/views/#{x}") }
|
115
115
|
dirs
|
116
116
|
end
|
117
117
|
|
118
118
|
def find_draft_slugs
|
119
|
-
log!(enter: __method__)
|
119
|
+
log!(enter: __method__, level: 3)
|
120
120
|
files = Dir["#@root/drafts/**"].grep /\d{4}.*.lt3$/
|
121
121
|
flagfile = "#@root/drafts/last_rebuild"
|
122
122
|
last = File.exist?(flagfile) ? File.mtime(flagfile) : (Time.now - 86_400)
|
@@ -128,7 +128,7 @@ module RuneBlog::Helpers
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def create_dirs(*dirs)
|
131
|
-
log!(enter: __method__, args: [*dirs])
|
131
|
+
log!(enter: __method__, args: [*dirs], level: 3)
|
132
132
|
dirs.each do |dir|
|
133
133
|
dir = dir.to_s # symbols allowed
|
134
134
|
next if Dir.exist?(dir)
|
@@ -139,27 +139,27 @@ module RuneBlog::Helpers
|
|
139
139
|
end
|
140
140
|
|
141
141
|
def interpolate(str, bind)
|
142
|
-
log!(enter: __method__, args: [str, bind])
|
142
|
+
log!(enter: __method__, args: [str, bind], level: 3)
|
143
143
|
wrap = "<<-EOS\n#{str}\nEOS"
|
144
144
|
eval wrap, bind
|
145
145
|
end
|
146
146
|
|
147
147
|
def error(err) # Hmm, this is duplicated
|
148
|
-
log!(str: "duplicated method", enter: __method__, args: [err])
|
148
|
+
log!(str: "duplicated method", enter: __method__, args: [err], level: 2)
|
149
149
|
str = "\n Error: #{err}"
|
150
150
|
puts str
|
151
151
|
puts err.backtrace.join("\n")
|
152
152
|
end
|
153
153
|
|
154
154
|
def dump(obj, name)
|
155
|
-
log!(enter: __method__, args: [obj, name])
|
155
|
+
log!(enter: __method__, args: [obj, name], level: 3)
|
156
156
|
File.write(name, obj)
|
157
157
|
end
|
158
158
|
|
159
159
|
end
|
160
160
|
|
161
161
|
def dump(obj, name) # FIXME scope
|
162
|
-
log!(str: "scope problem", enter: __method__, args: [obj, name])
|
162
|
+
log!(str: "scope problem", enter: __method__, args: [obj, name], level: 3)
|
163
163
|
File.write(name, obj)
|
164
164
|
end
|
165
165
|
|