runeblog 0.2.35 → 0.2.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/mkwidget +209 -0
- data/empty_view/remote/assets/GIT_IS_DUMB +1 -0
- data/empty_view/remote/etc/GIT_IS_DUMB +1 -0
- data/empty_view/remote/navbar/GIT_IS_DUMB +1 -0
- data/empty_view/remote/permalink/GIT_IS_DUMB +1 -0
- data/empty_view/themes/standard/blog/generate.lt3 +12 -12
- data/empty_view/themes/standard/blog/index.lt3 +0 -1
- data/empty_view/themes/standard/widgets/bydates/README +2 -0
- data/empty_view/themes/standard/widgets/bydates/bydates.lt3 +2 -0
- data/empty_view/themes/standard/widgets/bydates/bydates.rb +14 -0
- data/empty_view/themes/standard/widgets/bydates/card.css +1 -0
- data/empty_view/themes/standard/widgets/bydates/custom.rb +1 -0
- data/empty_view/themes/standard/widgets/bydates/local-vars.lt3 +12 -0
- data/empty_view/themes/standard/widgets/bydates/main.css +2 -0
- data/empty_view/themes/standard/widgets/bydates/pieces/card-head.lt3 +8 -0
- data/empty_view/themes/standard/widgets/bydates/pieces/card-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/bydates/pieces/main-head.lt3 +10 -0
- data/empty_view/themes/standard/widgets/bydates/pieces/main-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/links/README +2 -0
- data/empty_view/themes/standard/widgets/links/card.css +1 -0
- data/empty_view/themes/standard/widgets/links/custom.rb +1 -0
- data/empty_view/themes/standard/widgets/links/links.lt3 +1 -1
- data/empty_view/themes/standard/widgets/links/links.rb +14 -0
- data/empty_view/themes/standard/widgets/links/local-vars.lt3 +12 -0
- data/empty_view/themes/standard/widgets/links/main.css +2 -0
- data/empty_view/themes/standard/widgets/links/pieces/card-head.lt3 +8 -0
- data/empty_view/themes/standard/widgets/links/pieces/card-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/links/pieces/main-head.lt3 +10 -0
- data/empty_view/themes/standard/widgets/links/pieces/main-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/news/README +2 -0
- data/empty_view/themes/standard/widgets/news/card.css +1 -0
- data/empty_view/themes/standard/widgets/news/custom.rb +1 -0
- data/empty_view/themes/standard/widgets/news/local-vars.lt3 +12 -0
- data/empty_view/themes/standard/widgets/news/main.css +2 -0
- data/empty_view/themes/standard/widgets/news/news.rb +14 -0
- data/empty_view/themes/standard/widgets/news/pieces/card-head.lt3 +8 -0
- data/empty_view/themes/standard/widgets/news/pieces/card-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/news/pieces/main-head.lt3 +10 -0
- data/empty_view/themes/standard/widgets/news/pieces/main-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/pages/card.css +1 -0
- data/empty_view/themes/standard/widgets/pages/custom.rb +1 -0
- data/empty_view/themes/standard/widgets/pages/local-vars.lt3 +12 -0
- data/empty_view/themes/standard/widgets/pages/local.rb +0 -0
- data/empty_view/themes/standard/widgets/pages/main.css +2 -0
- data/empty_view/themes/standard/widgets/pages/pages.rb +21 -0
- data/empty_view/themes/standard/widgets/pages/pieces/card-head.lt3 +1 -0
- data/empty_view/themes/standard/widgets/pages/pieces/card-tail.lt3 +1 -0
- data/empty_view/themes/standard/widgets/pages/pieces/main-head.lt3 +10 -0
- data/empty_view/themes/standard/widgets/pages/pieces/main-tail.lt3 +2 -0
- data/empty_view/themes/standard/widgets/pinned/README +2 -0
- data/empty_view/themes/standard/widgets/pinned/card.css +1 -0
- data/empty_view/themes/standard/widgets/pinned/custom.rb +1 -0
- data/empty_view/themes/standard/widgets/pinned/local-vars.lt3 +12 -0
- data/empty_view/themes/standard/widgets/pinned/main.css +2 -0
- data/empty_view/themes/standard/widgets/pinned/pieces/card-head.lt3 +8 -0
- data/empty_view/themes/standard/widgets/pinned/pieces/card-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/pinned/pieces/main-head.lt3 +10 -0
- data/empty_view/themes/standard/widgets/pinned/pieces/main-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/pinned/pinned.lt3 +2 -0
- data/empty_view/themes/standard/widgets/pinned/pinned.rb +14 -0
- data/empty_view/themes/standard/widgets/search/README +2 -0
- data/empty_view/themes/standard/widgets/search/card.css +1 -0
- data/empty_view/themes/standard/widgets/search/custom.rb +1 -0
- data/empty_view/themes/standard/widgets/search/local-vars.lt3 +12 -0
- data/empty_view/themes/standard/widgets/search/main.css +2 -0
- data/empty_view/themes/standard/widgets/search/pieces/card-head.lt3 +8 -0
- data/empty_view/themes/standard/widgets/search/pieces/card-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/search/pieces/main-head.lt3 +10 -0
- data/empty_view/themes/standard/widgets/search/pieces/main-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/search/search.lt3 +2 -0
- data/empty_view/themes/standard/widgets/search/search.rb +14 -0
- data/empty_view/themes/standard/widgets/sitemap/README +2 -0
- data/empty_view/themes/standard/widgets/sitemap/card.css +1 -0
- data/empty_view/themes/standard/widgets/sitemap/custom.rb +1 -0
- data/empty_view/themes/standard/widgets/sitemap/local-vars.lt3 +12 -0
- data/empty_view/themes/standard/widgets/sitemap/main.css +2 -0
- data/empty_view/themes/standard/widgets/sitemap/pieces/card-head.lt3 +8 -0
- data/empty_view/themes/standard/widgets/sitemap/pieces/card-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/sitemap/pieces/main-head.lt3 +10 -0
- data/empty_view/themes/standard/widgets/sitemap/pieces/main-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/sitemap/sitemap.lt3 +2 -0
- data/empty_view/themes/standard/widgets/sitemap/sitemap.rb +14 -0
- data/empty_view/themes/standard/widgets/tag-cloud/OLD-example.lt3 +12 -0
- data/empty_view/themes/standard/widgets/tag-cloud/README +2 -0
- data/empty_view/themes/standard/widgets/tag-cloud/card.css +1 -0
- data/empty_view/themes/standard/widgets/tag-cloud/custom.rb +1 -0
- data/empty_view/themes/standard/widgets/tag-cloud/local-vars.lt3 +12 -0
- data/empty_view/themes/standard/widgets/tag-cloud/main.css +2 -0
- data/empty_view/themes/standard/widgets/tag-cloud/pieces/card-head.lt3 +8 -0
- data/empty_view/themes/standard/widgets/tag-cloud/pieces/card-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/tag-cloud/pieces/main-head.lt3 +10 -0
- data/empty_view/themes/standard/widgets/tag-cloud/pieces/main-tail.lt3 +4 -0
- data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.lt3 +1 -10
- data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb +14 -0
- data/lib/helpers-repl.rb +4 -2
- data/lib/liveblog.rb +75 -12
- data/lib/publish.rb +0 -10
- data/lib/repl.rb +34 -21
- data/lib/runeblog.rb +9 -7
- data/lib/runeblog_version.rb +1 -1
- data/lib/view.rb +1 -1
- data/lib/xlate.rb +5 -0
- data/test/make_blog.rb +23 -2
- metadata +92 -6
- data/empty_view/remote/widgets/pages/SUBFILES +0 -1
- data/empty_view/themes/standard/widgets/calendar/calendar.lt3 +0 -6
- data/empty_view/themes/standard/widgets/pages/SUBFILES +0 -1
- data/empty_view/themes/standard/widgets/pages/generated.lt3 +0 -4
@@ -1,12 +1,3 @@
|
|
1
1
|
.mixin liveblog
|
2
2
|
|
3
|
-
|
4
|
-
https://google.com/,btn btn-dark m-1,Programming
|
5
|
-
https://google.com/,btn btn-danger m-1,Science Fiction
|
6
|
-
https://google.com/,btn btn-light m-1,Art
|
7
|
-
https://google.com/,btn btn-dark m-1,Robotics
|
8
|
-
https://google.com/,btn btn-warning m-1,Food and Travel
|
9
|
-
https://google.com/,btn btn-light m-1,DIY Hacks
|
10
|
-
https://google.com/,btn btn-info m-1,Surfing
|
11
|
-
.end
|
12
|
-
|
3
|
+
<h3>Currently nothing here -- not implemented</h3)
|
data/lib/helpers-repl.rb
CHANGED
@@ -40,7 +40,9 @@ module RuneBlog::REPL
|
|
40
40
|
"list assets" => :cmd_list_assets,
|
41
41
|
"lsa" => :cmd_list_assets,
|
42
42
|
|
43
|
-
"
|
43
|
+
"pages" => :cmd_pages,
|
44
|
+
|
45
|
+
"delete >postid" => :cmd_remove_post,
|
44
46
|
"undel $postid" => :cmd_undelete_post,
|
45
47
|
|
46
48
|
"edit $postid" => :cmd_edit_post,
|
@@ -103,7 +105,7 @@ module RuneBlog::REPL
|
|
103
105
|
end
|
104
106
|
meth = found || :cmd_INVALID
|
105
107
|
params = cmd if meth == :cmd_INVALID
|
106
|
-
puts "choose: #{[meth, params].inspect}"
|
108
|
+
# puts "choose: #{[meth, params].inspect}"
|
107
109
|
[meth, params]
|
108
110
|
end
|
109
111
|
|
data/lib/liveblog.rb
CHANGED
@@ -45,7 +45,7 @@ def dropcap
|
|
45
45
|
p:first-child:first-letter {
|
46
46
|
color: #0000ff;
|
47
47
|
float: left;
|
48
|
-
font-family:
|
48
|
+
font-family: Verdana;
|
49
49
|
font-size: 75px;
|
50
50
|
line-height: 60px;
|
51
51
|
padding-top: 4px;
|
@@ -142,7 +142,7 @@ def inset
|
|
142
142
|
end
|
143
143
|
lr = _args.first
|
144
144
|
wide = _args[1] || "25"
|
145
|
-
_passthru "<div style='float:#{lr}; width: #{wide}%; padding:8px; padding-right:12px; font-family:verdana'>"
|
145
|
+
_passthru "<div style='float:#{lr}; width: #{wide}%; padding:8px; padding-right:12px'>" # ; font-family:verdana'>"
|
146
146
|
_passthru '<b><i>'
|
147
147
|
_passthru box
|
148
148
|
_passthru_noline '</i></b></div>'
|
@@ -319,6 +319,29 @@ def recent_posts # side-effect
|
|
319
319
|
HTML
|
320
320
|
end
|
321
321
|
|
322
|
+
def _make_class_name(app)
|
323
|
+
if app =~ /[-_]/
|
324
|
+
words = app.split(/[-_]/)
|
325
|
+
name = words.map(&:capitalize).join
|
326
|
+
else
|
327
|
+
name = app.capitalize
|
328
|
+
end
|
329
|
+
return name
|
330
|
+
end
|
331
|
+
|
332
|
+
def _load_local(widget)
|
333
|
+
Dir.chdir("widgets/#{widget}") do
|
334
|
+
rclass = _make_class_name(widget)
|
335
|
+
found = (require("./#{widget}") if File.exist?("#{widget}.rb"))
|
336
|
+
code = found ? ::RuneBlog::Widget.class_eval(rclass) : nil
|
337
|
+
code
|
338
|
+
end
|
339
|
+
rescue => err
|
340
|
+
STDOUT.puts err
|
341
|
+
STDOUT.puts err.backtrace.join("\n")
|
342
|
+
exit
|
343
|
+
end
|
344
|
+
|
322
345
|
def sidebar
|
323
346
|
if _args.include? "off"
|
324
347
|
_body { } # iterate, do nothing
|
@@ -331,17 +354,25 @@ def sidebar
|
|
331
354
|
wtag = :widgets/tag
|
332
355
|
raise "Can't find #{wtag}" unless Dir.exist?(wtag)
|
333
356
|
tcard = "#{tag}-card.html"
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
357
|
+
|
358
|
+
code = _load_local(tag)
|
359
|
+
code && Dir.chdir(wtag) { code.build }
|
360
|
+
|
361
|
+
# if File.exist?(wtag/"SUBFILES")
|
362
|
+
# children = Dir[wtag/"*.lt3"] - [wtag/tag+".lt3"]
|
363
|
+
# children.each do |child|
|
364
|
+
# dest = child.sub(/.lt3$/, ".html")
|
365
|
+
# xlate src: child, dst: dest # , debug: true
|
366
|
+
# end
|
367
|
+
# end
|
341
368
|
xlate cwd: wtag, src: tag, dst: tcard # , debug: true
|
342
369
|
_include_file wtag/tcard
|
343
370
|
end
|
344
371
|
_out %[</div>]
|
372
|
+
rescue => err
|
373
|
+
puts "err = #{err}"
|
374
|
+
puts err.backtrace.join("\n")
|
375
|
+
exit
|
345
376
|
end
|
346
377
|
|
347
378
|
def stylesheet
|
@@ -606,12 +637,44 @@ def page_type(tag, title)
|
|
606
637
|
end
|
607
638
|
end
|
608
639
|
|
640
|
+
def _write_main_pages(mainfile, pairs, card_title, tag)
|
641
|
+
local = _local_tag?(tag)
|
642
|
+
pieces = @blog.view.dir/"themes/standard/widgets"/tag/:pieces
|
643
|
+
main_head = xlate! cwd: pieces, src: "main-head.lt3"
|
644
|
+
main_tail = xlate! cwd: pieces, src: "main-tail.lt3"
|
645
|
+
# ^ make into methods in pages.rb or whatever?
|
646
|
+
|
647
|
+
File.open("#{mainfile}.html", "w") do |f|
|
648
|
+
f.puts main_head
|
649
|
+
pairs.each do |file, title|
|
650
|
+
type, title = page_type(tag, title)
|
651
|
+
title = title.gsub(/\\/, "") # kludge
|
652
|
+
case type
|
653
|
+
when :local; url_ref = _widget_main(file, tag) # local always frameable
|
654
|
+
when :frame; url_ref = "href = '#{file}'" # local always frameable
|
655
|
+
when :noframe; url_ref = _blank(file) # local always frameable
|
656
|
+
end
|
657
|
+
css = "color: #8888FF; text-decoration: none; font-size: 21px" # ; font-family: verdana"
|
658
|
+
f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
|
659
|
+
end
|
660
|
+
f.puts main_tail
|
661
|
+
end
|
662
|
+
end
|
663
|
+
|
609
664
|
def _write_main(mainfile, pairs, card_title, tag)
|
610
665
|
log!(str: "Creating #{mainfile}.html", pwd: true)
|
666
|
+
|
667
|
+
if tag == "pages" # temporary experiment
|
668
|
+
_write_main_pages(mainfile, pairs, card_title, tag)
|
669
|
+
return
|
670
|
+
end
|
671
|
+
|
611
672
|
local = _local_tag?(tag)
|
673
|
+
setvar "card.title", card_title
|
674
|
+
css = "* { font-family: verdana }"
|
612
675
|
File.open("#{mainfile}.html", "w") do |f|
|
613
|
-
_html_body(f) do
|
614
|
-
f.puts "<h1>#{card_title}</h1>"
|
676
|
+
_html_body(f, css) do
|
677
|
+
f.puts "<h1>#{card_title}</h1><br><hr>"
|
615
678
|
pairs.each do |file, title|
|
616
679
|
type, title = page_type(tag, title)
|
617
680
|
title = title.gsub(/\\/, "") # kludge
|
@@ -620,7 +683,7 @@ def _write_main(mainfile, pairs, card_title, tag)
|
|
620
683
|
when :frame; url_ref = "href = '#{file}'" # local always frameable
|
621
684
|
when :noframe; url_ref = _blank(file) # local always frameable
|
622
685
|
end
|
623
|
-
css = "color: #8888FF; text-decoration: none; font-size:
|
686
|
+
css = "color: #8888FF; text-decoration: none; font-size: 21px" # ; font-family: verdana"
|
624
687
|
f.puts %[<a style="#{css}" #{url_ref}>#{title}</a> <br>]
|
625
688
|
end
|
626
689
|
end
|
data/lib/publish.rb
CHANGED
@@ -10,16 +10,6 @@ class RuneBlog::Publishing
|
|
10
10
|
def initialize(view)
|
11
11
|
log!(enter: __method__, args: [view.to_s])
|
12
12
|
@blog = RuneBlog.blog
|
13
|
-
# # Clunky...
|
14
|
-
# if params.size == 1 && params[0].is_a?(OpenStruct)
|
15
|
-
# obj = params[0]
|
16
|
-
# array = obj.to_h.values_at(:user, :server, :docroot,
|
17
|
-
# :path, :proto)
|
18
|
-
# @user, @server, @docroot, @path, @proto = *array
|
19
|
-
# else
|
20
|
-
# @user, @server, @docroot, @path, @proto = *params
|
21
|
-
# end
|
22
|
-
# find a better way?
|
23
13
|
gfile = @blog.root/:views/view/"themes/standard/global.lt3"
|
24
14
|
data = File.readlines(gfile)
|
25
15
|
grab = ->(var) { data.grep(/^#{var} /).first.chomp.split(" ", 2)[1] }
|
data/lib/repl.rb
CHANGED
@@ -36,28 +36,40 @@ module RuneBlog::REPL
|
|
36
36
|
@out
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
39
|
+
def cmd_pages(arg, testing = false)
|
40
40
|
check_empty(arg)
|
41
|
-
dir = @blog.view.dir
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
41
|
+
dir = @blog.view.dir/"themes/standard/widgets/pages"
|
42
|
+
# Assume child files already generated (and list.data??)
|
43
|
+
data = dir/"list.data"
|
44
|
+
lines = File.readlines(data)
|
45
|
+
hash = {}
|
46
|
+
lines.each do |line|
|
47
|
+
url, name = line.chomp.split(",")
|
48
|
+
source = url.sub(/.html$/, ".lt3")
|
49
|
+
hash[name] = source
|
50
|
+
end
|
51
|
+
new_item = "[New page]"
|
52
|
+
num, fname = STDSCR.menu(title: "Edit page:", items: hash.keys + [new_item])
|
53
|
+
return if fname.nil?
|
54
|
+
if fname == new_item
|
55
|
+
print "Page title: "
|
56
|
+
title = RubyText.gets
|
57
|
+
title.chomp!
|
58
|
+
print "File name (.lt3): "
|
59
|
+
fname = RubyText.gets
|
60
|
+
fname << ".lt3" unless fname.end_with?(".lt3")
|
61
|
+
fhtml = fname.sub(/.lt3$/, ".html")
|
62
|
+
File.open(data, "a") {|f| f.puts "#{fhtml},#{title}" }
|
63
|
+
new_file = dir/fname
|
64
|
+
File.open(new_file, "w") do |f|
|
65
|
+
f.puts "<h1>#{title}</h1>\n\n\n "
|
66
|
+
f.puts ".backlink"
|
67
|
+
end
|
68
|
+
edit_file(new_file)
|
69
|
+
else
|
70
|
+
target = hash[fname]
|
71
|
+
edit_file(dir/target)
|
72
|
+
end
|
61
73
|
end
|
62
74
|
|
63
75
|
def cmd_import(arg, testing = false)
|
@@ -143,6 +155,7 @@ module RuneBlog::REPL
|
|
143
155
|
n = viewnames.find_index(@blog.view.name)
|
144
156
|
name = @blog.view.name
|
145
157
|
k, name = STDSCR.menu(title: "Views", items: viewnames, curr: n) unless testing
|
158
|
+
return if name.nil?
|
146
159
|
@blog.view = name
|
147
160
|
output name + "\n"
|
148
161
|
puts "\n ", fx(name, :bold), "\n" unless testing
|
data/lib/runeblog.rb
CHANGED
@@ -60,7 +60,6 @@ class RuneBlog
|
|
60
60
|
raise BlogRepoAlreadyExists if Dir.exist?(root)
|
61
61
|
create_dirs(root)
|
62
62
|
Dir.chdir(root) do
|
63
|
-
system!("cp #{RuneBlog::Path}/../empty_view.tgz .")
|
64
63
|
create_dirs(:drafts, :views, :posts)
|
65
64
|
new_sequence
|
66
65
|
end
|
@@ -218,7 +217,7 @@ class RuneBlog
|
|
218
217
|
|
219
218
|
def mark_last_published(str)
|
220
219
|
log!(enter: __method__, args: [str])
|
221
|
-
dump(str, "last_published")
|
220
|
+
dump(str, "#{self.view.dir}/last_published")
|
222
221
|
end
|
223
222
|
|
224
223
|
def add_view(view_name)
|
@@ -253,8 +252,8 @@ class RuneBlog
|
|
253
252
|
log!(enter: __method__, args: [view_name])
|
254
253
|
check_valid_new_view(view_name)
|
255
254
|
make_empty_view_tree(view_name)
|
256
|
-
mark_last_published("Initial creation")
|
257
255
|
add_view(view_name)
|
256
|
+
mark_last_published("Initial creation")
|
258
257
|
end
|
259
258
|
|
260
259
|
def delete_view(name, force = false)
|
@@ -394,13 +393,15 @@ class RuneBlog
|
|
394
393
|
|
395
394
|
def generate_view(view) # huh?
|
396
395
|
log!(enter: __method__, args: [view])
|
397
|
-
|
396
|
+
# generate_index(view) # recent posts (recent.html)
|
398
397
|
vdir = @root/:views/view
|
399
398
|
@theme = @root/:views/view/:themes/:standard
|
400
399
|
xlate cwd: vdir/"themes/standard/etc",
|
401
400
|
src: "blog.css.lt3", copy: vdir/"remote/etc/blog.css" # , debug: true
|
402
401
|
xlate cwd: vdir/"themes/standard",
|
403
402
|
src: "blog/generate.lt3", dst: vdir/:remote/"index.html"
|
403
|
+
generate_index(view) # recent posts (recent.html)
|
404
|
+
# ^ HERE
|
404
405
|
copy("#{vdir}/assets/*", "#{vdir}/remote/assets/")
|
405
406
|
rescue => err
|
406
407
|
puts err
|
@@ -455,8 +456,8 @@ class RuneBlog
|
|
455
456
|
rem = w.sub(/themes.standard/, "remote")
|
456
457
|
create_dirs(rem)
|
457
458
|
files = Dir[w/"*"]
|
458
|
-
|
459
|
-
system!("cp #{
|
459
|
+
files = files.select {|x| x =~ /(html|css)$/ }
|
460
|
+
files.each {|file| system!("cp #{file} #{rem}") }
|
460
461
|
end
|
461
462
|
end
|
462
463
|
|
@@ -494,7 +495,8 @@ class RuneBlog
|
|
494
495
|
views = _get_views(draft)
|
495
496
|
views.each do |view|
|
496
497
|
_handle_post(draft, view)
|
497
|
-
|
498
|
+
# generate_view(view) # FIXME leads to inefficiency?
|
499
|
+
# ^ HERE
|
498
500
|
end
|
499
501
|
end
|
500
502
|
|
data/lib/runeblog_version.rb
CHANGED
data/lib/view.rb
CHANGED
data/lib/xlate.rb
CHANGED
@@ -35,3 +35,8 @@ LEXT = ".lt3"
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
|
+
def xlate!(cwd: Dir.pwd, src:, copy: nil, debug: false, force: false)
|
39
|
+
output = "/tmp/xlate-#{File.basename(src).sub(/.lt3$/, "")}"
|
40
|
+
xlate cwd: cwd, src: src, dst: output, debug: debug, force: force
|
41
|
+
File.read(output + ".html") # return all content as string
|
42
|
+
end
|
data/test/make_blog.rb
CHANGED
@@ -22,9 +22,9 @@ def debug(str = "")
|
|
22
22
|
t = Time.now
|
23
23
|
time = t.to_f.to_s
|
24
24
|
n = time.index(".")
|
25
|
-
msec = time[n
|
25
|
+
msec = time[n..(n+2)]
|
26
26
|
time = t.strftime("%H:%M:%S") + msec
|
27
|
-
STDERR.puts "#{'%-
|
27
|
+
STDERR.puts "#{'%-11s' % time} #{str}"
|
28
28
|
end
|
29
29
|
|
30
30
|
def make_post(x, title, teaser, body, views=[])
|
@@ -46,6 +46,8 @@ end
|
|
46
46
|
|
47
47
|
# "Main"...
|
48
48
|
|
49
|
+
t0 = Time.now
|
50
|
+
|
49
51
|
puts bold("\nGenerating test blog...")
|
50
52
|
|
51
53
|
system("rm -rf .blogs")
|
@@ -55,6 +57,19 @@ x = RuneBlog.new(".blogs")
|
|
55
57
|
debug("create_view: #{bold('around_austin')}")
|
56
58
|
x.create_view("around_austin") # FIXME remember view title!
|
57
59
|
|
60
|
+
#### FIXME later!!
|
61
|
+
vars = <<-VARS
|
62
|
+
|
63
|
+
.variables
|
64
|
+
blog Around Austin
|
65
|
+
blog.desc The view from downtown...
|
66
|
+
.end
|
67
|
+
VARS
|
68
|
+
File.open(".blogs/views/around_austin/themes/standard/global.lt3", "a") do |f|
|
69
|
+
f.puts vars
|
70
|
+
end
|
71
|
+
####
|
72
|
+
|
58
73
|
debug("create_view: #{bold('computing')}")
|
59
74
|
x.create_view("computing")
|
60
75
|
|
@@ -170,6 +185,12 @@ debug
|
|
170
185
|
debug("** generate_view: #{bold('around_austin')}")
|
171
186
|
x.generate_view("around_austin")
|
172
187
|
x.change_view("around_austin")
|
188
|
+
debug
|
173
189
|
|
174
190
|
puts bold("...finished.\n")
|
175
191
|
|
192
|
+
t1 = Time.now
|
193
|
+
|
194
|
+
elapsed = t1 - t0
|
195
|
+
puts "\nElapsed: #{'%3.2f' % elapsed} secs\n "
|
196
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runeblog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.40
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -61,10 +61,14 @@ files:
|
|
61
61
|
- "./README.md"
|
62
62
|
- "./runeblog.gemspec"
|
63
63
|
- bin/blog
|
64
|
+
- bin/mkwidget
|
64
65
|
- empty_view/assets/sky2.jpg
|
66
|
+
- empty_view/remote/assets/GIT_IS_DUMB
|
67
|
+
- empty_view/remote/etc/GIT_IS_DUMB
|
68
|
+
- empty_view/remote/navbar/GIT_IS_DUMB
|
69
|
+
- empty_view/remote/permalink/GIT_IS_DUMB
|
65
70
|
- empty_view/remote/widgets/links/list.data
|
66
71
|
- empty_view/remote/widgets/news/list.data
|
67
|
-
- empty_view/remote/widgets/pages/SUBFILES
|
68
72
|
- empty_view/remote/widgets/pages/list.data
|
69
73
|
- empty_view/themes/standard/README
|
70
74
|
- empty_view/themes/standard/blog/generate.lt3
|
@@ -85,21 +89,103 @@ files:
|
|
85
89
|
- empty_view/themes/standard/post/permalink.lt3
|
86
90
|
- empty_view/themes/standard/widgets/README
|
87
91
|
- empty_view/themes/standard/widgets/ad/ad.lt3
|
88
|
-
- empty_view/themes/standard/widgets/
|
92
|
+
- empty_view/themes/standard/widgets/bydates/README
|
93
|
+
- empty_view/themes/standard/widgets/bydates/bydates.lt3
|
94
|
+
- empty_view/themes/standard/widgets/bydates/bydates.rb
|
95
|
+
- empty_view/themes/standard/widgets/bydates/card.css
|
96
|
+
- empty_view/themes/standard/widgets/bydates/custom.rb
|
97
|
+
- empty_view/themes/standard/widgets/bydates/local-vars.lt3
|
98
|
+
- empty_view/themes/standard/widgets/bydates/main.css
|
99
|
+
- empty_view/themes/standard/widgets/bydates/pieces/card-head.lt3
|
100
|
+
- empty_view/themes/standard/widgets/bydates/pieces/card-tail.lt3
|
101
|
+
- empty_view/themes/standard/widgets/bydates/pieces/main-head.lt3
|
102
|
+
- empty_view/themes/standard/widgets/bydates/pieces/main-tail.lt3
|
103
|
+
- empty_view/themes/standard/widgets/links/README
|
104
|
+
- empty_view/themes/standard/widgets/links/card.css
|
105
|
+
- empty_view/themes/standard/widgets/links/custom.rb
|
89
106
|
- empty_view/themes/standard/widgets/links/links.lt3
|
107
|
+
- empty_view/themes/standard/widgets/links/links.rb
|
90
108
|
- empty_view/themes/standard/widgets/links/list.data
|
109
|
+
- empty_view/themes/standard/widgets/links/local-vars.lt3
|
110
|
+
- empty_view/themes/standard/widgets/links/main.css
|
111
|
+
- empty_view/themes/standard/widgets/links/pieces/card-head.lt3
|
112
|
+
- empty_view/themes/standard/widgets/links/pieces/card-tail.lt3
|
113
|
+
- empty_view/themes/standard/widgets/links/pieces/main-head.lt3
|
114
|
+
- empty_view/themes/standard/widgets/links/pieces/main-tail.lt3
|
115
|
+
- empty_view/themes/standard/widgets/news/README
|
116
|
+
- empty_view/themes/standard/widgets/news/card.css
|
117
|
+
- empty_view/themes/standard/widgets/news/custom.rb
|
91
118
|
- empty_view/themes/standard/widgets/news/list.data
|
119
|
+
- empty_view/themes/standard/widgets/news/local-vars.lt3
|
120
|
+
- empty_view/themes/standard/widgets/news/main.css
|
92
121
|
- empty_view/themes/standard/widgets/news/news.lt3
|
122
|
+
- empty_view/themes/standard/widgets/news/news.rb
|
123
|
+
- empty_view/themes/standard/widgets/news/pieces/card-head.lt3
|
124
|
+
- empty_view/themes/standard/widgets/news/pieces/card-tail.lt3
|
125
|
+
- empty_view/themes/standard/widgets/news/pieces/main-head.lt3
|
126
|
+
- empty_view/themes/standard/widgets/news/pieces/main-tail.lt3
|
93
127
|
- empty_view/themes/standard/widgets/pages/README
|
94
|
-
- empty_view/themes/standard/widgets/pages/
|
128
|
+
- empty_view/themes/standard/widgets/pages/card.css
|
129
|
+
- empty_view/themes/standard/widgets/pages/custom.rb
|
95
130
|
- empty_view/themes/standard/widgets/pages/disclaim.lt3
|
96
131
|
- empty_view/themes/standard/widgets/pages/faq.lt3
|
97
|
-
- empty_view/themes/standard/widgets/pages/generated.lt3
|
98
132
|
- empty_view/themes/standard/widgets/pages/like-dislike.lt3
|
99
133
|
- empty_view/themes/standard/widgets/pages/list.data
|
134
|
+
- empty_view/themes/standard/widgets/pages/local-vars.lt3
|
135
|
+
- empty_view/themes/standard/widgets/pages/local.rb
|
136
|
+
- empty_view/themes/standard/widgets/pages/main.css
|
100
137
|
- empty_view/themes/standard/widgets/pages/other-stuff.lt3
|
101
138
|
- empty_view/themes/standard/widgets/pages/pages.lt3
|
139
|
+
- empty_view/themes/standard/widgets/pages/pages.rb
|
140
|
+
- empty_view/themes/standard/widgets/pages/pieces/card-head.lt3
|
141
|
+
- empty_view/themes/standard/widgets/pages/pieces/card-tail.lt3
|
142
|
+
- empty_view/themes/standard/widgets/pages/pieces/main-head.lt3
|
143
|
+
- empty_view/themes/standard/widgets/pages/pieces/main-tail.lt3
|
144
|
+
- empty_view/themes/standard/widgets/pinned/README
|
145
|
+
- empty_view/themes/standard/widgets/pinned/card.css
|
146
|
+
- empty_view/themes/standard/widgets/pinned/custom.rb
|
147
|
+
- empty_view/themes/standard/widgets/pinned/local-vars.lt3
|
148
|
+
- empty_view/themes/standard/widgets/pinned/main.css
|
149
|
+
- empty_view/themes/standard/widgets/pinned/pieces/card-head.lt3
|
150
|
+
- empty_view/themes/standard/widgets/pinned/pieces/card-tail.lt3
|
151
|
+
- empty_view/themes/standard/widgets/pinned/pieces/main-head.lt3
|
152
|
+
- empty_view/themes/standard/widgets/pinned/pieces/main-tail.lt3
|
153
|
+
- empty_view/themes/standard/widgets/pinned/pinned.lt3
|
154
|
+
- empty_view/themes/standard/widgets/pinned/pinned.rb
|
155
|
+
- empty_view/themes/standard/widgets/search/README
|
156
|
+
- empty_view/themes/standard/widgets/search/card.css
|
157
|
+
- empty_view/themes/standard/widgets/search/custom.rb
|
158
|
+
- empty_view/themes/standard/widgets/search/local-vars.lt3
|
159
|
+
- empty_view/themes/standard/widgets/search/main.css
|
160
|
+
- empty_view/themes/standard/widgets/search/pieces/card-head.lt3
|
161
|
+
- empty_view/themes/standard/widgets/search/pieces/card-tail.lt3
|
162
|
+
- empty_view/themes/standard/widgets/search/pieces/main-head.lt3
|
163
|
+
- empty_view/themes/standard/widgets/search/pieces/main-tail.lt3
|
164
|
+
- empty_view/themes/standard/widgets/search/search.lt3
|
165
|
+
- empty_view/themes/standard/widgets/search/search.rb
|
166
|
+
- empty_view/themes/standard/widgets/sitemap/README
|
167
|
+
- empty_view/themes/standard/widgets/sitemap/card.css
|
168
|
+
- empty_view/themes/standard/widgets/sitemap/custom.rb
|
169
|
+
- empty_view/themes/standard/widgets/sitemap/local-vars.lt3
|
170
|
+
- empty_view/themes/standard/widgets/sitemap/main.css
|
171
|
+
- empty_view/themes/standard/widgets/sitemap/pieces/card-head.lt3
|
172
|
+
- empty_view/themes/standard/widgets/sitemap/pieces/card-tail.lt3
|
173
|
+
- empty_view/themes/standard/widgets/sitemap/pieces/main-head.lt3
|
174
|
+
- empty_view/themes/standard/widgets/sitemap/pieces/main-tail.lt3
|
175
|
+
- empty_view/themes/standard/widgets/sitemap/sitemap.lt3
|
176
|
+
- empty_view/themes/standard/widgets/sitemap/sitemap.rb
|
177
|
+
- empty_view/themes/standard/widgets/tag-cloud/OLD-example.lt3
|
178
|
+
- empty_view/themes/standard/widgets/tag-cloud/README
|
179
|
+
- empty_view/themes/standard/widgets/tag-cloud/card.css
|
180
|
+
- empty_view/themes/standard/widgets/tag-cloud/custom.rb
|
181
|
+
- empty_view/themes/standard/widgets/tag-cloud/local-vars.lt3
|
182
|
+
- empty_view/themes/standard/widgets/tag-cloud/main.css
|
183
|
+
- empty_view/themes/standard/widgets/tag-cloud/pieces/card-head.lt3
|
184
|
+
- empty_view/themes/standard/widgets/tag-cloud/pieces/card-tail.lt3
|
185
|
+
- empty_view/themes/standard/widgets/tag-cloud/pieces/main-head.lt3
|
186
|
+
- empty_view/themes/standard/widgets/tag-cloud/pieces/main-tail.lt3
|
102
187
|
- empty_view/themes/standard/widgets/tag-cloud/tag-cloud.lt3
|
188
|
+
- empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb
|
103
189
|
- lib/Javascript.stuff
|
104
190
|
- lib/default.rb
|
105
191
|
- lib/global.rb
|